diff --git a/backend/src/util/mapping/Mappings.js b/backend/src/util/mapping/Mappings.js index 66549ddd..b80803bf 100644 --- a/backend/src/util/mapping/Mappings.js +++ b/backend/src/util/mapping/Mappings.js @@ -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 = [ @@ -494,6 +495,7 @@ 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' }, ] module.exports = { diff --git a/frontend/src/components/funding/FundingAgreementsTab.vue b/frontend/src/components/funding/FundingAgreementsTab.vue index 4887dec0..edb0340d 100644 --- a/frontend/src/components/funding/FundingAgreementsTab.vue +++ b/frontend/src/components/funding/FundingAgreementsTab.vue @@ -90,12 +90,7 @@ export default { this.supplementaryApplications = ( await Promise.all( applications?.map((application) => - ApplicationService.getSupplementaryApplicationsByDate( - application.applicationId, - `statusCode=${SUPPLEMENTARY_APPLICATION_STATUS_CODES.APPROVED}`, - searchQueries?.dateFrom, - searchQueries?.dateTo, - ), + ApplicationService.getSupplementaryApplicationsByDate(application.applicationId, SUPPLEMENTARY_APPLICATION_STATUS_CODES.APPROVED, searchQueries?.dateFrom, searchQueries?.dateTo, true), ), ) ).flat() @@ -149,7 +144,7 @@ export default { } }, async loadIrregularExpenses(activeFA) { - const expenseApplications = await IrregularExpenseService.getIrregularExpenseApplications(activeFA.applicationId, IRREGULAR_EXPENSE_STATUS_CODES.APPROVED) + const expenseApplications = await IrregularExpenseService.getIrregularExpenseApplications(activeFA.applicationId, IRREGULAR_EXPENSE_STATUS_CODES.APPROVED, true) expenseApplications?.forEach((app) => { this.fundingAgreements.push({ startDate: app.startDate, diff --git a/frontend/src/services/applicationService.js b/frontend/src/services/applicationService.js index 0f10809d..0b384a3b 100644 --- a/frontend/src/services/applicationService.js +++ b/frontend/src/services/applicationService.js @@ -147,12 +147,12 @@ export default { } }, - async getSupplementaryApplicationsByDate(applicationId, filterQuery, startDateFrom, startDateTo) { + async getSupplementaryApplicationsByDate(applicationId, statusCode, startDateFrom, startDateTo, pcmValidated) { try { if (!applicationId) return let url = `${ApiRoutes.SUPPLEMENTARY_APPLICATIONS}/${applicationId}` - if (filterQuery) { - url += `?${filterQuery}` + if (statusCode) { + url += `?statusCode=${statusCode}` } if (startDateFrom) { url += `&dateFrom=${startDateFrom}` @@ -160,6 +160,9 @@ export default { if (startDateTo) { url += `&dateTo=${startDateTo}` } + if (pcmValidated) { + url += '&pcmValidated=true' + } const response = await ApiService.apiAxios.get(url) return response?.data } catch (error) { diff --git a/frontend/src/services/irregularExpenseService.js b/frontend/src/services/irregularExpenseService.js index 1dbe2dc1..d34f7fbc 100644 --- a/frontend/src/services/irregularExpenseService.js +++ b/frontend/src/services/irregularExpenseService.js @@ -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) {