generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LJA Reference Data Endpoint & infrastructure code
- Loading branch information
1 parent
1a489de
commit f04cef8
Showing
12 changed files
with
214 additions
and
8 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...JusticeAreaControllerIntegrationTest.java → ...JusticeAreaControllerIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/uk/gov/hmcts/opal/dto/reference/LjaReferenceDataResults.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package uk.gov.hmcts.opal.dto.reference; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import uk.gov.hmcts.opal.entity.projection.LjaReferenceData; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class LjaReferenceDataResults { | ||
private Integer count; | ||
private List<LjaReferenceData> refData; | ||
|
||
public static class LjaReferenceDataResultsBuilder { | ||
public LjaReferenceDataResultsBuilder refData( | ||
List<LjaReferenceData> refData) { | ||
this.refData = refData; | ||
return this.count(Optional.ofNullable(refData).map(List::size).orElse(0)); | ||
} | ||
|
||
private LjaReferenceDataResultsBuilder count(Integer count) { | ||
this.count = count; | ||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/uk/gov/hmcts/opal/entity/projection/LjaReferenceData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package uk.gov.hmcts.opal.entity.projection; | ||
|
||
public interface LjaReferenceData { | ||
|
||
Short getLocalJusticeAreaId(); | ||
|
||
String getLjaCode(); | ||
|
||
String getName(); | ||
|
||
String getAddressLine1(); | ||
|
||
String getPostcode(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters