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.
PO-606: Pre-work before GET multiple Draft Account summaries
- Loading branch information
1 parent
9dc9c0c
commit c15d8eb
Showing
11 changed files
with
146 additions
and
52 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
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
54 changes: 54 additions & 0 deletions
54
src/main/java/uk/gov/hmcts/opal/dto/DraftAccountSummaryDto.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,54 @@ | ||
package uk.gov.hmcts.opal.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonRawValue; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import uk.gov.hmcts.opal.entity.DraftAccountStatus; | ||
|
||
import java.time.OffsetDateTime; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class DraftAccountSummaryDto implements ToJsonString { | ||
|
||
@JsonProperty("draft_account_id") | ||
private Long draftAccountId; | ||
|
||
@JsonProperty("created_at") | ||
private OffsetDateTime createdDate; | ||
|
||
@JsonProperty("submitted_by") | ||
private String submittedBy; | ||
|
||
@JsonProperty("business_unit_id") | ||
private Short businessUnitId; | ||
|
||
@JsonProperty("validated_at") | ||
private OffsetDateTime validatedDate; | ||
|
||
@JsonProperty("validated_by") | ||
private String validatedBy; | ||
|
||
@JsonProperty("account_snapshot") | ||
@JsonRawValue | ||
private String accountSnapshot; | ||
|
||
@JsonProperty("account_type") | ||
private String accountType; | ||
|
||
@JsonProperty("account_status") | ||
private DraftAccountStatus accountStatus; | ||
|
||
@JsonProperty("account_number") | ||
private String accountNumber; | ||
|
||
@JsonProperty("account_id") | ||
private Long accountId; | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/uk/gov/hmcts/opal/dto/DraftAccountsResponseDto.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,31 @@ | ||
package uk.gov.hmcts.opal.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class DraftAccountsResponseDto { | ||
private Integer count; | ||
private List<DraftAccountSummaryDto> summaries; | ||
|
||
public static class DraftAccountsResponseDtoBuilder { | ||
public DraftAccountsResponseDto.DraftAccountsResponseDtoBuilder summaries( | ||
List<DraftAccountSummaryDto> summaries) { | ||
this.summaries = summaries; | ||
return this.count(Optional.ofNullable(summaries).map(List::size).orElse(0)); | ||
} | ||
|
||
private DraftAccountsResponseDto.DraftAccountsResponseDtoBuilder 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
12 changes: 11 additions & 1 deletion
12
src/main/java/uk/gov/hmcts/opal/entity/DraftAccountStatus.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