Skip to content

Commit

Permalink
Add FetchBillingAccountsService for 2-part tariff
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4196

> Part of the work for two-part tariff annual billing

We're ready to generate a bill run from our two-part tariff review data and with [Add Continue bill run btn to 2PT review screen](#1122) and [Add new two-part tariff generate bill run endpoint](#1123) we have the means to trigger it.

We're following the pattern used in SROC annual billing of fetching the data needed by billing account. A bill run is made up of 'bills', one for each billing account. We learnt during the building of the SROC annual engine that having the root record as the billing account vastly simplified the process (we will complete our refactor of SROC supplementary one day!)

So, this change adds the `FetchBillingAccountsService` for two-part tariff bill runs. It goes without saying it is a bit of a beast! We are not just having to retrieve charge version, reference and element records but their equivalents in the review dataset.

It results in a massive Objection.js query. The good news is there is little complexity. It is a straight up data retrieval service.

Still a lot of code though! 😳😬
  • Loading branch information
Cruikshanks committed Jun 20, 2024
1 parent c50af2f commit 29e74f2
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 29e74f2

Please sign in to comment.