From 7041fe2b58382ca7d9ce3a9801baca81610358a6 Mon Sep 17 00:00:00 2001 From: Alan Cruikshanks Date: Thu, 27 Feb 2025 22:50:42 +0000 Subject: [PATCH] Add new TPT supplementary batch type https://eaflood.atlassian.net/browse/WATER-4201 > Part of the work to support two-part tariff bill runs We are working on adding support for two-part tariff supplementary bill runs to the service. We've [spiked the logic](https://github.com/DEFRA/water-abstraction-system/pull/1412) to understand how we can do this, but when doing it was being flagged as an error. No errors were thrown within [water-abstraction-system](https://github.com/DEFRA/water-abstraction-system), so we took a look at this project. That's when we spotted, after triggering `src/modules/billing/jobs/refresh-totals.js` an error was being thrown. This was because of the previous teams decision to validate all data both to and from the DB, and it not knowing about the new `two_part_supplementary` batch type. --- src/lib/models/batch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/models/batch.js b/src/lib/models/batch.js index 525e037df..327af0140 100644 --- a/src/lib/models/batch.js +++ b/src/lib/models/batch.js @@ -44,7 +44,8 @@ const BATCH_ERROR_CODE = { const BATCH_TYPE = { annual: 'annual', supplementary: 'supplementary', - twoPartTariff: 'two_part_tariff' + twoPartTariff: 'two_part_tariff', + tptSupplementary: 'two_part_supplementary' } const BATCH_SOURCE = {