diff --git a/src/main/java/org/mdbenefits/app/inputs/MdBenefitsFlow.java b/src/main/java/org/mdbenefits/app/inputs/MdBenefitsFlow.java index fb70b10c..1cbad526 100644 --- a/src/main/java/org/mdbenefits/app/inputs/MdBenefitsFlow.java +++ b/src/main/java/org/mdbenefits/app/inputs/MdBenefitsFlow.java @@ -403,4 +403,12 @@ public class MdBenefitsFlow extends FlowInputs { @NotBlank(message = "{doc-type.select-a-type}") @DynamicField private String docType; + + private String noOneHasDrugKingpinFelony; + private String noOneHasVolumeDrugDealerFelony; + private String noOneHasSexualOffenceConviction; + private String noOneIsViolatingParole; + private String noOneConvictedForLyingAboutBenefits; + private String noOneConvictedForTradingBenefits; + private String noOneIsReceivingBenefitsWithFakeID; } diff --git a/src/main/java/org/mdbenefits/app/preparers/ApplicantDetailsPreparer.java b/src/main/java/org/mdbenefits/app/preparers/ApplicantDetailsPreparer.java index a85e3efa..8811a6f9 100644 --- a/src/main/java/org/mdbenefits/app/preparers/ApplicantDetailsPreparer.java +++ b/src/main/java/org/mdbenefits/app/preparers/ApplicantDetailsPreparer.java @@ -11,10 +11,13 @@ import java.util.List; import java.util.Map; import java.util.stream.Stream; +import lombok.extern.slf4j.Slf4j; +import org.mdbenefits.app.submission.actions.SetDefaultSensitiveConvictionAnswers; import org.mdbenefits.app.utils.SubmissionUtilities; import org.springframework.stereotype.Component; @Component +@Slf4j public class ApplicantDetailsPreparer implements SubmissionFieldPreparer { @Override @@ -36,6 +39,20 @@ public Map prepareSubmissionFields(Submission submissio results.put("applicantSSN", new SingleField("applicantSSN", SubmissionUtilities.formatSSN((String) inputData.get("encryptedSSN")), null)); results.put("speaksEnglish", new SingleField("speaksEnglish", (String) "Yes", null)); + prepareAnswersToSensitiveQuestions(inputData, results); return results; } + + private static void prepareAnswersToSensitiveQuestions(Map inputData, Map results) { + for (String question : SetDefaultSensitiveConvictionAnswers.SENSITIVE_CONVICTION_QUESTIONS) { + String yesField = "noOne" + question; + String noField = "someone" + question; + List response = (List) inputData.get(yesField + "[]"); + if (response != null && response.contains("true")) { + results.put(yesField, new SingleField(yesField, "Yes", null)); + } else { + results.put(noField, new SingleField(noField, "Yes", null)); + } + } + } } diff --git a/src/main/java/org/mdbenefits/app/submission/actions/SetDefaultSensitiveConvictionAnswers.java b/src/main/java/org/mdbenefits/app/submission/actions/SetDefaultSensitiveConvictionAnswers.java new file mode 100644 index 00000000..011ab3e8 --- /dev/null +++ b/src/main/java/org/mdbenefits/app/submission/actions/SetDefaultSensitiveConvictionAnswers.java @@ -0,0 +1,32 @@ +package org.mdbenefits.app.submission.actions; + +import formflow.library.config.submission.Action; +import formflow.library.data.Submission; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import lombok.extern.slf4j.Slf4j; +import org.mdbenefits.app.utils.HouseholdUtilities; +import org.springframework.stereotype.Component; + +/** + * + */ +@Component +@Slf4j +public class SetDefaultSensitiveConvictionAnswers implements Action { + public static final String[] SENSITIVE_CONVICTION_QUESTIONS = { + "HasDrugKingpinFelony", + "HasVolumeDrugDealerFelony", + "HasSexualOffenceConviction", + "IsViolatingParole", + "ConvictedForLyingAboutBenefits", + "ConvictedForTradingBenefits", + "IsReceivingBenefitsWithFakeID" + }; + + @Override + public void run(Submission submission) { + Arrays.stream(SENSITIVE_CONVICTION_QUESTIONS).forEach(s -> submission.getInputData().putIfAbsent("noOne" + s + "[]", "true")); + } +} diff --git a/src/main/resources/flows-config.yaml b/src/main/resources/flows-config.yaml index e55730c2..59e26613 100644 --- a/src/main/resources/flows-config.yaml +++ b/src/main/resources/flows-config.yaml @@ -409,6 +409,13 @@ flow: nextScreens: - name: legalStuff legalStuff: + nextScreens: + - name: sensitiveConvictionQuestionsIntro + sensitiveConvictionQuestionsIntro: + nextScreens: + - name: sensitiveConvictionQuestions + sensitiveConvictionQuestions: + beforeDisplayAction: SetDefaultSensitiveConvictionAnswers nextScreens: - name: rightsAndResponsibilities rightsAndResponsibilities: diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 1497ce76..e186881e 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -1002,6 +1002,22 @@ legal-stuff.answer-legal-question=Answer legal questions legal-stuff.review-legal-agreements=Review legal agreements legal-stuff.sign-and-submit=Sign and submit +sensitive-conviction-questions.title=Sensitive Questions +sensitive-conviction-questions.header=Please check what is true for you and everyone in your household +sensitive-conviction-questions.subtext=If any statements are not true, you can talk to a case worker after submitting your application to see who is able to get benefits. + +sensitive-conviction-question-HasDrugKingpinFelony=No one has been convicted of a felony that involved conspiring to supervise, organize, finance, or manage the making, transporting, or selling of controlled substances in the State on or after August 22, 1996. +sensitive-conviction-question-HasVolumeDrugDealerFelony=No one has been convicted of a felony that involved making, distributing, dispensing, or possessing controlled substances on or after August 22, 1996. +sensitive-conviction-question-HasSexualOffenceConviction=No one has been convicted abuse, assault, murder, or exploitation after February 7, 2014 and is not compliant with the terms of their sentence. +sensitive-conviction-question-IsViolatingParole=No one is violating parole, probation or fleeing from police or the courts. +sensitive-conviction-question-ConvictedForLyingAboutBenefits=Since August 22, 1996, no one has been convicted in courts of lying about where they lived or their identity in order to receive food benefits or cash assistance from multiple places in the same month. +sensitive-conviction-question-ConvictedForTradingBenefits=No one has been convicted in a court for trafficking $500 or more of food benefits. +sensitive-conviction-question-IsReceivingBenefitsWithFakeID=No one is getting food or cash benefits under a different identity or as a member of another household in another State. +sensitive-conviction-question-true=True + +sensitive-conviction-questions-intro.title=Sensitive Questions Intro +sensitive-conviction-questions-intro.header=Sensitive questions +sensitive-conviction-questions-intro.subtext=Next, we will ask you questions that may be sensitive.

