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 Major Creditor reference data endpoint & associated code
- Loading branch information
1 parent
231d5ee
commit efbc7f7
Showing
9 changed files
with
230 additions
and
6 deletions.
There are no files selected for viewing
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/MajorCreditorReferenceDataResults.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.MajorCreditorReferenceData; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class MajorCreditorReferenceDataResults { | ||
private Integer count; | ||
private List<MajorCreditorReferenceData> refData; | ||
|
||
public static class MajorCreditorReferenceDataResultsBuilder { | ||
public MajorCreditorReferenceDataResults.MajorCreditorReferenceDataResultsBuilder refData( | ||
List<MajorCreditorReferenceData> refData) { | ||
this.refData = refData; | ||
return this.count(Optional.ofNullable(refData).map(List::size).orElse(0)); | ||
} | ||
|
||
private MajorCreditorReferenceDataResults.MajorCreditorReferenceDataResultsBuilder count(Integer count) { | ||
this.count = count; | ||
return this; | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/uk/gov/hmcts/opal/entity/projection/MajorCreditorReferenceData.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,5 @@ | ||
package uk.gov.hmcts.opal.entity.projection; | ||
|
||
public record MajorCreditorReferenceData(Long majorCreditorId, String majorCreditorCode, String name, String postcode) { | ||
|
||
} |
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
Oops, something went wrong.