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

Persist a new return version and its requirements #1137

Merged
merged 48 commits into from
Jul 16, 2024
Merged

Conversation

Jozzey
Copy link
Contributor

@Jozzey Jozzey commented Jun 24, 2024

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

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
@Jozzey Jozzey added the enhancement New feature or request label Jun 24, 2024
@Jozzey Jozzey self-assigned this Jun 24, 2024
@Jozzey Jozzey marked this pull request as ready for review July 4, 2024 19:32
@Jozzey Jozzey requested a review from Cruikshanks July 4, 2024 19:32
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.

I think we can simplify the tests a little. But before we get into that I thought I should flag this change first.

@Jozzey Jozzey requested a review from Cruikshanks July 8, 2024 19:07
* @module PersistReturnVersionService
*/

const ReturnVersionModel = require('../../models/return-version.model.js')
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT

Suggested change
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')

Copy link
Contributor

@Beckyrose200 Beckyrose200 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 1502d56 into main Jul 16, 2024
6 checks passed
@Jozzey Jozzey deleted the persist-returns branch July 16, 2024 09:05
Jozzey added a commit that referenced this pull request Jul 31, 2024
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.
Jozzey added a commit that referenced this pull request Aug 9, 2024
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.
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.

4 participants