From ba52e8097bbe14b3dd6b2e810fcd156fb51d9f63 Mon Sep 17 00:00:00 2001 From: Sree P Date: Fri, 22 Dec 2023 15:42:20 -0800 Subject: [PATCH] WIC ECE design updates --- .../actions/FormatSubmittedAtDate.java | 16 ++++- .../conditions/InterestedInWicEce.java | 24 +++++++ src/main/resources/flows-config.yaml | 4 +- src/main/resources/messages.properties | 14 ++-- .../templates/fragments/cardHeader.html | 10 +++ .../fragments/wicEceConfirmation.html | 6 +- .../laDigitalAssister/confirmation.html | 34 +++++----- .../actions/FormatSubmittedAtDateTest.java | 67 +++++++++++++++++++ 8 files changed, 145 insertions(+), 30 deletions(-) create mode 100644 src/main/java/org/ladocuploader/app/submission/conditions/InterestedInWicEce.java create mode 100644 src/main/resources/templates/fragments/cardHeader.html create mode 100644 src/test/java/org/ladocuploader/app/submission/actions/FormatSubmittedAtDateTest.java diff --git a/src/main/java/org/ladocuploader/app/submission/actions/FormatSubmittedAtDate.java b/src/main/java/org/ladocuploader/app/submission/actions/FormatSubmittedAtDate.java index d1fba66dd..5df9d0d5f 100644 --- a/src/main/java/org/ladocuploader/app/submission/actions/FormatSubmittedAtDate.java +++ b/src/main/java/org/ladocuploader/app/submission/actions/FormatSubmittedAtDate.java @@ -2,6 +2,7 @@ import formflow.library.config.submission.Action; import formflow.library.data.Submission; +import org.joda.time.DateTime; import org.springframework.stereotype.Component; import java.text.SimpleDateFormat; @@ -13,7 +14,11 @@ @Component public class FormatSubmittedAtDate implements Action { public final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("MMMM d, yyyy"); - private static final long TEN_DAYS = (1000 * 60 * 60 * 24) * 10; + private static final long ONE_DAY = 1000 * 60 * 60 * 24; + private static final long TEN_BUSINESS_DAYS = ONE_DAY * 14; + + private static final int SATURDAY = 6; + private static final int SUNDAY = 7; @Override public void run(Submission submission) { @@ -23,7 +28,14 @@ public void run(Submission submission) { String formattedSubmittedAt = DATE_FORMAT.format(submittedAt); submission.getInputData().put("formattedSubmittedAt", formattedSubmittedAt); - String interviewDate = DATE_FORMAT.format(new Date(submittedAt.getTime() + TEN_DAYS)); + DateTime submittedDate = new DateTime(submittedAt); + long tenDaysLater = submittedAt.getTime() + TEN_BUSINESS_DAYS; + if (submittedDate.getDayOfWeek() == SATURDAY) { + tenDaysLater -= ONE_DAY; + } else if (submittedDate.getDayOfWeek() == SUNDAY) { + tenDaysLater -= 2 * ONE_DAY; + } + String interviewDate = DATE_FORMAT.format(new Date(tenDaysLater)); submission.getInputData().put("interviewDate", interviewDate); } } diff --git a/src/main/java/org/ladocuploader/app/submission/conditions/InterestedInWicEce.java b/src/main/java/org/ladocuploader/app/submission/conditions/InterestedInWicEce.java new file mode 100644 index 000000000..5b8a9def8 --- /dev/null +++ b/src/main/java/org/ladocuploader/app/submission/conditions/InterestedInWicEce.java @@ -0,0 +1,24 @@ +package org.ladocuploader.app.submission.conditions; + +import formflow.library.config.submission.Condition; +import formflow.library.data.Submission; +import org.springframework.stereotype.Component; + +@Component +public class InterestedInWicEce implements Condition { + + private final InNolaParish inNola; + private final InterestedInECE interestedInECE; + private final InterestedInWIC interestedInWIC; + + public InterestedInWicEce(InNolaParish inNola, InterestedInECE interestedInECE, InterestedInWIC interestedInWIC) { + this.inNola = inNola; + this.interestedInECE = interestedInECE; + this.interestedInWIC = interestedInWIC; + } + + @Override + public Boolean run(Submission submission) { + return inNola.run(submission) && (interestedInECE.run(submission) || interestedInWIC.run(submission)); + } +} diff --git a/src/main/resources/flows-config.yaml b/src/main/resources/flows-config.yaml index 510b8c460..d627d5a78 100644 --- a/src/main/resources/flows-config.yaml +++ b/src/main/resources/flows-config.yaml @@ -423,8 +423,10 @@ flow: wicApply: nextScreens: - name: nolaApplyThankYou - condition: InNolaParish + condition: InterestedInWicEce - name: outsideNolaApplyThankYou + condition: InterestedInWIC + - name: finalSignPost nolaApplyThankYou: nextScreens: - name: finalSignPost diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 152640d8b..cdf24f8ff 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -1061,7 +1061,7 @@ confirmation.helpful-resources.l1=Return to benef confirmation.helpful-resources.l2=Create an account in LA CAF\u00C9 to manage your benefits. confirmation.next-steps=Your next steps confirmation.next-steps-immediate=Your immediate next steps -confirmation.p1_html=You are required to complete an interview. You''ll receive an appointment letter by {0} with your interview details.

If you don't get your letter by then, please call the following toll free number (833) 323-7482 between Monday - Friday, 8 AM-2 PM by to schedule an interview. +confirmation.p1_html=You are required to complete an interview. You''ll receive an appointment letter by {0} with your interview details.

If you don''t get your letter by then, please call the following toll free number (833) 323-7482 between Monday - Friday, 8 AM-2 PM by to schedule an interview. confirmation.looking_for_job_html=You are required to create a HiRE account. Create a HiRE account on Louisiana Works in order to receive SNAP benefits. confirmation.p2_html=Within the next 30 days, expect to get a letter in the mail about your application. The letter will tell you if you are eligible or not. confirmation.p3=Call LAHelpU at (888) 524-3578 if you have any questions about your online application. @@ -1118,21 +1118,21 @@ wic.based-on-your-answers=Based on your answers, you might qualify for Women, wic.would-you-like-share-data=Would you like to share your data with WIC to see if you qualify? nola-ece-links.title=ECE link -nola-ece.if-youre-approved=If you\u2019re approved for SNAP, you\u2019re also eligible for free childcare and pre-K. +nola-ece.if-youre-approved=If you\u2019re approved for SNAP, you\u2019re also eligible for free childcare and pre-K. nola-ece.subheader=These programs can: nola-ece-links.at-the-end-of-this-app=At the end of this application, we\u2019ll show you a clickable link to the NOLA Public Schools application (enrollnolaps.com). nola-ece-links.are-you-interested=Are you interested in free childcare or pre-K? nola-ece-go-to-application=Go to the ECE application wic-links.title=WIC link -wic.if-youre-approved=If you\u2019re approved for SNAP, you\u2019re also eligible for the Women, Infants, and Children (WIC) program. +wic.if-youre-approved=If you\u2019re approved for SNAP, you\u2019re also eligible for WIC. wic.subheader=WIC can: wic-links.at-the-end-of-this-app=At the end of this application, we\u2019ll show you a clickable link to the WIC application (surveymonkey.com/r/LAWIC_InterestForm). wic-links.are-you-interested=Are you interested in the WIC nutrition program? wic-go-to-application=Go to the WIC application -ece-yes-confirmation.header=Here is the link for submitting an application for free childcare and pre-K! -ece-no-confirmation.header=Here\u2019s one more chance to apply for free childcare and pre-K. +ece-yes-confirmation.header=Here is the link for submitting an application for free childcare and pre-K! +ece-no-confirmation.header=Here\u2019s one more chance to apply for free childcare and pre-K. wic-yes-confirmation.header=Here is the link for submitting an application for the Women, Infants, and Children (WIC) program! wic-no-confirmation.header=Here\u2019s one more chance to apply for the WIC nutrition program. @@ -1141,8 +1141,8 @@ nola-ece-apply.would-you-like=Would you like us to send your information to New nola-ece-apply.would-you-like-help=NOLA-PS would contact you to finish the application. nola-ece-apply.yes-start-app=Yes, start my free childcare app -ece-notice-confirmation=Free Childcare or Pre-K: You are required to finish your application with the New Orleans Public Schools. You will receive a text from NOLA-PS within one week, with a link to finish your application and list the childcare and pre-K programs you would like to apply to.

While you wait, you can go to nola.explore.avela.org to find programs you like! -wic-notice-confirmation=WIC: You are required to finish your application with the Louisiana Department of Health. You will be contacted by a WIC clinic staff member to schedule an appointment to complete the final steps.

You can also call a local WIC clinic directly to schedule an in-person appointment. Visit this map to find a clinic near you. +ece-notice-confirmation=Free Childcare or Pre-K: You are required to finish your application with the New Orleans Public Schools. You will receive a text from NOLA-PS within one week, with a link to finish your application and list the childcare and pre-K programs you would like to apply to.

While you wait, you can go to nola.explore.avela.org to find programs you like! +wic-notice-confirmation=WIC: You are required to finish your application with the Louisiana Department of Health. You will be contacted by a WIC clinic staff member to schedule an appointment to complete the final steps.

You can also call a local WIC clinic directly to schedule an in-person appointment. Visit this map to find a clinic near you. confirmation-what-to-expect-after=What to expect after confirmation-for-snap=For SNAP confirmation-for-snap-questions=For SNAP questions diff --git a/src/main/resources/templates/fragments/cardHeader.html b/src/main/resources/templates/fragments/cardHeader.html new file mode 100644 index 000000000..2d5c74b9a --- /dev/null +++ b/src/main/resources/templates/fragments/cardHeader.html @@ -0,0 +1,10 @@ +
+

+

+
diff --git a/src/main/resources/templates/fragments/wicEceConfirmation.html b/src/main/resources/templates/fragments/wicEceConfirmation.html index b3e692260..2260eaf5c 100644 --- a/src/main/resources/templates/fragments/wicEceConfirmation.html +++ b/src/main/resources/templates/fragments/wicEceConfirmation.html @@ -30,14 +30,14 @@


-

+


-

+

-

+

diff --git a/src/main/resources/templates/laDigitalAssister/confirmation.html b/src/main/resources/templates/laDigitalAssister/confirmation.html index bac8b02a6..7d5e6de84 100644 --- a/src/main/resources/templates/laDigitalAssister/confirmation.html +++ b/src/main/resources/templates/laDigitalAssister/confirmation.html @@ -20,23 +20,6 @@ - - - - - - -
    -
  • -
  • -
-
-
-
@@ -72,6 +55,23 @@

+ + + + + + +
    +
  • +
  • +
+
+
+
diff --git a/src/test/java/org/ladocuploader/app/submission/actions/FormatSubmittedAtDateTest.java b/src/test/java/org/ladocuploader/app/submission/actions/FormatSubmittedAtDateTest.java new file mode 100644 index 000000000..bb29d65f8 --- /dev/null +++ b/src/test/java/org/ladocuploader/app/submission/actions/FormatSubmittedAtDateTest.java @@ -0,0 +1,67 @@ +package org.ladocuploader.app.submission.actions; + +import formflow.library.data.Submission; +import org.joda.time.LocalDate; +import org.junit.jupiter.api.Test; + +import java.util.Date; +import java.util.HashMap; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +class FormatSubmittedAtDateTest { + + private final FormatSubmittedAtDate action = new FormatSubmittedAtDate(); + + @Test + public void testWeekday() { + Date friday = new LocalDate("2023-12-22").toDate(); + Submission submission = Submission.builder() + .urlParams(new HashMap<>()) + .inputData(new HashMap<>()) + .submittedAt(friday) + .build(); + + action.run(submission); + + String formattedDate = "December 22, 2023"; + String interviewDate = "January 5, 2024"; + assertThat(submission.getInputData().get("formattedSubmittedAt")).isEqualTo(formattedDate); + assertThat(submission.getInputData().get("interviewDate")).isEqualTo(interviewDate); + } + + @Test + public void testSaturday() { + Date friday = new LocalDate("2023-12-23").toDate(); + Submission submission = Submission.builder() + .urlParams(new HashMap<>()) + .inputData(new HashMap<>()) + .submittedAt(friday) + .build(); + + action.run(submission); + + String formattedDate = "December 23, 2023"; + String interviewDate = "January 5, 2024"; + assertThat(submission.getInputData().get("formattedSubmittedAt")).isEqualTo(formattedDate); + assertThat(submission.getInputData().get("interviewDate")).isEqualTo(interviewDate); + } + + @Test + public void testSunday() { + Date friday = new LocalDate("2023-12-24").toDate(); + Submission submission = Submission.builder() + .urlParams(new HashMap<>()) + .inputData(new HashMap<>()) + .submittedAt(friday) + .build(); + + action.run(submission); + + String formattedDate = "December 24, 2023"; + String interviewDate = "January 5, 2024"; + assertThat(submission.getInputData().get("formattedSubmittedAt")).isEqualTo(formattedDate); + assertThat(submission.getInputData().get("interviewDate")).isEqualTo(interviewDate); + } + +} \ No newline at end of file