Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding handling for grant beneficiary locations "outside uk" and "london" #133

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading