-
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
Persist a new return version and its requirements #1137
Conversation
https://eaflood.atlassian.net/browse/WATER-4519 Having completed the return requirements setup journey (returns-required), we need to persist both the return version (start date, reason and notes) along with its return requirements to the database. When "Approve" is clicked in the `/check` page the data in the session needs to be persisted to: - water.return_versions - water.return_requirements - water.return_requirement_points - water.return_requirement_purposes
The comment has been updated as this service is going to be used with the `GenerateReturnVersionDataService` as well as generating the data for the page that it was originally intended for
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.
I think we can simplify the tests a little. But before we get into that I thought I should flag this change first.
app/services/return-requirements/generate-return-version-requirements.service.js
Outdated
Show resolved
Hide resolved
* @module PersistReturnVersionService | ||
*/ | ||
|
||
const ReturnVersionModel = require('../../models/return-version.model.js') |
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.
NIT
const ReturnVersionModel = require('../../models/return-version.model.js') | |
const ReturnRequirementModel = require('../../models/return-requirement.model.js') | |
const ReturnRequirementPointModel = require('../../models/return-requirement-point.model.js') | |
const ReturnRequirementPurposeModel = require('../../models/return-requirement-purpose.model.js') | |
const ReturnVersionModel = require('../../models/return-version.model.js') |
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.
https://eaflood.atlassian.net/browse/WATER-4568 Having worked out how to convert the information in the return requirements setup session into the various records in the DB (see #1137) we now need to deal with how the new record impacts the existing ones. This PR will extend the persisting logic to deal with changes to the existing return versions.
https://eaflood.atlassian.net/browse/WATER-4568 Having worked out how to convert the information in the return requirements setup session into the various records in the DB (see #1137) we now need to deal with how the new record impacts the existing ones. This PR will extend the persisting logic to deal with changes to the existing return versions.
https://eaflood.atlassian.net/browse/WATER-4519
Having completed the return requirements setup journey (returns-required), we need to persist both the return version (start date, reason and notes) along with its return requirements to the database.
When "Approve" is clicked in the
/check
page the data in the session needs to be persisted to: