-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create
error
bill run when CM fails (#104)
https://eaflood.atlassian.net/browse/WATER-3833 When we currently initiate a new bill run, a fail response from the Charging Module means we throw an error and no bill run is created. We want to revise this so that it _does_ create a new bill run but with the status `error` and with `errorCode` set to `50`. As part of this we update `BillingBatchModel` with a static getter `errorCodes`, which allows us to consistently use the correct error codes by referring to (for example) `BillingBatchModel.errorCodes.failedToCreateBillRun`.
- Loading branch information
Showing
9 changed files
with
143 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
db/migrations/20230131152030_alter-water-billing-batches.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict' | ||
|
||
const tableName = 'billing_batches' | ||
|
||
exports.up = async function (knex) { | ||
await knex | ||
.schema | ||
.withSchema('water') | ||
.alterTable(tableName, table => { | ||
table.integer('error_code') | ||
}) | ||
} | ||
|
||
exports.down = async function (knex) { | ||
await knex | ||
.schema | ||
.withSchema('water') | ||
.alterTable(tableName, table => { | ||
table.dropColumn('error_code') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters