Skip to content

Commit

Permalink
Support new queued bill run status (#95)
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-3877

When a supplementary bill run is started, we'll be creating both a PRESROC and SROC one at the same time.

The PRESROC one will then begin `processing` (labelled as BUILDING in the UI) whilst the SROC one is `queued` waiting to be processed.

At the moment though, all we can do is initialise the SROC bill run with a status of `processing` as that is all that is available to us. In the UI this will give the impression both are building when they're not.

We've added a new `queued` status to [water-abstraction-service](DEFRA/water-abstraction-service#1965) and support for it in [water-abstraction-ui](DEFRA/water-abstraction-ui#2271). This change updates changes the default status we apply to new bill runs to be `queued`.
  • Loading branch information
Cruikshanks authored Jan 24, 2023
1 parent f0275ea commit d7b0c48
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function go (regionId, billingPeriod, batchType = 'supplementary', scheme
batchType,
fromFinancialYearEnding: billingPeriod.endDate.getFullYear(),
toFinancialYearEnding: billingPeriod.endDate.getFullYear(),
status: 'processing',
status: 'queued',
scheme,
source,
externalId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Create Billing Batch service', () => {

expect(result).to.be.an.instanceOf(BillingBatchModel)

expect(result.status).to.equal('processing')
expect(result.status).to.equal('queued')
expect(result.fromFinancialYearEnding).to.equal(2023)
expect(result.toFinancialYearEnding).to.equal(2023)
expect(result.batchType).to.equal('supplementary')
Expand All @@ -56,7 +56,7 @@ describe('Create Billing Batch service', () => {

expect(result).to.be.an.instanceOf(BillingBatchModel)

expect(result.status).to.equal('processing')
expect(result.status).to.equal('queued')
expect(result.fromFinancialYearEnding).to.equal(2023)
expect(result.toFinancialYearEnding).to.equal(2023)
expect(result.batchType).to.equal(batchType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('Initiate Billing Batch service', () => {
expect(result.region).to.equal(billingBatch.regionId)
expect(result.scheme).to.equal('sroc')
expect(result.batchType).to.equal('supplementary')
expect(result.status).to.equal('processing')
expect(result.status).to.equal('queued')
})
})

Expand Down
4 changes: 2 additions & 2 deletions test/support/helpers/water/billing-batch.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const BillingBatchModel = require('../../../../app/models/water/billing-batch.mo
* - `batchType` - supplementary
* - `fromFinancialYearEnding` - 2023
* - `toFinancialYearEnding` - 2023
* - `status` - processing
* - `status` - queued
* - `scheme` - sroc
* - `source` - wrls
*
Expand Down Expand Up @@ -45,7 +45,7 @@ function defaults (data = {}) {
batchType: 'supplementary',
fromFinancialYearEnding: 2023,
toFinancialYearEnding: 2023,
status: 'processing',
status: 'queued',
scheme: 'sroc',
source: 'wrls'
}
Expand Down

0 comments on commit d7b0c48

Please sign in to comment.