Skip to content

Commit

Permalink
feat(be:FSADT1-1277): Part #1
Browse files Browse the repository at this point in the history
  • Loading branch information
mamartinezmejia committed Apr 5, 2024
1 parent af049dc commit 5621c70
Show file tree
Hide file tree
Showing 36 changed files with 381 additions and 154 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package ca.bc.gov.app.converters;

import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.convert.converter.Converter;
import org.springframework.security.core.GrantedAuthority;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.data.relational.core.mapping.Column;
import jakarta.validation.constraints.NotNull;

@SuperBuilder
@Data
Expand All @@ -17,8 +18,10 @@ public abstract class BaseEntity {
protected LocalDateTime updatedAt;

@Column("create_user")
@NotNull
protected String createdBy;

@Column("update_user")
protected String updatedBy;

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;


@Table(name = "client_type_code", schema = ApplicationConstant.POSTGRES_ATTRIBUTE_SCHEMA)
@Data
@EqualsAndHashCode(callSuper = true)
Expand All @@ -27,11 +26,13 @@ public class ClientTypeCodeEntity extends ExpirableBaseEntity {

@Id
@Column("client_type_code")
@NotNull
@Size(min = 1, max = 5)
private String code;

public ClientTypeCodeEntity(
@NotNull @Size(min = 1, max = 4) String code,
@NotNull String description) {
String code,
String description) {
this.code = code;
this.description = description;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,32 @@

import ca.bc.gov.app.ApplicationConstant;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.With;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

@Table(name = "contact_type_code", schema = ApplicationConstant.POSTGRES_ATTRIBUTE_SCHEMA)
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@With
public class ContactTypeCodeEntity {
public class ContactTypeCodeEntity extends ExpirableBaseEntity {

@Id
@Column("contact_type_code")
private String contactTypeCode;

@NotNull
@Column("description")
private String description;

@NotNull
@Column("effective_date")
private LocalDate effectiveAt;

@NotNull
@Column("expiry_date")
private LocalDate expiredAt;

@Column("create_timestamp")
private LocalDateTime createdAt;

@Column("update_timestamp")
private LocalDateTime updatedAt;

@Column("create_user")
private String createdBy;
@Size(min = 1, max = 2)
private String contactTypeCode;

@Column("update_user")
private String updatedBy;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@AllArgsConstructor
@With
public class CountryCodeEntity extends ExpirableBaseEntity {

@Id
@Column("country_code")
@NotNull
Expand All @@ -35,7 +36,7 @@ public class CountryCodeEntity extends ExpirableBaseEntity {

public CountryCodeEntity(
@NotNull @Size(min = 2, max = 2) String countryCode,
@NotNull String description) {
String description) {
this.countryCode = countryCode;
this.description = description;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class DistrictCodeEntity extends ExpirableBaseEntity {

@Column("email_address")
@NotNull
@Size(min = 5, max = 100)
private String emailAddress;

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import ca.bc.gov.app.ApplicationConstant;
import io.r2dbc.postgresql.codec.Json;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.Map;
import lombok.AllArgsConstructor;
Expand All @@ -27,27 +29,36 @@ public class EmailLogEntity {
private Integer emailLogId;

@Column("email_id")
@Size(min = 1, max = 40)
private String emailId;

@Column("email_sent_ind")
@Size(min = 1, max = 1)
private String emailSentInd;

@Column("exception_message")
private String exceptionMessage;

@Column("template_name")
@NotNull
@Size(min = 3, max = 40)
private String templateName;

@Column("email_address")
@NotNull
@Size(min = 5, max = 100)
private String emailAddress;

@Column("email_subject")
@NotNull
@Size(min = 5, max = 100)
private String emailSubject;

@Column("email_variables")
private Json emailVariables;

@Column("create_timestamp")
@NotNull
private LocalDateTime createDate;

@Column("update_timestamp")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ca.bc.gov.app.entity.client;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
Expand All @@ -18,7 +19,9 @@
@NoArgsConstructor
@AllArgsConstructor
public abstract class ExpirableBaseEntity extends BaseEntity {

@NotNull
@Size(min = 5, max = 100)
protected String description;

@Column("create_timestamp")
Expand All @@ -31,4 +34,5 @@ public abstract class ExpirableBaseEntity extends BaseEntity {
@NotNull
@Column("expiry_date")
protected LocalDate expiredAt;

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package ca.bc.gov.app.entity.client;

import ca.bc.gov.app.ApplicationConstant;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -17,28 +19,40 @@
@AllArgsConstructor
@With
public class SubmissionContactEntity {

@Id
@Column("submission_contact_id")
private Integer submissionContactId;

@Column("submission_id")
@NotNull
private Integer submissionId;

@Column("contact_type_code")
@NotNull
@Size(min = 1, max = 2)
private String contactTypeCode;

@Column("first_name")
@Size(min = 1, max = 100)
private String firstName;

@Column("last_name")
@Size(min = 1, max = 100)
private String lastName;

@Column("business_phone_number")
@NotNull
@Size(min = 5, max = 20)
private String businessPhoneNumber;

@Column("email_address")
@NotNull
@Size(min = 5, max = 100)
private String emailAddress;

@Column("idp_user_id")
@Size(min = 5, max = 50)
private String userId;

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package ca.bc.gov.app.entity.client;

import ca.bc.gov.app.ApplicationConstant;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.time.LocalDate;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.With;
import java.time.LocalDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;
Expand All @@ -24,27 +26,40 @@ public class SubmissionDetailEntity {
private Integer submissionDetailId;

@Column("submission_id")
@NotNull
private Integer submissionId;

@Column("client_number")
@Size(min = 1, max = 8)
private String clientNumber;

@Column("incorporation_number")
@Size(min = 1, max = 50)
private String registrationNumber;

@Column("organization_name")
@Size(min = 3, max = 100)
private String organizationName;

@Column("business_type_code")
@NotNull
@Size(min = 1, max = 1)
private String businessTypeCode;

@Column("client_type_code")
@NotNull
@Size(min = 1, max = 1)
private String clientTypeCode;

@Column("good_standing_ind")
@Size(min = 1, max = 1)
private String goodStandingInd;

@Column("birthdate")
private LocalDate birthdate;

@Column("district_code")
@Size(min = 2, max = 5)
private String districtCode;

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import ca.bc.gov.app.ApplicationConstant;
import ca.bc.gov.app.models.client.SubmissionStatusEnum;
import ca.bc.gov.app.models.client.SubmissionTypeCodeEnum;
import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Data;
Expand All @@ -24,16 +25,20 @@
@AllArgsConstructor
@With
public class SubmissionEntity extends BaseEntity {

@Id
@Column("submission_id")
private Integer submissionId;

@Column("submission_status_code")
@Size(min = 1, max = 5)
private SubmissionStatusEnum submissionStatus;

@Column("submission_type_code")
@Size(min = 3, max = 5)
private SubmissionTypeCodeEnum submissionType;

@Column("submission_date")
private LocalDateTime submissionDate;

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ca.bc.gov.app.entity.client;

import ca.bc.gov.app.ApplicationConstant;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -18,8 +19,11 @@
public class SubmissionLocationContactEntity {

@Column("submission_contact_id")
@NotNull
private Integer submissionContactId;

@Column("submission_location_id")
@NotNull
private Integer submissionLocationId;

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import lombok.With;
import org.springframework.data.relational.core.mapping.Column;


@Data
@Builder
@NoArgsConstructor
Expand All @@ -20,4 +19,5 @@ public class SubmissionLocationContactIdEntity {

@Column("submission_location_id")
private Integer submissionLocationId;

}
Loading

0 comments on commit 5621c70

Please sign in to comment.