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-559: Update DraftAccount POST endpoint
- Loading branch information
1 parent
7ca5d81
commit 339741d
Showing
16 changed files
with
386 additions
and
51 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
63 changes: 63 additions & 0 deletions
63
src/main/java/uk/gov/hmcts/opal/dto/AddDraftAccountRequestDto.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,63 @@ | ||
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 com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import uk.gov.hmcts.opal.util.KeepAsJsonDeserializer; | ||
|
||
import java.time.OffsetDateTime; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class AddDraftAccountRequestDto implements ToJsonString { | ||
|
||
@JsonProperty("draft_account_id") | ||
private Long draftAccountId; | ||
|
||
@JsonProperty("created_at") | ||
private OffsetDateTime createdDate; | ||
|
||
@JsonProperty("validated_at") | ||
private OffsetDateTime validatedDate; | ||
|
||
@JsonProperty(value = "business_unit_id", required = true) | ||
private Short businessUnitId; | ||
|
||
@JsonProperty("validated_by") | ||
private String validatedBy; | ||
|
||
@JsonProperty(value = "account", required = true) | ||
@JsonDeserialize(using = KeepAsJsonDeserializer.class) | ||
@JsonRawValue | ||
private String account; | ||
|
||
@JsonProperty("account_snapshot") | ||
@JsonDeserialize(using = KeepAsJsonDeserializer.class) | ||
@JsonRawValue | ||
private String accountSnapshot; | ||
|
||
@JsonProperty(value = "account_type", required = true) | ||
private String accountType; | ||
|
||
@JsonProperty(value = "timeline_data", required = true) | ||
@JsonDeserialize(using = KeepAsJsonDeserializer.class) | ||
@JsonRawValue | ||
private String timelineData; | ||
|
||
@JsonProperty("account_number") | ||
private String accountNumber; | ||
|
||
@JsonProperty("account_id") | ||
private Long accountId; | ||
|
||
@JsonProperty(value = "submitted_by", required = true) | ||
private String submittedBy; | ||
} |
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
49 changes: 49 additions & 0 deletions
49
src/main/java/uk/gov/hmcts/opal/dto/DraftAccountSnapshotsDto.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,49 @@ | ||
package uk.gov.hmcts.opal.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.OffsetDateTime; | ||
import java.util.List; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class DraftAccountSnapshotsDto implements ToJsonString { | ||
|
||
@JsonProperty("AccountSnapshot") | ||
private List<Snapshot> accountSnapshot; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public static class Snapshot implements ToJsonString { | ||
@JsonProperty("DefendantName") | ||
private String defendantName; | ||
|
||
@JsonProperty("DateOfBirth") | ||
private String dateOfBirth; | ||
|
||
@JsonProperty("CreatedDate") | ||
private OffsetDateTime createdDate; | ||
|
||
@JsonProperty("AccountType") | ||
private String accountType; | ||
|
||
@JsonProperty("SubmittedBy") | ||
private String submittedBy; | ||
|
||
@JsonProperty("ApprovedDate") | ||
private OffsetDateTime approvedDate; | ||
|
||
@JsonProperty("BusinessUnitName") | ||
private String businessUnitName; | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package uk.gov.hmcts.opal.entity; | ||
|
||
public enum DraftAccountStatus { | ||
SUBMITTED("Submitted"); | ||
|
||
private final String label; | ||
|
||
DraftAccountStatus(String label) { | ||
this.label = label; | ||
} | ||
|
||
public String getLabel() { | ||
return label; | ||
} | ||
} |
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.