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

Remove licences with charge elements with approaching time limits from billing #443

Merged
merged 33 commits into from
Oct 11, 2023

Conversation

Jozzey
Copy link
Contributor

@Jozzey Jozzey commented Oct 2, 2023

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.

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 Jozzey added the enhancement New feature or request label Oct 2, 2023
@Jozzey Jozzey self-assigned this Oct 2, 2023
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.
@Jozzey Jozzey marked this pull request as ready for review October 10, 2023 20:14
@Jozzey Jozzey requested a review from Beckyrose200 October 10, 2023 20:14
Copy link
Member

@Cruikshanks Cruikshanks left a 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.

@Jozzey Jozzey requested a review from Cruikshanks October 11, 2023 11:31
Copy link
Member

@Cruikshanks Cruikshanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jozzey Jozzey merged commit 334092b into main Oct 11, 2023
4 checks passed
@Jozzey Jozzey deleted the remove-expiring-charge-elements branch October 11, 2023 11:51
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
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants