-
Notifications
You must be signed in to change notification settings - Fork 0
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
Handle soft deleted workflow in supp. billing #213
Merged
Merged
Conversation
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
https://eaflood.atlassian.net/browse/WATER-3999 In [Licences in Workflow should not be considered](#176) we made a change to our `FetchChargeVersionsService` to exclude any charge version that was in the `charge_version_workflows` table. It was identified as a requirement that anything in 'workflow' should not be considered for billing. When we tested we saw that when adding a charge version, for example, a `charge_version_workflow` record is created. Once the charge version gets approved the workflow record gets deleted. This is the same behaviour we have noted elsewhere. But, during UAT it was noted there were licences (charge versions) not being picked up for supplementary billing which when checking the workflow screen were not displayed. Some digging found the reason. Workflow records have a 'status'; `to_setup` or `review` (there is also `changes_requested` but we've not seen evidence of its use). We don't understand _how_ the `to_set_up` records get added (probably during the import process). But `review` appears when you add a new charge version. After some testing we've found that if you click the 'Set up' link on the entry in a licence's charge versions, it changes the workflow's status from `to_setup` to `review`. When you charge version gets approved the workflow record gets deleted. But, and this is where our work has come undone! If you click the 'Remove' link all the service does is update the workflow's `date_deleted` column. It doesn't delete the record 😮😩 We don't know why they are handled differently. But we need to account for these 'soft-deleted' workflow records in `FetchChargeVersionsService`.
StuAA78
requested changes
May 5, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me other than one place in the unit tests where we could destructure licenceId
(as we did prior to the test changes)
test/services/supplementary-billing/fetch-charge-versions.service.test.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Stuart Adair <[email protected]>
Jozzey
approved these changes
May 5, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StuAA78
approved these changes
May 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://eaflood.atlassian.net/browse/WATER-3999
In Licences in Workflow should not be considered we changed our
FetchChargeVersionsService
to exclude any charge version that was in thecharge_version_workflows
table. It was identified as a requirement that anything in 'workflow' should not be considered for billing.When we tested we saw that when adding a charge version, for example, a
charge_version_workflow
record is created. Once the charge version gets approved the workflow record gets deleted. This is the same behaviour we have noted elsewhere.But, during UAT it was noted there were licences (charge versions) not being picked up for supplementary billing which when checking the workflow screen were not displayed. Some digging found the reason.
Workflow records have a 'status';
to_setup
orreview
(there is alsochanges_requested
but we've not seen evidence of its use). We don't understand how theto_set_up
records get added (probably during the import process). Butreview
appears when you add a new charge version.After some testing, we've found that if you click the 'Set up' link on the entry in a licence's charge versions, it changes the workflow's status from
to_setup
toreview
. When your charge version gets approved the workflow record gets deleted.But, this is where our work has come undone! If you click the 'Remove' link all the service does is update the workflow's
date_deleted
column. It doesn't delete the record 😮😩We don't know why they are handled differently. But we must account for these 'soft-deleted' workflow records in
FetchChargeVersionsService
.Screenshot of setup entry