diff --git a/src/main/java/org/ilgcc/app/inputs/Gcc.java b/src/main/java/org/ilgcc/app/inputs/Gcc.java index a21075b9f..296448893 100644 --- a/src/main/java/org/ilgcc/app/inputs/Gcc.java +++ b/src/main/java/org/ilgcc/app/inputs/Gcc.java @@ -260,6 +260,9 @@ public class Gcc extends FlowInputs { // activities-work-commute-time private String activitiesJobCommuteTime; + // parent-info-bachelors + private String applicantHasBachelorsDegree; + // activities-ed-program-type @NotBlank(message = "{errors.select-one-option}") private String educationType; @@ -342,6 +345,9 @@ public class Gcc extends FlowInputs { @Pattern(regexp = "^\\d{5}(?:-\\d{4})?$", message = "{errors.invalid-zipcode}") private String partnerEmployerZipCode; + // parent-partner-info-bachelors + private String partnerHasBachelorsDegree; + // activities-partner-ed-program-type @NotBlank(message = "{errors.select-one-option}") private String partnerEducationType; diff --git a/src/main/java/org/ilgcc/app/pdf/ParentPartnerPreparer.java b/src/main/java/org/ilgcc/app/pdf/ParentPartnerPreparer.java index dfcc4f3ae..a2434fa69 100644 --- a/src/main/java/org/ilgcc/app/pdf/ParentPartnerPreparer.java +++ b/src/main/java/org/ilgcc/app/pdf/ParentPartnerPreparer.java @@ -78,10 +78,14 @@ public Map prepareSubmissionFields(Submission submissio String educationTypePrefix = "PARTNER"; String educationTypeField = PreparerUtilities.getEducationTypeFieldValue( (String) submission.getInputData().getOrDefault("partnerEducationType", ""), educationTypePrefix); - results.put("partnerEducation", - new + results.put("partnerEducation", new SingleField("partnerEducation", educationTypeField, null)); - SingleField("partnerEducation", educationTypeField, null)); + var partnerHighestEducation = submission.getInputData().getOrDefault("partnerHasBachelorsDegree", ""); + + if(partnerHighestEducation.equals("true")){ + results.put("partnerEducationHighestLevel", + new SingleField("partnerEducationHighestLevel", "BA degree", null)); + } return results; } diff --git a/src/main/java/org/ilgcc/app/pdf/ParentPreparer.java b/src/main/java/org/ilgcc/app/pdf/ParentPreparer.java index 387a2b006..73084eb7e 100644 --- a/src/main/java/org/ilgcc/app/pdf/ParentPreparer.java +++ b/src/main/java/org/ilgcc/app/pdf/ParentPreparer.java @@ -84,9 +84,15 @@ public Map prepareSubmissionFields(Submission submissio } else if (parentGender.contains("NONBINARY")){ results.put("parentGenderTNB", new SingleField("parentGenderTNB", "Nonbinary", null)); } - } + var applicantHighestEducation = inputData.getOrDefault("applicantHasBachelorsDegree", ""); + + if(applicantHighestEducation.equals("true")){ + results.put("applicantEducationHighestLevel", + new SingleField("applicantEducationHighestLevel", "BA degree", null)); + } + return results; } diff --git a/src/main/resources/flows-config.yaml b/src/main/resources/flows-config.yaml index ef3f13e72..923749864 100644 --- a/src/main/resources/flows-config.yaml +++ b/src/main/resources/flows-config.yaml @@ -204,6 +204,9 @@ flow: nextScreens: - name: activities-add-jobs activities-add-ed-program: + nextScreens: + - name: parent-info-bachelors + parent-info-bachelors: nextScreens: - name: activities-ed-program-type activities-ed-program-type: @@ -280,6 +283,9 @@ flow: nextScreens: - name: activities-partner-add-job activities-partner-add-ed-program: + nextScreens: + - name: parent-partner-info-bachelors + parent-partner-info-bachelors: nextScreens: - name: activities-partner-ed-program-type activities-partner-ed-program-type: diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 76ba67a84..9d2c5eb1a 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -451,8 +451,11 @@ activities-work-commute-time.default.option=Select commute time activities-ed-program.title=School or training program activities-add-ed-program.header=Tell us about {0}''s school or training program activities-add-ed-program.subtext=We will ask for program info and class schedule. You may be asked to submit your GPA at the end of the semester. -activities-partner-add-ed-program.header=Now tell us about {0}''s school or training program -activities-partner-add-ed-program.subtext=We will ask for program info and class schedule. You may be asked to submit their GPA at the end of the semester. + +# parent-info-bachelors +parent-info-bachelors.title=Parent info bachelors +parent-info-bachelors.header=Do you have a Bachelor's degree? + #activities-ed-program-type activities-ed-program-type.header=What type of school or training are you enrolled in? activities-ed-program-type.belowPostSecondary=Below post-secondary @@ -517,6 +520,14 @@ activities-partner-commute-time.subtext=Their travel time will be added to their activities-partner-add-job.header.any-other-jobs=Does {0} have any other jobs? activities-partner-add-job.subtext.add-jobs-list=We will ask for their work schedule for each job. +# activities-partner-add-ed-program +activities-partner-add-ed-program.header=Now tell us about {0}''s school or training program +activities-partner-add-ed-program.subtext=We will ask for program info and class schedule. You may be asked to submit their GPA at the end of the semester. + +# parent-partner-info-bachelors +parent-partner-info-bachelors.title=Parent partner info bachelors +parent-partner-info-bachelors.header=Do they have a Bachelor's degree? + activities-partner-ed-program-method.description=This information helps us better understand {0}''s schedule. activities-partner-ed-program-method.program.header=How are {0}''s classes taught? activities-partner-ed-program-method.schedule.header=Are {0}''s classes taught on a schedule? diff --git a/src/main/resources/pdf-map.yaml b/src/main/resources/pdf-map.yaml index 1b1f64a18..5b90d268e 100644 --- a/src/main/resources/pdf-map.yaml +++ b/src/main/resources/pdf-map.yaml @@ -52,6 +52,7 @@ inputFields: applicantSchoolPhoneNumber: APPLICANT_EDUCATION_SCHOOL_PHONE applicantSchoolStartDate: APPLICANT_EDUCATION_SCHOOL_TERM_BEGIN_DATE applicantSchoolEndDate: APPLICANT_EDUCATION_SCHOOL_TERM_END_DATE + applicantEducationHighestLevel: APPLICANT_EDUCATION_HIGHEST_LEVEL parentEducation: APPLICANT_EDUCATION_TYPE partnerEducation: PARTNER_EDUCATION_TYPE parentGenderMale: APPLICANT_GENDER_MALE @@ -102,6 +103,7 @@ inputFields: partnerEducationScheduleSundayStart: PARTNER_EDUCATION_SCHEDULE_SUNDAY_START partnerEducationScheduleSundayStartAmPm: PARTNER_EDUCATION_SCHEDULE_SUNDAY_START_AM_PM + partnerEducationHighestLevel: PARTNER_EDUCATION_HIGHEST_LEVEL partnerEducationScheduleMondayEnd: PARTNER_EDUCATION_SCHEDULE_MONDAY_END partnerEducationScheduleMondayEndAmPm: PARTNER_EDUCATION_SCHEDULE_MONDAY_END_AM_PM partnerEducationScheduleTuesdayEnd: PARTNER_EDUCATION_SCHEDULE_TUESDAY_END diff --git a/src/main/resources/templates/gcc/parent-info-bachelors.html b/src/main/resources/templates/gcc/parent-info-bachelors.html new file mode 100644 index 000000000..5004ab50e --- /dev/null +++ b/src/main/resources/templates/gcc/parent-info-bachelors.html @@ -0,0 +1,37 @@ + + + + +
+
+
+
+
+
+ + + + + + + +
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/resources/templates/gcc/parent-partner-info-bachelors.html b/src/main/resources/templates/gcc/parent-partner-info-bachelors.html new file mode 100644 index 000000000..c7bbc272d --- /dev/null +++ b/src/main/resources/templates/gcc/parent-partner-info-bachelors.html @@ -0,0 +1,37 @@ + + + + +
+
+
+
+
+
+ + + + + + + +
+
+
+
+ + + \ No newline at end of file diff --git a/src/test/java/org/ilgcc/app/journeys/ActivitiesJourneyTest.java b/src/test/java/org/ilgcc/app/journeys/ActivitiesJourneyTest.java index ca6fcbe59..256c40a25 100644 --- a/src/test/java/org/ilgcc/app/journeys/ActivitiesJourneyTest.java +++ b/src/test/java/org/ilgcc/app/journeys/ActivitiesJourneyTest.java @@ -83,6 +83,10 @@ void ParentOnlyWithJobAndWorkTest() { assertThat(testPage.getHeader()).isEqualTo(getEnMessageWithParams("activities-add-ed-program.header", new Object[]{"parent first"})); testPage.clickContinue(); + //parent-info-bachelors + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("parent-info-bachelors.title")); + testPage.clickElementById("applicantHasBachelorsDegree-skip"); + //activities-ed-program-type assertThat(testPage.getElementText("educationType-highSchoolOrGed-label")).isEqualTo(getEnMessage("activities-ed-program-type.highSchool")); testPage.clickElementById("educationType-highSchoolOrGed-label"); @@ -225,6 +229,10 @@ void ParentOnlyWithSchoolOnlyTest() { assertThat(testPage.getHeader()).isEqualTo(getEnMessageWithParams("activities-add-ed-program.header", new Object[]{"parent first"})); testPage.clickContinue(); + //parent-info-bachelors + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("parent-info-bachelors.title")); + testPage.clickElementById("applicantHasBachelorsDegree-skip"); + //activities-ed-program-type assertThat(testPage.getElementText("educationType-highSchoolOrGed-label")).isEqualTo(getEnMessage("activities-ed-program-type.highSchool")); testPage.clickElementById("educationType-highSchoolOrGed-label"); @@ -413,6 +421,10 @@ void ParentAndPartnerWithJobAndWorkTest() { assertThat(testPage.getHeader()).isEqualTo(getEnMessageWithParams("activities-add-ed-program.header", new Object[]{"parent first"})); testPage.clickContinue(); + //parent-info-bachelors + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("parent-info-bachelors.title")); + testPage.clickElementById("applicantHasBachelorsDegree-skip"); + //activities-ed-program-type assertThat(testPage.getElementText("educationType-highSchoolOrGed-label")).isEqualTo(getEnMessage("activities-ed-program-type.highSchool")); testPage.clickElementById("educationType-highSchoolOrGed-label"); @@ -523,6 +535,11 @@ void ParentAndPartnerWithJobAndWorkTest() { //activities-partner-add-ed-program assertThat(testPage.getHeader()).isEqualTo(getEnMessageWithParams("activities-partner-add-ed-program.header", new Object[]{"partner"})); testPage.clickContinue(); + + //parent-partner-info-bachelors + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("parent-partner-info-bachelors.title")); + testPage.clickElementById("partnerHasBachelorsDegree-skip"); + testPage.clickElementById("partnerEducationType-fourYearCollege-label"); assertThat(testPage.getHeader()).isEqualTo(getRequiredEnMessageWithParams("activities-partner-ed-program-type.header", new Object[]{"partner"})); testPage.clickContinue(); @@ -575,6 +592,11 @@ void ParentAndPartnerWithPartnerSchoolOnlyTest() { // Note that currently, we are skipping the parent partner job questions assertThat(testPage.getHeader()).isEqualTo(getEnMessageWithParams("activities-partner-add-ed-program.header", new Object[]{"partner"})); testPage.clickContinue(); + + //parent-partner-info-bachelors + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("parent-partner-info-bachelors.title")); + testPage.clickElementById("partnerHasBachelorsDegree-skip"); + testPage.clickElementById("partnerEducationType-fourYearCollege-label"); assertThat(testPage.getHeader()).isEqualTo(getRequiredEnMessageWithParams("activities-partner-ed-program-type.header", new Object[]{"partner"})); testPage.clickContinue(); diff --git a/src/test/java/org/ilgcc/app/journeys/GccFlowJourneyTest.java b/src/test/java/org/ilgcc/app/journeys/GccFlowJourneyTest.java index 3f9d92b6b..1aafb08cf 100644 --- a/src/test/java/org/ilgcc/app/journeys/GccFlowJourneyTest.java +++ b/src/test/java/org/ilgcc/app/journeys/GccFlowJourneyTest.java @@ -324,6 +324,10 @@ void fullGccFlow() throws IOException { assertThat(testPage.getTitle()).isEqualTo(getEnMessage("activities-ed-program.title")); testPage.clickContinue(); + //parent-info-bachelors + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("parent-info-bachelors.title")); + testPage.clickYes(); + //activities-ed-program-type assertThat(testPage.getElementText("educationType-highSchoolOrGed-label")).isEqualTo(getEnMessage("activities-ed-program-type.highSchool")); testPage.clickElementById("educationType-highSchoolOrGed-label"); @@ -451,6 +455,11 @@ void fullGccFlow() throws IOException { // activities-partner-ed assertThat(testPage.getTitle()).isEqualTo(getEnMessage("activities-ed-program.title")); testPage.clickContinue(); + + //parent-partner-info-bachelors + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("parent-partner-info-bachelors.title")); + testPage.clickElementById("partnerHasBachelorsDegree-skip"); + assertThat(testPage.getTitle()).isEqualTo(getEnMessage("activities-ed-program.title")); testPage.clickElementById("partnerEducationType-twoYearCollege-label"); testPage.clickContinue(); diff --git a/src/test/java/org/ilgcc/app/pdf/ParentPartnerPreparerTest.java b/src/test/java/org/ilgcc/app/pdf/ParentPartnerPreparerTest.java index 0f57bbb52..6c671b0f0 100644 --- a/src/test/java/org/ilgcc/app/pdf/ParentPartnerPreparerTest.java +++ b/src/test/java/org/ilgcc/app/pdf/ParentPartnerPreparerTest.java @@ -127,4 +127,25 @@ public void shouldPreparePrimaryEducationTypeCheckboxFieldWhenSelected(){ assertThat(result.get("partnerEducation")).isEqualTo(new SingleField("partnerEducation", "PARTNER_EDUCATION_TYPE_INTERNSHIP", null)); } + @Test + public void shouldNotMapBAToHighestEducationIfQuestionIsSkipped(){ + submission = new SubmissionTestBuilder() + .withParentDetails() + .build(); + + Map result = preparer.prepareSubmissionFields(submission, null); + assertThat(result.get("partnerEducationHighestLevel")).isNull(); + } + + @Test + public void shouldMapBAToHighestEducationIfSelected(){ + submission = new SubmissionTestBuilder() + .withParentDetails() + .with("partnerHasBachelorsDegree", "true") + .build(); + + Map result = preparer.prepareSubmissionFields(submission, null); + assertThat(result.get("partnerEducationHighestLevel")).isEqualTo(new SingleField("partnerEducationHighestLevel", "BA degree", null)); + } + } \ No newline at end of file diff --git a/src/test/java/org/ilgcc/app/pdf/ParentPreparerTest.java b/src/test/java/org/ilgcc/app/pdf/ParentPreparerTest.java index 09c2574d1..707e98fde 100644 --- a/src/test/java/org/ilgcc/app/pdf/ParentPreparerTest.java +++ b/src/test/java/org/ilgcc/app/pdf/ParentPreparerTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import formflow.library.data.Submission; +import formflow.library.data.Submission.SubmissionBuilder; import formflow.library.pdf.SingleField; import formflow.library.pdf.SubmissionField; import java.util.List; @@ -194,7 +195,26 @@ public void shouldNotMapAnyFieldsIfClientSelectsPreferNotToAnswerToGenderQuestio Map result = preparer.prepareSubmissionFields(submission, null); assertThat(result.get("parentGenderMale")).isNotEqualTo(new SingleField("parentGenderMale", "Yes", null)); assertThat(result.get("parentGenderTNB")).isNotEqualTo(new SingleField("parentGenderTNB", "Nonbinary", null)); + } + + @Test + public void shouldNotMapBAToHighestEducationIfQuestionIsSkipped(){ + submission = new SubmissionTestBuilder() + .withParentDetails() + .build(); + + Map result = preparer.prepareSubmissionFields(submission, null); + assertThat(result.get("applicantEducationHighestLevel")).isNull(); + } + @Test + public void shouldMapBAToHighestEducationIfSelected(){ + submission = new SubmissionTestBuilder() + .withParentDetails() + .with("applicantHasBachelorsDegree", "true") + .build(); + Map result = preparer.prepareSubmissionFields(submission, null); + assertThat(result.get("applicantEducationHighestLevel")).isEqualTo(new SingleField("applicantEducationHighestLevel", "BA degree", null)); } } \ No newline at end of file diff --git a/src/test/resources/output/test_filled_ccap.pdf b/src/test/resources/output/test_filled_ccap.pdf index d7a5a3331..c4ac30a37 100644 Binary files a/src/test/resources/output/test_filled_ccap.pdf and b/src/test/resources/output/test_filled_ccap.pdf differ