It's important to be honest so we can give you and your household the benefits you're entitled to get. rights-and-responsibilities-title=Legal Stuff rights-and-responsibilities-header1=The legal stuff diff --git a/src/main/resources/pdf-map.yaml b/src/main/resources/pdf-map.yaml index 9bc176e1..07cc70fa 100644 --- a/src/main/resources/pdf-map.yaml +++ b/src/main/resources/pdf-map.yaml @@ -26,6 +26,22 @@ inputFields: mailingAddress: mailingAddress signature: signature sex: applicantSex + + someoneHasDrugKingpinFelony: someoneHasDrugKingpinFelony + noOneHasDrugKingpinFelony: noOneHasDrugKingpinFelony + someoneHasVolumeDrugDealerFelony: someoneHasVolumeDrugDealerFelony + noOneHasVolumeDrugDealerFelony: noOneHasVolumeDrugDealerFelony + someoneHasSexualOffenceConviction: someoneHasSexualOffenceConviction + noOneHasSexualOffenceConviction: noOneHasSexualOffenceConviction + someoneIsViolatingParole: someoneIsViolatingParole + noOneIsViolatingParole: noOneIsViolatingParole + someoneConvictedForLyingAboutBenefits: someoneConvictedForLyingAboutBenefits + noOneConvictedForLyingAboutBenefits: noOneConvictedForLyingAboutBenefits + someoneConvictedForTradingBenefits: someoneConvictedForTradingBenefits + noOneConvictedForTradingBenefits: noOneConvictedForTradingBenefits + someoneIsReceivingBenefitsWithFakeID: someoneIsReceivingBenefitsWithFakeID + noOneIsReceivingBenefitsWithFakeID: noOneIsReceivingBenefitsWithFakeID + # Vraj - Usable to here diff --git a/src/main/resources/pdfs/9701.pdf b/src/main/resources/pdfs/9701.pdf index 76bcd946..0e57aa36 100644 Binary files a/src/main/resources/pdfs/9701.pdf and b/src/main/resources/pdfs/9701.pdf differ diff --git a/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestions.html b/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestions.html new file mode 100644 index 00000000..80e47a34 --- /dev/null +++ b/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestions.html @@ -0,0 +1,42 @@ + + + + +
+
+
+
+
+
+ + + +
+
+ + + + +
+
+ +
+
+
+
+
+
+
+ + + diff --git a/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestionsIntro.html b/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestionsIntro.html new file mode 100644 index 00000000..3fa2c849 --- /dev/null +++ b/src/main/resources/templates/mdBenefitsFlow/sensitiveConvictionQuestionsIntro.html @@ -0,0 +1,22 @@ + + + + +
+
+
+
+
+
+ + +
+
+
+
+ + + diff --git a/src/test/java/org/mdbenefits/app/journeys/MdBenefitsFlowJourneyTest.java b/src/test/java/org/mdbenefits/app/journeys/MdBenefitsFlowJourneyTest.java index 208f20ff..53926c81 100644 --- a/src/test/java/org/mdbenefits/app/journeys/MdBenefitsFlowJourneyTest.java +++ b/src/test/java/org/mdbenefits/app/journeys/MdBenefitsFlowJourneyTest.java @@ -754,6 +754,12 @@ void completeFlow() { assertThat(testPage.getTitle()).isEqualTo(message("legal-stuff.title")); testPage.clickContinue(); + assertThat(testPage.getTitle()).isEqualTo(message("sensitive-conviction-questions-intro.title")); + testPage.clickContinue(); + + assertThat(testPage.getTitle()).isEqualTo(message("sensitive-conviction-questions.title")); + testPage.clickContinue(); + assertThat(testPage.getTitle()).isEqualTo(message("rights-and-responsibilities-title")); testPage.clickElementById("rightsAndResponsibilitiesAgree-true"); testPage.clickElementById("noIncorrectInformationAgree-true"); diff --git a/src/test/java/org/mdbenefits/app/pdf/PdfServiceTest.java b/src/test/java/org/mdbenefits/app/pdf/PdfServiceTest.java index 280498b8..a520a73e 100644 --- a/src/test/java/org/mdbenefits/app/pdf/PdfServiceTest.java +++ b/src/test/java/org/mdbenefits/app/pdf/PdfServiceTest.java @@ -9,6 +9,7 @@ import formflow.library.pdf.PdfService; import java.io.File; import java.io.IOException; +import java.util.List; import java.util.Map; import org.junit.jupiter.api.Test; import org.mdbenefits.app.data.SubmissionTestBuilder; @@ -37,6 +38,8 @@ void generate() throws IOException { .with("homeAddressZipCode", "94103") .with("phoneNumber", "(510) 555-1212") .with("signature", "John Hancock") + .with("noOneIsReceivingBenefitsWithFakeID[]", List.of("true")) + .with("noOneHasDrugKingpinFelony[]", List.of()) .build(); submission.setFlow("mdBenefitsFlow");