Skip to content

Commit

Permalink
update the filter for pcm approvals
Browse files Browse the repository at this point in the history
  • Loading branch information
jenbeckett committed Nov 20, 2024
1 parent d8f9993 commit 6ac7ad5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions backend/src/util/mapping/Mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ const SupplementaryApplicationMappings = [
{ back: 'ofm_renewal_term', front: 'renewalTerm' },
{ back: 'ofm_retroactive_date', front: 'retroactiveDate' },
{ back: 'ofm_funding_number', front: 'fundingAgreementNumber' },
{ back: 'ofm_pcm_validated', front: 'pcmValidated' },
]

const RoleMappings = [
Expand Down Expand Up @@ -494,6 +495,8 @@ const IrregularExpenseMappings = [
{ back: 'ofm_expenseid', front: 'irregularExpenseId' },
{ back: '_ofm_application_value', front: 'applicationId' },
{ back: 'ofm_funding_number', front: 'fundingAgreementNumber' },
{ back: 'ofm_pcm_validated', front: 'pcmValidated' },

Check failure on line 499 in backend/src/util/mapping/Mappings.js

View workflow job for this annotation

GitHub Actions / Run ESLint

Delete `⏎`
]

module.exports = {
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/funding/FundingAgreementsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
applications?.map((application) =>
ApplicationService.getSupplementaryApplicationsByDate(
application.applicationId,
`statusCode=${SUPPLEMENTARY_APPLICATION_STATUS_CODES.APPROVED}`,
`statusCode=${SUPPLEMENTARY_APPLICATION_STATUS_CODES.APPROVED}&pcmValidated=true`,
searchQueries?.dateFrom,
searchQueries?.dateTo,
),
Expand Down Expand Up @@ -149,7 +149,8 @@ export default {
}
},
async loadIrregularExpenses(activeFA) {
const expenseApplications = await IrregularExpenseService.getIrregularExpenseApplications(activeFA.applicationId, IRREGULAR_EXPENSE_STATUS_CODES.APPROVED)
const getPCMValidation = true
const expenseApplications = await IrregularExpenseService.getIrregularExpenseApplications(activeFA.applicationId, IRREGULAR_EXPENSE_STATUS_CODES.APPROVED, getPCMValidation)
expenseApplications?.forEach((app) => {
this.fundingAgreements.push({
startDate: app.startDate,
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/services/irregularExpenseService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import ApiService from '@/common/apiService'
import { ApiRoutes } from '@/utils/constants'

export default {
async getIrregularExpenseApplications(applicationId, statusCode = undefined) {
async getIrregularExpenseApplications(applicationId, statusCode = undefined, pcmValidated = undefined) {
try {
if (!applicationId) return
let url = `${ApiRoutes.IRREGULAR_APPLICATIONS}?applicationId=${applicationId}`
if (statusCode) {
url += `&statusCode=${statusCode}`
}
if (pcmValidated) {
url += '&pcmValidated=true'
}
const response = await ApiService.apiAxios.get(url)
return response?.data
} catch (error) {
Expand Down

0 comments on commit 6ac7ad5

Please sign in to comment.