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

Licences in Workflow should not be considered #176

Merged
merged 6 commits into from
Mar 27, 2023

Conversation

Jozzey
Copy link
Contributor

@Jozzey Jozzey commented Mar 27, 2023

https://eaflood.atlassian.net/browse/WATER-3949

Prevent licences that appear in the charge_versions_workflow table from being included in the bill run.

If a licence is in the workflow for any reason it is a business requirement that it is not included in supplementary billing.

This change insures that any charge versions linked to a licence that is in workflow are not included in a supplementary bill run.

https://eaflood.atlassian.net/browse/WATER-3949

Prevent licences that appear in the workflow from being included in the bill run.
@Jozzey Jozzey added the enhancement New feature or request label Mar 27, 2023
@Jozzey Jozzey marked this pull request as ready for review March 27, 2023 13:08
@Jozzey Jozzey requested review from Cruikshanks and StuAA78 March 27, 2023 13:08
Cruikshanks
Cruikshanks previously approved these changes Mar 27, 2023
@Jozzey Jozzey merged commit d793976 into main Mar 27, 2023
@Jozzey Jozzey deleted the licences-in-workflow-should-not-be-considered branch March 27, 2023 13:30
Cruikshanks added a commit that referenced this pull request May 5, 2023
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`.
Cruikshanks added a commit that referenced this pull request May 5, 2023
https://eaflood.atlassian.net/browse/WATER-3999

In [Licences in Workflow should not be considered](#176) we changed 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 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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants