diff --git a/src/main/java/org/ilgcc/app/inputs/Providerresponse.java b/src/main/java/org/ilgcc/app/inputs/Providerresponse.java index 7285af665..6d53c273a 100644 --- a/src/main/java/org/ilgcc/app/inputs/Providerresponse.java +++ b/src/main/java/org/ilgcc/app/inputs/Providerresponse.java @@ -93,6 +93,10 @@ public class Providerresponse extends FlowInputs { private String providerConviction; + @NotBlank(message = "{registration-convictions-info.error}") + private String providerConvictionExplanation; + + private String providerHouseholdLiveWithOthers; private String providerIdentityCheckDateOfBirthDay; private String providerIdentityCheckDateOfBirthMonth; diff --git a/src/main/java/org/ilgcc/app/pdf/ProviderApplicationPreparer.java b/src/main/java/org/ilgcc/app/pdf/ProviderApplicationPreparer.java index 3c820169e..222a47921 100644 --- a/src/main/java/org/ilgcc/app/pdf/ProviderApplicationPreparer.java +++ b/src/main/java/org/ilgcc/app/pdf/ProviderApplicationPreparer.java @@ -70,6 +70,7 @@ private Map prepareProviderResponse(Submission submissi "providerResponseContactEmail", "providerIdentityCheckSSN", "providerConviction", + "providerConvictionExplanation", "providerIdentityCheckDateOfBirthDate" ); diff --git a/src/main/java/org/ilgcc/app/submission/conditions/HasRegistrationHouseholdMembers.java b/src/main/java/org/ilgcc/app/submission/conditions/HasRegistrationHouseholdMembers.java new file mode 100644 index 000000000..4dcf37d0c --- /dev/null +++ b/src/main/java/org/ilgcc/app/submission/conditions/HasRegistrationHouseholdMembers.java @@ -0,0 +1,13 @@ +package org.ilgcc.app.submission.conditions; + +import formflow.library.data.Submission; +import org.springframework.stereotype.Component; + +@Component +public class HasRegistrationHouseholdMembers extends BasicCondition { + + @Override + public Boolean run(Submission submission) { + return run(submission, "providerHouseholdLiveWithOthers", "true"); + } +} diff --git a/src/main/java/org/ilgcc/app/submission/conditions/ProviderHouseholdRegistrationRequired.java b/src/main/java/org/ilgcc/app/submission/conditions/ProviderHouseholdRegistrationRequired.java new file mode 100644 index 000000000..edc1ab4e2 --- /dev/null +++ b/src/main/java/org/ilgcc/app/submission/conditions/ProviderHouseholdRegistrationRequired.java @@ -0,0 +1,30 @@ +package org.ilgcc.app.submission.conditions; + +import formflow.library.config.submission.Condition; +import formflow.library.data.Submission; +import java.util.List; +import org.ilgcc.app.utils.enums.ProviderType; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +@Component +public class ProviderHouseholdRegistrationRequired implements Condition { + + final static List providerTypesRequired = List.of( + ProviderType.LICENSE_EXEMPT_RELATIVE_IN_PROVIDER_HOME.name(), + ProviderType.LICENSE_EXEMPT_NONRELATIVE_IN_PROVIDER_HOME.name() + ); + + @Value("${il-gcc.allow-provider-registration-flow}") + private boolean enableProviderRegistration; + + @Override + public Boolean run(Submission submission) { + return enableProviderRegistration && displayScreen(submission); + } + + private Boolean displayScreen(Submission submission) { + String providerType = (String) submission.getInputData().getOrDefault("providerType", ""); + return providerTypesRequired.contains(providerType); + } +} diff --git a/src/main/resources/flows-config.yaml b/src/main/resources/flows-config.yaml index 111c7b904..e5aea15d5 100644 --- a/src/main/resources/flows-config.yaml +++ b/src/main/resources/flows-config.yaml @@ -586,10 +586,6 @@ flow: condition: EnableProviderRegistration nextScreens: - name: registration-getting-started - registration-family-response-intro: - condition: EnableProviderRegistration - nextScreens: - - name: confirmation-code registration-getting-started: condition: EnableProviderRegistration nextScreens: @@ -718,16 +714,23 @@ flow: nextScreens: - name: registration-household-members registration-household-members: - condition: EnableProviderRegistration + condition: ProviderHouseholdRegistrationRequired nextScreens: - name: registration-household-add-person + condition: HasRegistrationHouseholdMembers + - name: registration-family-response-intro registration-household-add-person: - condition: EnableProviderRegistration + condition: ProviderHouseholdRegistrationRequired nextScreens: - name: registration-household-add-person-info registration-household-add-person-info: + condition: ProviderHouseholdRegistrationRequired nextScreens: - - name: submit-complete-final + - name: registration-family-response-intro + registration-family-response-intro: + condition: EnableProviderRegistration + nextScreens: + - name: confirmation-code submit-complete-final: nextScreens: - name: registration-getting-started diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 9873ab4f9..f565d1025 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -1393,6 +1393,18 @@ registration-convictions.subtext=We're sorry to ask about this sensitive subject # registration-convictions-info registration-convictions-info.title=Past conviction details +registration-convictions-info.header=Can you explain what you were convicted of? +registration-convictions-info.subtext=We're sorry to ask about this sensitive subject. This information is required to help decide if you are eligible to be a CCAP child provider. +registration-convictions-info.error=Make sure to enter an explanation # registration-household-members registration-household-members.title=Household people +registration-household-members.header=Do you live with anyone else? +registration-household-members.subtext=

Include both adults and children.

+ +# registration-household-add-person +registration-household-add-person.title=Add people in your household + +# registration-family-response-intro +registration-family-response-intro.title=Respond to a family's application + diff --git a/src/main/resources/pdf-map.yaml b/src/main/resources/pdf-map.yaml index 7218f264d..f62a76317 100644 --- a/src/main/resources/pdf-map.yaml +++ b/src/main/resources/pdf-map.yaml @@ -166,6 +166,7 @@ inputFields: providerType: PROVIDER_TYPE providerIdentityCheckSSN: PROVIDER_SSN providerConviction: PROVIDER_CONVICTION + providerConvictionExplanation: PROVIDER_CONVICTION_EXPLANATION providerIdentityCheckDateOfBirthDate: PROVIDER_DOB providerSignature: PROVIDER_SIGNATURE providerSignatureDate: PROVIDER_SIGNATURE_DATE diff --git a/src/main/resources/static/assets/css/custom.css b/src/main/resources/static/assets/css/custom.css index 8e1e3fe01..27f956b11 100644 --- a/src/main/resources/static/assets/css/custom.css +++ b/src/main/resources/static/assets/css/custom.css @@ -370,6 +370,15 @@ p.normal { background-color: #ffffff; } +#providerConvictionExplanation { + padding: 15px; + background: white; + box-shadow: 0px 2px 0px #CFC5BF inset; + border: 2px #121111 solid; + font-weight: normal; + resize: none; +} + .notice-container { max-width: 55rem; margin-bottom: 0; diff --git a/src/main/resources/templates/providerresponse/registration-convictions-info.html b/src/main/resources/templates/providerresponse/registration-convictions-info.html index 338f9b512..466087f00 100644 --- a/src/main/resources/templates/providerresponse/registration-convictions-info.html +++ b/src/main/resources/templates/providerresponse/registration-convictions-info.html @@ -1,28 +1,19 @@ - - - - -
-
-
-
-
-
- - - -
- -
- -
-
-
-
-
-
- - - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/providerresponse/registration-family-response-intro.html b/src/main/resources/templates/providerresponse/registration-family-response-intro.html index f0a9702ef..6aab9a23f 100644 --- a/src/main/resources/templates/providerresponse/registration-family-response-intro.html +++ b/src/main/resources/templates/providerresponse/registration-family-response-intro.html @@ -1,6 +1,6 @@ - +
@@ -8,7 +8,7 @@
- +
diff --git a/src/main/resources/templates/providerresponse/registration-household-add-person.html b/src/main/resources/templates/providerresponse/registration-household-add-person.html index f0a9702ef..61bf08ab5 100644 --- a/src/main/resources/templates/providerresponse/registration-household-add-person.html +++ b/src/main/resources/templates/providerresponse/registration-household-add-person.html @@ -1,6 +1,6 @@ - +
@@ -8,7 +8,7 @@
- +
diff --git a/src/main/resources/templates/providerresponse/registration-household-members.html b/src/main/resources/templates/providerresponse/registration-household-members.html index 9d273e1fa..618b311e5 100644 --- a/src/main/resources/templates/providerresponse/registration-household-members.html +++ b/src/main/resources/templates/providerresponse/registration-household-members.html @@ -1,28 +1,13 @@ - - - - -
-
-
-
-
-
- - - -
- -
- -
-
-
-
-
-
- - - \ No newline at end of file + + + + \ No newline at end of file diff --git a/src/test/java/org/ilgcc/app/journeys/ProviderresponseProviderRegistrationJourneyTest.java b/src/test/java/org/ilgcc/app/journeys/ProviderresponseProviderRegistrationJourneyTest.java index ed866d412..54896c94f 100644 --- a/src/test/java/org/ilgcc/app/journeys/ProviderresponseProviderRegistrationJourneyTest.java +++ b/src/test/java/org/ilgcc/app/journeys/ProviderresponseProviderRegistrationJourneyTest.java @@ -201,6 +201,25 @@ void LicenseExemptInProviderHomeFlow() { // registration-convictions-info assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title")); + testPage.enter("providerConvictionExplanation", "Reason for conviction"); + testPage.clickContinue(); + + // registration-household-members + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-members.title")); + testPage.clickNo(); + + // registration-family-response-intro + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title")); + testPage.goBack(); + + // registration-household-members + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-members.title")); + testPage.clickYes(); + + // registration-household-add-person + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-add-person.title")); + + } @Test @@ -297,8 +316,9 @@ void LicenseExemptInChildHomeFlow() { assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title")); testPage.clickNo(); - // Skips registration-convictions-info - assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-members.title")); + // Skips registration-convictions-info and household screens + // registration-family-response-intro + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title")); } @Test @@ -385,6 +405,11 @@ void LicensedChildCareHomeFlow() { // registration-convictions-info assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title")); + testPage.enter("providerConvictionExplanation", "Reason for conviction"); + testPage.clickContinue(); + + // registration-family-response-intro + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title")); } @Test @@ -463,8 +488,8 @@ void LicensedChildCareCenterFlow() { assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions.title")); testPage.clickNo(); - // Skips registration-convictions-info - assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-household-members.title")); + // Skips registration-convictions-info and registration screens + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title")); } @Test @@ -550,6 +575,11 @@ void LicensedGroupChildCareCenterFlow() { // registration-convictions-info assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title")); + testPage.enter("providerConvictionExplanation", "Reason for conviction"); + testPage.clickContinue(); + + // registration-family-response-intro + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title")); } @Test @@ -666,6 +696,11 @@ void LicenseExemptChildCareCenter() { // registration-convictions-info assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-convictions-info.title")); + testPage.enter("providerConvictionExplanation", "Reason for conviction"); + testPage.clickContinue(); + + // registration-family-response-intro + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("registration-family-response-intro.title")); } private void createAValidLink() {