Skip to content

Commit

Permalink
Include charge category in 2PT matching results (#343)
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4046

One thing we are struggling with when checking the results from the endpoint is we cannot see the charge category, for example, **4.6.24**.

This change updates the 2PT matching service to fetch the linked record so we can include it in the results.
  • Loading branch information
Cruikshanks authored Aug 8, 2023
1 parent c55dd5f commit fd7b3c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/services/check/two-part.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ async function _fetchChargeVersions (billingPeriod, naldRegionId) {
.modifyGraph('chargeVersions.chargeElements', (builder) => {
builder.whereJsonPath('chargeElements.adjustments', '$.s127', '=', true)
})
.withGraphFetched('chargeElements.billingChargeCategory')
.modifyGraph('chargeElements.billingChargeCategory', (builder) => {
builder.select([
'reference',
'shortDescription'
])
})
.withGraphFetched('chargeElements.chargePurposes.purposesUse')

return chargeVersions
Expand Down

0 comments on commit fd7b3c0

Please sign in to comment.