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

DDLS-7: New pages to add: Has there been any money into the client's account during the reporting period? (Money In) #1437

Merged
merged 27 commits into from
Nov 29, 2023

Conversation

MiaGordon91
Copy link
Contributor

@MiaGordon91 MiaGordon91 commented Oct 30, 2023

Purpose

Add two new pages to money in section that gives deputies the option to report that there has been no money in to the clients account during the reporting period.

Fixes DDPB-4808

Approach

  • New twig files created for each page

  • Validation added to radio option and text box

  • Functions and routing added to MoneyInController and MoneyInShortController

  • New data persisted to the database

  • Applied these changes for 102 (High Assets) and 103 (Low Assets) reports

  • Bonus: Fixed validation issues on the significant decisions section

Learning

Any tips and tricks, blog posts or tools which helped you. Plus anything notable you've discovered about DigiDeps

Checklist

  • I have performed a self-review of my own code
  • I have updated documentation (Confluence/ADR/tech debt doc) where relevant
  • I have added tests to prove my work
  • The product team have approved these changes
  • I have checked my work for potential security issues and refered to the OWASP top 10

Frontend

  • I have run an in-browser accessibility test (e.g. WAVE, Lighthouse)
  • There are no deprecated CSS classes noted in the profiler
  • Translations are used and the profiler doesn't identify any missing
  • Any links or buttons added are screen reader friendly and contextually complete
  • If adding GA events, I have updated or checked the existing category or label values

@MiaGordon91 MiaGordon91 requested a review from a team as a code owner October 30, 2023 17:16
Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Merging #1437 (994401d) into main (238f224) will increase coverage by 52.60%.
The diff coverage is 50.00%.

❗ Current head 994401d differs from pull request most recent head 81aab5f. Consider uploading reports for the commit 81aab5f to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           main    #1437       +/-   ##
=========================================
+ Coverage      0   52.60%   +52.60%     
=========================================
  Files         0      268      +268     
  Lines         0     8221     +8221     
=========================================
+ Hits          0     4325     +4325     
- Misses        0     3896     +3896     
Flag Coverage Δ
api 52.60% <50.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
api/src/Service/ReportStatusService.php 93.68% <50.00%> (ø)

... and 267 files with indirect coverage changes

Raffers
Raffers previously approved these changes Nov 1, 2023
@@ -170,6 +170,10 @@ public function getMoneyInState()
{
if ($this->report->hasMoneyIn()) {
return ['state' => self::STATE_DONE, 'nOfRecords' => count($this->report->getMoneyTransactionsIn())];
} elseif ($this->report->getMoneyInExists() && $this->report->getReasonForNoMoneyIn()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you might have missed the ! before $this->report->getMoneyInExists().

I am assuming that we use the state done if they haven't put any money in but have provided a reason for no money in.

A similar issue for the last elseif statement where we mark it as incomplete if they haven't put any money in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once the new pages are wired up, there will also be an answer for the 'getMoneyExists' property - it would be a 'yes' or 'no'.

  • The first statement accounts for a deputy reporting money in items.
  • The second statement accounts for when a deputy has an answer for the getMoneyExists (which would be 'no') question and getReasonForNoMoneyIn - the state would be marked as done.
  • The final statement accounts for when a deputy answers the 'getMoneyExists' question but hasn't entered a reason yet - the state would be marked as incomplete

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed to rename the 'getMoneyInExists' property to avoid confusion

@MiaGordon91 MiaGordon91 changed the title DDPB-4808: New pages to add: Has there been any money into the client's account during the reporting period? DDPB-4808: New pages to add: Has there been any money into the client's account during the reporting period? (Money In) Nov 15, 2023
@MiaGordon91 MiaGordon91 changed the title DDPB-4808: New pages to add: Has there been any money into the client's account during the reporting period? (Money In) DDPB-48081437: New pages to add: Has there been any money into the client's account during the reporting period? (Money In) Nov 15, 2023
$answer = $form['reasonForNoMoneyIn']->getData();

$report->setReasonForNoMoneyIn($answer);
$report->getStatus()->setMoneyInState(Status::STATE_DONE);
Copy link
Contributor

Choose a reason for hiding this comment

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

I started looking into how we set and retrieve the states for the different sections, but wasn't able to find any place where we actually set the state of a section to incomplete or done.

Might need to figure out how this is done for other sections to make sure we are being consistent.

This isn't bad/wrong as far as I can tell though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @Gugandeep , thanks for your feedback.

I haven’t actioned this as part of this ticket as I believe that me and Nil will action this as part of the wiring up ticket as my changes will tie in with the updated summary page which will complete the user flow and allow us to update the status update for that section.

I think I had to do a similar thing for the significant decisions work, so I’ll probably revisit that PR to check how the sections state is updated

Gugandeep
Gugandeep previously approved these changes Nov 29, 2023
Gugandeep
Gugandeep previously approved these changes Nov 29, 2023
@MiaGordon91 MiaGordon91 merged commit baae526 into main Nov 29, 2023
@MiaGordon91 MiaGordon91 deleted the DDPB-4808 branch November 29, 2023 16:58
@MiaGordon91 MiaGordon91 changed the title DDPB-48081437: New pages to add: Has there been any money into the client's account during the reporting period? (Money In) DDLS-7: New pages to add: Has there been any money into the client's account during the reporting period? (Money In) Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants