Skip to content

Commit

Permalink
Fix check two-part tariff region endpoint
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4057

When we were updating the existing check endpoint to include changes made to support the alternate version of the matching and allocating engine (see [Update 2PT check endpoint with alternate changes](#582)) we confirmed our working by constantly pinging the `/check/two-part-licence/{licenceId}` endpoint.

We overlooked checking `/check/two-part/{naldRegionId}` (in our defence this is a hack endpoint!) If we had we would have found that it is broken.

This change fixes it.
  • Loading branch information
Cruikshanks committed Dec 15, 2023
1 parent c810d7b commit 9d9f814
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/services/check/two-part.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ function _billingPeriod () {
async function _determineRegionId (identifier, type) {
if (type === 'region') {
const region = await RegionModel.query()
.select('identifier')
.select('id')
.where('naldRegionId', identifier)
.limit(1)
.first()

return region.id
}
Expand Down

0 comments on commit 9d9f814

Please sign in to comment.