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

Return log 'received' confirmation page #1670

Merged
merged 39 commits into from
Feb 14, 2025

Conversation

rvsiyad
Copy link
Contributor

@rvsiyad rvsiyad commented Jan 30, 2025

https://eaflood.atlassian.net/browse/WATER-4888

When a user has started the Submit journey on a Due return log, has completed the two previous pages, and selected Record receipt they will arrive at the confirm received page. This page will update the return log for the licence with a status of Received and updated received_date in the database.

This PR creates the return log received confirmation page.

https://eaflood.atlassian.net/browse/WATER-4888

When a user has started the `Submit` journey on a `Due` return log, has completed the two previous pages, and selected `Record receipt` they will arrive
at the confirm received page. This page will update the return log for the licence with a status of `Received` and updated `received_date` in the database.

This PR creates the return log received confirmation page.
@rvsiyad rvsiyad added the enhancement New feature or request label Jan 30, 2025
@rvsiyad rvsiyad self-assigned this Jan 30, 2025
@rvsiyad rvsiyad marked this pull request as ready for review February 6, 2025 14:56
@rvsiyad rvsiyad requested review from Cruikshanks, Jozzey, StuAA78 and Beckyrose200 and removed request for Cruikshanks, Jozzey, StuAA78 and Beckyrose200 February 6, 2025 14:56
@Cruikshanks Cruikshanks marked this pull request as draft February 10, 2025 15:08
'confirm-received' isn't a "thing", so it cannot be fetched. So, we update the fetch service's name to reflect what it is actually fetching.
Will be handy to explain why this submit controller is doing something different to the others.
In the service it self, we just needed to update it to reflect the name change of the fetch service.

The key change was in the tests. There was clearly some confusion with references to sessions, when this page actually has nothing to do with the setup session. Plus tests for things the page doesn't actually do (they happen elsewhere).

But the ky change is to take advantage of why we have services and separate fetch modules. It means we can stub the fetch and avoid interacting with the DB.
This is where if a user has selected to record receipt of a return log only, we make all our changes to the DB. The critical issues were

- we were setting the status to `completed` and not `received`
- we were not setting the `updatedAt` field to reflect the date and time of the change

Other than that, we just did a bit of refactoring to move the logic that does this into its own method.
We update the 'Arrange' part of the tests to better reflect a 'real' scenario. We also only generate a return log to update for those tests that require it.

We merge those tests that require checking the return log was properly updated to reduce the number of DB interactions we depend on.
@Cruikshanks Cruikshanks marked this pull request as ready for review February 14, 2025 17:22
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.

@Cruikshanks Cruikshanks merged commit fa227bf into main Feb 14, 2025
7 checks passed
@Cruikshanks Cruikshanks deleted the return-log-received-confirmation-page branch February 14, 2025 17:24
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