Skip to content

Commit

Permalink
Adding handling for grant beneficiary locations "outside uk" and "lon…
Browse files Browse the repository at this point in the history
…don" (#133)
  • Loading branch information
ConnorTCO authored Apr 1, 2024
1 parent 7d5a1c9 commit 1753592
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class CreateGrantBeneficiaryDto {
private Boolean locationSco;
private Boolean locationWal;
private Boolean locationNir;
private Boolean locationLon;
private Boolean locationOutUk;

@NotNull(message = "Select 'Yes, answer the equality questions' or 'No, skip the equality questions'")
private Boolean hasProvidedAdditionalAnswers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public class GetGrantBeneficiaryDto {
private Boolean locationSco;
private Boolean locationWal;
private Boolean locationNir;
private Boolean locationLon;
private Boolean locationOutUk;
private Boolean hasProvidedAdditionalAnswers;
private Boolean ageGroup1;
private Boolean ageGroup2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ public class GrantBeneficiary {
@Column
private Boolean locationNir;

@Column
private Boolean locationLon;

@Column
private Boolean locationOutUk;

@Column
private Boolean hasProvidedAdditionalAnswers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ private void createGrantBeneficiary(final Submission submission) {
.locationSco(containsLocation(locations, "Scotland"))
.locationWal(containsLocation(locations, "Wales"))
.locationNir(containsLocation(locations, "Northern Ireland"))
.locationLon(containsLocation(locations, "London"))
.locationOutUk(containsLocation(locations, "Outside of the UK"))
.gapId(submission.getGapId())
.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SubmissionServiceTest {
final String amount = "1000";
final String companiesHouseNo = "1234";
final String charityNo = "1234";
final String[] beneficiaryLocation = new String[]{"South West England", "Midlands", "Scotland"};
final String[] beneficiaryLocation = new String[]{"South West England", "Midlands", "Scotland", "London"};
final String userId = "75ab5fbd-0682-4d3d-a467-01c7a447f07c";
private final String CHRISTMAS_2022_MIDDAY = "2022-12-25T12:00:00.00z";
private final Clock clock = Clock.fixed(Instant.parse(CHRISTMAS_2022_MIDDAY), ZoneId.of("UTC"));
Expand Down Expand Up @@ -1350,6 +1350,8 @@ void submit_CreatesGrantBeneficiary() {
assertThat(capturedBeneficiary.getLocationMidEng()).isTrue();
assertThat(capturedBeneficiary.getLocationSeEng()).isFalse();
assertThat(capturedBeneficiary.getLocationNwEng()).isFalse();
assertThat(capturedBeneficiary.getLocationLon()).isTrue();
assertThat(capturedBeneficiary.getLocationOutUk()).isFalse();
assertThat(capturedBeneficiary.getGapId()).isEqualTo(submission.getGapId());
}

Expand Down

0 comments on commit 1753592

Please sign in to comment.