Skip to content

Commit

Permalink
Merge pull request #422 from bcgov/ofmcc-6475-pcm-verfication-on-fund…
Browse files Browse the repository at this point in the history
…ing-table

Ofmcc 6475 pcm verification on funding table
  • Loading branch information
jenbeckett authored Nov 20, 2024
2 parents 5b86e24 + 1f0ba68 commit 5950e8d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 2 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,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 = {
Expand Down
9 changes: 2 additions & 7 deletions frontend/src/components/funding/FundingAgreementsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/services/applicationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,22 @@ 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}`
}
if (startDateTo) {
url += `&dateTo=${startDateTo}`
}
if (pcmValidated) {
url += '&pcmValidated=true'
}
const response = await ApiService.apiAxios.get(url)
return response?.data
} catch (error) {
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 5950e8d

Please sign in to comment.