-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add logic to trigger SROC supplementary from PRESROC #2247
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-3828 When PRESROC supplementary billing has completed, we want to trigger SROC supplementary billing.
The unit tests for `routing` didn't easily lend themselves to how we wanted to write our tests, so we refactor them to make our lives a little easier.
We add `TRIGGER_SROC_SUPPLEMENTARY` to our `.env` file which we can use to enable the new behaviour
The method of redirection used to determine routing can only handle `GET` requests. We therefore change the `POST` endpoint developed to be a `GET` endpoint instead. We also pass in the region as a parameter since this is what we'll need this to kick off the sroc supplementary billing
Cruikshanks
requested changes
Dec 8, 2022
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.
The minor-ist of minor changes!
Co-authored-by: Alan Cruikshanks <alan.cruikshanks@gmail.com>
Cruikshanks
approved these changes
Dec 8, 2022
Jozzey
approved these changes
Dec 8, 2022
Cruikshanks
added a commit
to DEFRA/water-abstraction-system
that referenced
this pull request
Jan 2, 2023
We need something that handles formatting the response for the POST `/bill-runs` endpoint. We use what we did in DEFRA/water-abstraction-ui#2247 as a spec.
Cruikshanks
added a commit
to DEFRA/water-abstraction-system
that referenced
this pull request
Jan 2, 2023
We need something that handles formatting the response for the POST `/bill-runs` endpoint. We use what we did in DEFRA/water-abstraction-ui#2247 as a spec.
StuAA78
added a commit
to DEFRA/water-abstraction-system
that referenced
this pull request
Jan 3, 2023
* Update "create bill run" endpoint to create a bill run https://eaflood.atlassian.net/browse/WATER-3854 When we set up our "create bill run" endpoint, we had it simply respond to requests with a dummy response. We now update it to actually create a bill run and an event, and return the required details in the same format as the dummy response. * Add `idColumn` static method to `BillingBatchModel` As we start to look at creating entries in the db, we run into an issue when Objection errors because it can't find an `id` column. On investigation it turns out that if the primary id column isn't called `id`, it needs to be specified in the model. We therefore add an `idColumn` static method to our billing batch model * Initial pass at inserting bill run in db We update our `createBillRun` controller to create a record for the bill run in the db. We initially hardcode the financial year fields just to get it working, with the intention of pulling these through properly from the request in a later commit * Move bill runs controller into folder We try and follow that the path you see in the url matches where the controller sits in the repo. * Add presenter for formatting response We need something that handles formatting the response for the POST `/bill-runs` endpoint. We use what we did in DEFRA/water-abstraction-ui#2247 as a spec. * Add new initialise Billing Batch service At the start of a new bill run we need to - create the initial billing batch record - create the associated event record - send a request to the SROC Charging Module API and link it to our billing batch With those 3 things done we can return control back to the requester (which will be the UI) whilst we get on with the rest of the bill run process. This adds the service that will handle those 3 steps. We're waiting on additional functionality before we can do the last one. But for now steps 1 & 2 are done and we'll have a home for step 3 when it's ready! * Refactor bill-runs controller to use new service Now we've created the InitiateBillingBatchService we refactor the bill runs controller to use it. Co-authored-by: Alan Cruikshanks <alan.cruikshanks@gmail.com>
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-3828
When presroc supplementary billing has completed, we want to trigger sroc supplementary billing. To do this we update the existing billing routing so that when the current batch has reached
ready
status, we check to see if it's a presroc supplementary batch so we can trigger the creation of an sroc supplementary batch if needed, and continue the billing flow using this new batch so the user once again sees the spinner page until it has completed.At present we don't have the ability to create sroc supplementary batches so we simply create a dummy batch with its status already set to
ready
.This is all hidden behind a feature flag
TRIGGER_SROC_SUPPLEMENTARY
.