Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken CheckLiveBillRunService #841

Merged
merged 5 commits into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/services/bill-runs/check-live-bill-run.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ const LIVE_STATUSES = ['processing', 'ready', 'review', 'queued']
* The process is that an annual bill run is generated at the start of the financial year then multiple supplementary
* bill runs to deal with any changes after the annual bill run has been processed.
*
* @param {String} regionId The id of the region to be checked
* @param {Number} toFinancialYearEnding The financial year to be checked
* @param {String} batchType The bill run type to be checked
* @param {String} regionId - The UUID of the region to be checked
* @param {Number} toFinancialYearEnding - The financial year to be checked
* @param {String} batchType - The bill run type to be checked
*
* @returns {Boolean} Whether a "live" bill run exists
* @returns {Promise<Boolean>} true if a live bill run is found else false
*/
async function go (regionId, toFinancialYearEnding, batchType) {
const statuses = LIVE_STATUSES
const statuses = [...LIVE_STATUSES]

// Only one annual bill run per region and financial year is allowed. So, we include sent and sending in the statues
// to check for
Expand All @@ -42,7 +42,7 @@ async function go (regionId, toFinancialYearEnding, batchType) {
batchType,
scheme: 'sroc'
})
.whereIn('status', LIVE_STATUSES)
.whereIn('status', statuses)
.resultSize()

return numberOfLiveBillRuns !== 0
Expand Down
Loading