-
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
Remove licences with charge elements with approaching time limits from billing #443
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-3486 The purpose of this PR is to build an endpoint, that when hit will remove from billing licences with charge elements that have time limits which are coming to an end so that incorrect invoices are not sent.
Jozzey
added a commit
that referenced
this pull request
Oct 9, 2023
https://eaflood.atlassian.net/browse/WATER-3486 Whilst working on the unit tests for the enhancement in this PR #443 it was found that we would need the migrations, model, helper and unit tests for table `licence_versions`. These will be created in this PR.
Jozzey
added a commit
that referenced
this pull request
Oct 10, 2023
…rsions` (#456) https://eaflood.atlassian.net/browse/WATER-3486 Whilst working on the unit tests for the enhancement in this PR #443 it was found that we would need the migration script, model, helper and unit tests for table `licence_versions`. These will be created in this PR.
Cruikshanks
requested changes
Oct 10, 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.
Got some changes plus suggestions for naming. If grabbing me to pair will help get this over the line let me know.
app/services/charge-elements/fetch-licences-for-workflow.service.js
Outdated
Show resolved
Hide resolved
app/services/charge-elements/fetch-licences-for-workflow.service.js
Outdated
Show resolved
Hide resolved
app/services/charge-elements/fetch-licences-for-workflow.service.js
Outdated
Show resolved
Hide resolved
test/services/charge-elements/add-licences-to-workflow.service.test.js
Outdated
Show resolved
Hide resolved
app/services/charge-elements/fetch-licences-for-workflow.service.js
Outdated
Show resolved
Hide resolved
app/services/charge-elements/add-licences-to-workflow.service.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
Co-authored-by: Alan Cruikshanks <[email protected]>
Cruikshanks
approved these changes
Oct 11, 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.
Cruikshanks
added a commit
that referenced
this pull request
Dec 19, 2023
https://eaflood.atlassian.net/browse/WATER-4270 This is indirectly related to WATER-4270, which is about getting a better understanding of what the 'jobs' in [water-abstraction-import](https://github.com/DEFRA/water-abstraction-import) are doing. One of the blockers to that has been simply finding them all in the code base! It's not always easy to find them, especially when the word 'job' in the legacy code base has to means and uses and are often the same thing! 😱😂 To try and avoid that happening in our code base this change moves our existing 'jobs' to a `/jobs` endpoint and tidies up the underlying structure to match. We also add a bit of info for the uninitiated to define what we mean by 'job' and explain the approach we have gone for. We've briefly spoken about doing this as a team awhile back. We also plan to arrange for the latest job to be added ([Remove licences with charge elements with approaching time limits from billing](#443)) to be setup in `production` as part of the next release. So, whilst we're reminded of this housekeeping task now seems a good time to do it.
Cruikshanks
added a commit
that referenced
this pull request
Dec 19, 2023
https://eaflood.atlassian.net/browse/WATER-4270 This is indirectly related to WATER-4270, which is about getting a better understanding of what the 'jobs' in [water-abstraction-import](https://github.com/DEFRA/water-abstraction-import) are doing. One of the blockers to that has been simply finding them all in the code base! It's not always easy to find them, especially when the word 'job' in the legacy code base has two different uses and is often used for the same thing! 😱😂 To try and avoid that happening in our code base this change moves our existing 'jobs' to a `/jobs` endpoint and tidies up the underlying structure to match. We've briefly spoken about doing this as a team a while back. We also plan to arrange for the latest job to be added ([Remove licences with charge elements with approaching time limits from billing](#443)) to be set up in `production` as part of the next release. So, whilst we're reminded of this housekeeping task now seems a good time to do it.
Demwunz
pushed a commit
that referenced
this pull request
Dec 20, 2023
https://eaflood.atlassian.net/browse/WATER-4270 This is indirectly related to WATER-4270, which is about getting a better understanding of what the 'jobs' in [water-abstraction-import](https://github.com/DEFRA/water-abstraction-import) are doing. One of the blockers to that has been simply finding them all in the code base! It's not always easy to find them, especially when the word 'job' in the legacy code base has two different uses and is often used for the same thing! 😱😂 To try and avoid that happening in our code base this change moves our existing 'jobs' to a `/jobs` endpoint and tidies up the underlying structure to match. We've briefly spoken about doing this as a team a while back. We also plan to arrange for the latest job to be added ([Remove licences with charge elements with approaching time limits from billing](#443)) to be set up in `production` as part of the next release. So, whilst we're reminded of this housekeeping task now seems a good time to do it.
Demwunz
pushed a commit
that referenced
this pull request
Dec 20, 2023
https://eaflood.atlassian.net/browse/WATER-4270 This is indirectly related to WATER-4270, which is about getting a better understanding of what the 'jobs' in [water-abstraction-import](https://github.com/DEFRA/water-abstraction-import) are doing. One of the blockers to that has been simply finding them all in the code base! It's not always easy to find them, especially when the word 'job' in the legacy code base has two different uses and is often used for the same thing! 😱😂 To try and avoid that happening in our code base this change moves our existing 'jobs' to a `/jobs` endpoint and tidies up the underlying structure to match. We've briefly spoken about doing this as a team a while back. We also plan to arrange for the latest job to be added ([Remove licences with charge elements with approaching time limits from billing](#443)) to be set up in `production` as part of the next release. So, whilst we're reminded of this housekeeping task now seems a good time to do it.
Demwunz
pushed a commit
that referenced
this pull request
Dec 20, 2023
https://eaflood.atlassian.net/browse/WATER-4270 This is indirectly related to WATER-4270, which is about getting a better understanding of what the 'jobs' in [water-abstraction-import](https://github.com/DEFRA/water-abstraction-import) are doing. One of the blockers to that has been simply finding them all in the code base! It's not always easy to find them, especially when the word 'job' in the legacy code base has two different uses and is often used for the same thing! 😱😂 To try and avoid that happening in our code base this change moves our existing 'jobs' to a `/jobs` endpoint and tidies up the underlying structure to match. We've briefly spoken about doing this as a team a while back. We also plan to arrange for the latest job to be added ([Remove licences with charge elements with approaching time limits from billing](#443)) to be set up in `production` as part of the next release. So, whilst we're reminded of this housekeeping task now seems a good time to do it.
Demwunz
pushed a commit
that referenced
this pull request
Dec 20, 2023
https://eaflood.atlassian.net/browse/WATER-4270 This is indirectly related to WATER-4270, which is about getting a better understanding of what the 'jobs' in [water-abstraction-import](https://github.com/DEFRA/water-abstraction-import) are doing. One of the blockers to that has been simply finding them all in the code base! It's not always easy to find them, especially when the word 'job' in the legacy code base has two different uses and is often used for the same thing! 😱😂 To try and avoid that happening in our code base this change moves our existing 'jobs' to a `/jobs` endpoint and tidies up the underlying structure to match. We've briefly spoken about doing this as a team a while back. We also plan to arrange for the latest job to be added ([Remove licences with charge elements with approaching time limits from billing](#443)) to be set up in `production` as part of the next release. So, whilst we're reminded of this housekeeping task now seems a good time to do it.
Cruikshanks
added a commit
that referenced
this pull request
Apr 14, 2024
https://eaflood.atlassian.net/browse/WATER-3486 In [Remove licences with charge elements with approaching time limits from billing](#443) we added a background job to do just that. Then in [Refactor to use new view based WATER models](#569) we updated how we interact with the DB. We updated the service which fetches the data for the job. But we didn't clock that this results in the job erroring because we are no longer passing in `licenceId`. Without it we error trying to create the `workflow` record in the DB because of a constraint on the field. We spotted this when working on [New job to add new & updated licences to workflow](#903) so this change is mainly about fixing the bug. But we also realised one of the reasons we'd failed to spot the issue was a lack of logging. So, we also updated the job to use our pattern of logging how long the process took. We also take an idea from the new job and set a flag on the `workflow` record so we can spot _why_ it was created.
Cruikshanks
added a commit
that referenced
this pull request
Apr 14, 2024
https://eaflood.atlassian.net/browse/WATER-3486 In [Remove licences with charge elements with approaching time limits from billing](#443) we added a background job to do just that. Then in [Refactor to use new view-based WATER models](#569) we updated how we interact with the DB. We updated the service which fetches the data for the job. But we didn't spot that this results in the job erroring because we are no longer passing in `licenceId`. Without it, we error trying to create the `workflow` record in the DB because of a constraint on the field. We spotted this when working on [New job to add new & updated licences to workflow](#903) so this change is mainly about fixing the bug. But we also realised one of the reasons we'd failed to spot the issue was a lack of logging. So, we also updated the job to use our pattern of logging how long the process took. We also take an idea from the new job and set a flag on the `workflow` record so we can spot _why_ it was created.
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-3486
The purpose of this PR is to build an endpoint, that when hit will remove from billing licences with charge elements that have time limits which are coming to an end so that incorrect invoices are not sent.