descMap = new HashMap<>();
+ descMap.put("registrationNumber", StringUtils.defaultString(registrationNumber));
+ descMap.put("name", StringUtils.defaultString(businessName));
+ descMap.put("businessType", StringUtils.defaultString(businessType));
+ descMap.put("clientType", StringUtils.defaultString(clientType));
+ descMap.put("goodStanding", StringUtils.defaultString(goodStandingInd));
+ descMap.put("legalType", StringUtils.defaultString(legalType));
+ descMap.put("birthdate", Optional.ofNullable(birthdate).orElse(LocalDate.of(1975, 1, 31)));
+ descMap.put("district", StringUtils.defaultString(district));
+ descMap.put("workSafeBcNumber", StringUtils.defaultString(workSafeBcNumber));
+ descMap.put("doingBusinessAs", StringUtils.defaultString(doingBusinessAs));
+ descMap.put("clientAcronym", StringUtils.defaultString(clientAcronym));
+ descMap.put("firstName", StringUtils.defaultString(firstName));
+ descMap.put("middleName", StringUtils.defaultString(middleName));
+ descMap.put("lastName", StringUtils.defaultString(lastName));
+ descMap.put("notes", StringUtils.defaultString(notes));
+ descMap.put("identificationType", StringUtils.defaultString(idType()));
+ descMap.put("clientIdentification", StringUtils.defaultString(clientIdentification));
+ descMap.put("identificationCountry", StringUtils.defaultString(identificationCountry));
+ descMap.put("identificationProvince", StringUtils.defaultString(identificationProvince));
+ return descMap;
+ }
+
+ /**
+ * This method is used to determine the identification type of the client.
+ *
+ *
+ * It first checks if both the identificationType and clientIdentification fields are not blank.
+ * If they are not, it then checks if the identificationType is either CDDL or USDL and if the
+ * identificationProvince is not blank. If these conditions are met, it returns the
+ * identificationProvince concatenated with "DL". If these conditions are not met, it simply
+ * returns the identificationType.
+ *
+ * If either the identificationType or clientIdentification fields are blank, it returns null.
+ *
+ * @return The identification type of the client, or null if the necessary fields are blank.
+ */
+ public String idType() {
+
+ if (identificationType == null || StringUtils.isBlank(identificationType.value())
+ || IdentificationTypeEnum.fromValue(identificationType.value()) == null) {
+ return null;
+ }
+
+ if ((IdentificationTypeEnum.CDDL.equals(
+ IdentificationTypeEnum.fromValue(identificationType.value()))
+ || IdentificationTypeEnum.USDL.equals(
+ IdentificationTypeEnum.fromValue(identificationType.value()))) && StringUtils.isNotBlank(
+ identificationProvince)) {
+ return identificationProvince + "DL";
+ }
+ return identificationType.value();
+ }
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientContactDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientContactDto.java
new file mode 100644
index 0000000..e93b818
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/ClientContactDto.java
@@ -0,0 +1,64 @@
+package ca.bc.gov.app.dto.client;
+
+import java.util.List;
+import java.util.Map;
+import lombok.With;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * The type Client contact dto.
+ *
+ * @param contactType the contact type
+ * @param firstName the first name
+ * @param lastName the last name
+ * @param phoneNumber the phone number
+ * @param email the email
+ * @param index zero-based index of the contact
+ * @param locationNames name of locations associated to this contact
+ */
+@With
+public record ClientContactDto(
+ ClientValueTextDto contactType,
+ String firstName,
+ String lastName,
+ String phoneNumber,
+ String secondaryPhoneNumber,
+ String faxNumber,
+ String email,
+ int index,
+ List locationNames
+) {
+
+ public Map description() {
+ final String indexFormatted = String.format("contact.[%d]", index);
+
+ return
+ Map.of(indexFormatted,
+ Map.of(
+ "firstName", StringUtils.defaultString(firstName),
+ "lastName", StringUtils.defaultString(lastName),
+ "name", String.join(" ", firstName, lastName),
+ "phone", StringUtils.defaultString(phoneNumber),
+ "secondaryPhoneNumber", StringUtils.defaultString(secondaryPhoneNumber),
+ "faxNumber", StringUtils.defaultString(faxNumber),
+ "email", StringUtils.defaultString(email)
+ )
+ );
+ }
+
+ public ClientContactDto withIndexed(int index) {
+ if (this.index() == index) {
+ return this;
+ }
+ return this.withIndex(index);
+ }
+
+ public boolean isValid() {
+ return !StringUtils.isAnyBlank(
+ firstName,
+ lastName,
+ phoneNumber,
+ email
+ );
+ }
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientListDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientListDto.java
new file mode 100644
index 0000000..d633432
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/ClientListDto.java
@@ -0,0 +1,10 @@
+package ca.bc.gov.app.dto.client;
+
+public record ClientListDto(
+ String clientNumber,
+ String clientAcronym,
+ String clientFullName,
+ String clientType,
+ String city,
+ String clientStatus) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientListSubmissionDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientListSubmissionDto.java
new file mode 100644
index 0000000..f12c09f
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/ClientListSubmissionDto.java
@@ -0,0 +1,14 @@
+package ca.bc.gov.app.dto.client;
+
+public record ClientListSubmissionDto(
+ long id,
+ String requestType,
+ String name,
+ String clientType,
+ String district,
+ String submittedAt,
+ String user,
+ String status,
+ Long count
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientLocationDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientLocationDto.java
new file mode 100644
index 0000000..eafcf6a
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/ClientLocationDto.java
@@ -0,0 +1,34 @@
+package ca.bc.gov.app.dto.client;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import lombok.With;
+
+@With
+public record ClientLocationDto(
+ List addresses,
+
+ List contacts
+) {
+
+ public Map description() {
+ return
+ Stream.concat(
+ contacts
+ .stream()
+ .map(ClientContactDto::description),
+ addresses
+ .stream()
+ .map(ClientAddressDto::description)
+ )
+ .flatMap(map -> map.entrySet().stream())
+ .collect(Collectors.toMap(
+ Map.Entry::getKey,
+ Map.Entry::getValue,
+ (v1, v2) -> v2
+ )
+ );
+ }
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientLookUpDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientLookUpDto.java
new file mode 100644
index 0000000..27814b5
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/ClientLookUpDto.java
@@ -0,0 +1,14 @@
+package ca.bc.gov.app.dto.client;
+
+import lombok.With;
+
+
+@With
+public record ClientLookUpDto(
+ String code,
+ String name,
+ String status,
+ String legalType
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientStatusCodeEnum.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientStatusCodeEnum.java
deleted file mode 100644
index 27c15a3..0000000
--- a/core/src/main/java/ca/bc/gov/app/dto/client/ClientStatusCodeEnum.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package ca.bc.gov.app.dto.client;
-
-import lombok.Getter;
-
-@Getter
-public enum ClientStatusCodeEnum {
- ACT("Active"),
- DAC("Deactivated"),
- DEC("Deceased"),
- REC("Receivership"),
- SPN("Suspended");
-
- private final String description;
-
- ClientStatusCodeEnum(String description) {
- this.description = description;
- }
-}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientSubmissionDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientSubmissionDto.java
new file mode 100644
index 0000000..6876e1f
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/ClientSubmissionDto.java
@@ -0,0 +1,23 @@
+package ca.bc.gov.app.dto.client;
+
+import java.util.Map;
+import lombok.With;
+
+@With
+public record ClientSubmissionDto(
+ ClientBusinessInformationDto businessInformation,
+ ClientLocationDto location,
+ String userId) {
+ /**
+ * Returns a map containing the description of the client's business information.
+ *
+ * @return a map with keys representing the description fields and corresponding values
+ */
+ public Map description(String userName) {
+ Map descriptions = location.description();
+ descriptions.put("business", businessInformation.description());
+ descriptions.put("userName", userName);
+ return descriptions;
+ }
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientTypeCodeEnum.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientTypeCodeEnum.java
deleted file mode 100644
index ee51f41..0000000
--- a/core/src/main/java/ca/bc/gov/app/dto/client/ClientTypeCodeEnum.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package ca.bc.gov.app.dto.client;
-
-import lombok.Getter;
-
-@Getter
-public enum ClientTypeCodeEnum {
- A("Association"),
- B("First Nation Band"),
- C("Corporation"),
- F("Ministry of Forests and Range"),
- G("Government"),
- I("Individual"),
- L("Limited Partnership"),
- P("General Partnership"),
- R("First Nation Group"),
- S("Society"),
- T("First Nation Tribal Council"),
- U("Unregistered Company");
-
- private final String description;
-
- ClientTypeCodeEnum(String description) {
- this.description = description;
- }
-}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientTypeEnum.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientTypeEnum.java
new file mode 100644
index 0000000..b439625
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/ClientTypeEnum.java
@@ -0,0 +1,44 @@
+package ca.bc.gov.app.dto.client;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Defines the types of clients using an enumeration.
+ *
+ * This enumeration represents different types of clients identified by single or multiple
+ * characters (e.g., C, S, A, I, P, L, RSP, USP). It includes a static block to initialize a map for
+ * reverse lookup, allowing retrieval of enum instances by their name.
+ *
+ */
+public enum ClientTypeEnum {
+ // Enum constants representing client types
+ C, S, A, I, P, L, RSP, USP, B, G, F, U;
+
+ // A map for reverse lookup of enum constants by their name
+ private static final Map CONSTANTS = new HashMap<>();
+
+ static {
+ // Populates the CONSTANTS map with enum names and their corresponding enum instances
+ for (ClientTypeEnum c : values()) {
+ CONSTANTS.put(c.name(), c);
+ }
+ }
+
+ /**
+ * Retrieves the enum instance corresponding to the given string value.
+ *
+ * This method allows for reverse lookup of enum instances by their name, facilitating the
+ * conversion from strings to enum instances.
+ *
+ *
+ * @param value The string representation of the enum constant to be retrieved.
+ * @return The {@link ClientTypeEnum} instance corresponding to the given string value, or null if
+ * no matching instance is found.
+ */
+ @JsonCreator
+ public static ClientTypeEnum fromValue(String value) {
+ return CONSTANTS.get(value);
+ }
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ClientValueTextDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/ClientValueTextDto.java
new file mode 100644
index 0000000..90f0303
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/ClientValueTextDto.java
@@ -0,0 +1,13 @@
+package ca.bc.gov.app.dto.client;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public record ClientValueTextDto(
+
+ String value,
+
+ String text
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/CodeNameDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/CodeNameDto.java
new file mode 100644
index 0000000..ee8d1b1
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/CodeNameDto.java
@@ -0,0 +1,16 @@
+package ca.bc.gov.app.dto.client;
+
+/**
+ * The {@code CodeNameDto} class represents a simple data transfer object (DTO) that encapsulates a
+ * name and code for a specific object. It is used to transfer this information between different
+ * parts of an application. This class is annotated with Swagger annotations for generating API
+ * documentation. It provides a description and example JSON representation for the object it
+ * represents.
+ */
+public record CodeNameDto(
+ String code,
+
+ String name
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/DistrictDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/DistrictDto.java
new file mode 100644
index 0000000..b2b9209
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/DistrictDto.java
@@ -0,0 +1,9 @@
+package ca.bc.gov.app.dto.client;
+
+public record DistrictDto(
+ String code,
+ String description,
+ String emails
+) {
+
+}
\ No newline at end of file
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/EmailLogDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/EmailLogDto.java
new file mode 100644
index 0000000..d4aa9f4
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/EmailLogDto.java
@@ -0,0 +1,15 @@
+package ca.bc.gov.app.dto.client;
+
+import java.util.Map;
+
+public record EmailLogDto(
+ Integer emailLogId,
+ String templateName,
+ String emailAddress,
+ String subject,
+ String emailSentInd,
+ String emailId,
+ String exceptionMessage,
+ Map variables
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/EmailRequestDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/EmailRequestDto.java
new file mode 100644
index 0000000..81d7771
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/EmailRequestDto.java
@@ -0,0 +1,29 @@
+package ca.bc.gov.app.dto.client;
+
+import java.util.Map;
+
+/**
+ * Represents a request object for sending emails via CHES (Common Hosted Email Service). This data
+ * transfer object (DTO) encapsulates the necessary information to send an email.
+ *
+ * @param registrationNumber The registration number associated with the client.
+ * @param name The name of the client or recipient of the email.
+ * @param userId The unique identifier of the user initiating the email.
+ * @param userName The name of the user initiating the email (not to be confused with the client's
+ * name or username).
+ * @param email The email address to which the email will be sent.
+ * @param templateName The name of the email template to be used for formatting the email content.
+ * @param subject The subject of the email.
+ * @param variables A map of variables to be used in the email template, allowing dynamic content.
+ */
+public record EmailRequestDto(
+ String registrationNumber,
+ String name,
+ String userId,
+ String userName,
+ String email,
+ String templateName,
+ String subject,
+ Map variables
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/IdentificationTypeDto.java b/core/src/main/java/ca/bc/gov/app/dto/client/IdentificationTypeDto.java
new file mode 100644
index 0000000..c08108b
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/IdentificationTypeDto.java
@@ -0,0 +1,9 @@
+package ca.bc.gov.app.dto.client;
+
+public record IdentificationTypeDto(
+ String code,
+ String name,
+ String countryCode
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/IdentificationTypeEnum.java b/core/src/main/java/ca/bc/gov/app/dto/client/IdentificationTypeEnum.java
new file mode 100644
index 0000000..ed3203f
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/IdentificationTypeEnum.java
@@ -0,0 +1,52 @@
+package ca.bc.gov.app.dto.client;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.util.Map;
+
+/**
+ * Enumeration representing different types of identification used by clients.
+ *
+ * This enum defines various types of identification documents, such as birth certificates (BRTH),
+ * Canadian driver's licenses (CDDL), passports (PASS), citizenship documents (CITZ), First Nations
+ * ID (FNID), US driver's licenses (USDL), and other forms of identification (OTHR). It includes a
+ * static block to initialize a map for reverse lookup, allowing retrieval of enum instances by
+ * their name.
+ *
+ */
+public enum IdentificationTypeEnum {
+ // Enum constants representing identification types
+ BRTH, // Birth Certificate
+ CDDL, // Canadian Driver's License
+ PASS, // Passport
+ CITZ, // Citizenship Document
+ FNID, // First Nations ID
+ USDL, // US Driver's License
+ OTHR; // Other forms of identification
+
+ // A map for reverse lookup of enum constants by their name
+ private static final Map CONSTANTS = new java.util.HashMap<>();
+
+ static {
+ // Populates the CONSTANTS map with enum names and their corresponding enum instances
+ for (IdentificationTypeEnum c : values()) {
+ CONSTANTS.put(c.name(), c);
+ }
+ }
+
+ /**
+ * Retrieves the enum instance corresponding to the given string value.
+ *
+ * This method allows for reverse lookup of enum instances by their name, facilitating the
+ * conversion from strings to enum instances. It supports dynamic retrieval of enum instances in
+ * scenarios where the enum type is determined at runtime.
+ *
+ *
+ * @param value The string representation of the enum constant to be retrieved.
+ * @return The {@link IdentificationTypeEnum} instance corresponding to the given string value, or
+ * null if no matching instance is found.
+ */
+ @JsonCreator
+ public static IdentificationTypeEnum fromValue(String value) {
+ return CONSTANTS.get(value);
+ }
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/LegalTypeEnum.java b/core/src/main/java/ca/bc/gov/app/dto/client/LegalTypeEnum.java
new file mode 100644
index 0000000..09c8454
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/LegalTypeEnum.java
@@ -0,0 +1,47 @@
+package ca.bc.gov.app.dto.client;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Enumeration representing different legal entity types.
+ *
+ * This enum defines various legal entity types identified by unique codes (e.g., A, B, BC, C,
+ * etc.). It includes a static block to initialize a map for reverse lookup, allowing retrieval of
+ * enum instances by their name. This feature facilitates the conversion from string values to their
+ * corresponding enum instances, especially useful in parsing data from external sources or user
+ * input.
+ *
+ */
+public enum LegalTypeEnum {
+ // Enum constants representing legal entity types
+ A, B, BC, C, CP, EPR, FOR, LIC, REG, S, XS, XCP, SP, GP, LP, XL, XP, LL;
+
+ // A map for reverse lookup of enum constants by their name
+ private static final Map CONSTANTS = new HashMap<>();
+
+ static {
+ // Populates the CONSTANTS map with enum names and their corresponding enum instances
+ for (LegalTypeEnum c : values()) {
+ CONSTANTS.put(c.name(), c);
+ }
+ }
+
+ /**
+ * Retrieves the enum instance corresponding to the given string value.
+ *
+ * This method allows for reverse lookup of enum instances by their name, facilitating the
+ * conversion from strings to enum instances. It supports dynamic retrieval of enum instances in
+ * scenarios where the enum type is determined at runtime.
+ *
+ *
+ * @param value The string representation of the enum constant to be retrieved.
+ * @return The {@link LegalTypeEnum} instance corresponding to the given string value, or null if
+ * no matching instance is found.
+ */
+ @JsonCreator
+ public static LegalTypeEnum fromValue(String value) {
+ return CONSTANTS.get(value);
+ }
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/MatchResult.java b/core/src/main/java/ca/bc/gov/app/dto/client/MatchResult.java
new file mode 100644
index 0000000..f3dc273
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/MatchResult.java
@@ -0,0 +1,9 @@
+package ca.bc.gov.app.dto.client;
+
+public record MatchResult(
+ String field,
+ String match,
+ boolean fuzzy,
+ boolean partialMatch
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/StepMatchEnum.java b/core/src/main/java/ca/bc/gov/app/dto/client/StepMatchEnum.java
new file mode 100644
index 0000000..f36a7bc
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/StepMatchEnum.java
@@ -0,0 +1,39 @@
+package ca.bc.gov.app.dto.client;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Enumeration representing different steps in the staff submission process.
+ *
+ * This enum defines various steps in the staff submission process, including sub-variations for
+ * step 1 (individual, registered, others, and First Nations). It includes a static block
+ * initializing a map for reverse lookup, allowing retrieval of enum instances by their name.
+ *
+ */
+public enum StepMatchEnum {
+ STEP1INDIVIDUAL, STEP1REGISTERED, STEP1OTHERS, STEP1FIRSTNATION, STEP2, STEP3;
+
+ // A map for reverse lookup of enum constants by their name
+ private static final Map CONSTANTS = new HashMap<>();
+
+ static {
+ // Populates the CONSTANTS map with enum names and their corresponding enum instances
+ for (StepMatchEnum c : values()) {
+ CONSTANTS.put(c.name(), c);
+ }
+ }
+
+ /**
+ * Returns the enum constant of this type with the specified name.
+ *
+ * @param value the name of the enum constant to be returned.
+ * @return the enum constant with the specified name, or null if no constant with the specified
+ * name exists.
+ */
+ @JsonCreator
+ public static StepMatchEnum fromValue(String value) {
+ return CONSTANTS.get(value);
+ }
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/SubmissionStatusEnum.java b/core/src/main/java/ca/bc/gov/app/dto/client/SubmissionStatusEnum.java
index 56cdd62..0bed488 100644
--- a/core/src/main/java/ca/bc/gov/app/dto/client/SubmissionStatusEnum.java
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/SubmissionStatusEnum.java
@@ -7,6 +7,9 @@
import lombok.AllArgsConstructor;
import lombok.Getter;
+/**
+ * Enumeration representing the status of a submission.
+ */
@Getter
@AllArgsConstructor
public enum SubmissionStatusEnum {
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/SubmissionTypeCodeEnum.java b/core/src/main/java/ca/bc/gov/app/dto/client/SubmissionTypeCodeEnum.java
index ab2aafe..923e8f8 100644
--- a/core/src/main/java/ca/bc/gov/app/dto/client/SubmissionTypeCodeEnum.java
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/SubmissionTypeCodeEnum.java
@@ -7,12 +7,24 @@
import lombok.AllArgsConstructor;
import lombok.Getter;
+/**
+ * Enumeration representing different types of submissions.
+ *
+ * This enum defines various types of submissions identified by unique codes (e.g., SPP, RNC, AAC).
+ * It includes a static block to initialize a map for reverse lookup, allowing retrieval of enum
+ * instances by their name. This feature facilitates the conversion from string values to their
+ * corresponding enum instances, especially useful in parsing data from external sources or user
+ * input.
+ *
+ */
@Getter
@AllArgsConstructor
public enum SubmissionTypeCodeEnum {
SPP("Submission pending processing"),
RNC("Review new client"),
- AAC("Auto approved client");
+ AAC("Auto approved client"),
+ RAC("Review approved client"),
+ SSD("Staff submitted data");
private final String description;
private static final Map
diff --git a/core/src/main/java/ca/bc/gov/app/dto/client/ValidationSourceEnum.java b/core/src/main/java/ca/bc/gov/app/dto/client/ValidationSourceEnum.java
new file mode 100644
index 0000000..9232b9e
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/client/ValidationSourceEnum.java
@@ -0,0 +1,42 @@
+package ca.bc.gov.app.dto.client;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Enumeration representing the source of validation.
+ *
+ * This enum defines the sources of validation, such as external (EXTERNAL) and staff (STAFF). It
+ * includes a static block to initialize a map for reverse lookup, allowing retrieval of enum
+ * instances by their name.
+ *
+ */
+public enum ValidationSourceEnum {
+ EXTERNAL, STAFF;
+
+ private static final Map CONSTANTS = new HashMap<>();
+
+ static {
+ for (ValidationSourceEnum c : values()) {
+ CONSTANTS.put(c.name(), c);
+ }
+ }
+
+ /**
+ * Retrieves the enum instance corresponding to the given string value.
+ *
+ * This method allows for reverse lookup of enum instances by their name, facilitating the
+ * conversion from strings to enum instances. It supports dynamic retrieval of enum instances in
+ * scenarios where the enum type is determined at runtime.
+ *
+ *
+ * @param value The string representation of the enum constant to be retrieved.
+ * @return The {@link ValidationSourceEnum} instance corresponding to the given string value, or
+ * null if no matching instance is found.
+ */
+ @JsonCreator
+ public static ValidationSourceEnum fromValue(String value) {
+ return CONSTANTS.get(value);
+ }
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/legacy/AddressSearchDto.java b/core/src/main/java/ca/bc/gov/app/dto/legacy/AddressSearchDto.java
new file mode 100644
index 0000000..cd3271b
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/legacy/AddressSearchDto.java
@@ -0,0 +1,17 @@
+package ca.bc.gov.app.dto.legacy;
+
+import org.apache.commons.lang3.StringUtils;
+
+public record AddressSearchDto(
+ String address,
+ String city,
+ String province,
+ String postalCode,
+ String country
+) {
+
+ public boolean isValid() {
+ return !StringUtils.isAnyBlank(address, city, province, postalCode, country);
+ }
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/legacy/ClientDoingBusinessAsDto.java b/core/src/main/java/ca/bc/gov/app/dto/legacy/ClientDoingBusinessAsDto.java
new file mode 100644
index 0000000..26102c4
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/legacy/ClientDoingBusinessAsDto.java
@@ -0,0 +1,14 @@
+package ca.bc.gov.app.dto.legacy;
+
+import lombok.With;
+
+@With
+public record ClientDoingBusinessAsDto(
+ String clientNumber,
+ String doingBusinessAsName,
+ String createdBy,
+ String updatedBy,
+ Long orgUnit
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/legacy/ClientStatusCodeEnum.java b/core/src/main/java/ca/bc/gov/app/dto/legacy/ClientStatusCodeEnum.java
new file mode 100644
index 0000000..9bba77b
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/legacy/ClientStatusCodeEnum.java
@@ -0,0 +1,57 @@
+package ca.bc.gov.app.dto.legacy;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.HashMap;
+import java.util.Map;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * Enumeration representing different client status codes.
+ *
+ * This enum defines various client status codes identified by unique codes (e.g., ACT, DAC, DEC,
+ * REC, SPN). It includes a static block to initialize a map for reverse lookup, allowing retrieval
+ * of enum instances by their name. This feature facilitates the conversion from string values to
+ * their corresponding enum instances, especially useful in parsing data from external sources or
+ * user input.
+ *
+ */
+@Getter
+@AllArgsConstructor
+public enum ClientStatusCodeEnum {
+ ACT("Active"), DAC("Deactivated"), DEC("Deceased"), REC("Receivership"), SPN("Suspended");
+
+ private final String description;
+ private static final Map CONSTANTS = new HashMap<>();
+
+ static {
+ for (ClientStatusCodeEnum c : values()) {
+ CONSTANTS.put(c.description, c);
+ }
+ }
+
+ /**
+ * Retrieves the enum instance corresponding to the given string value.
+ *
+ * This method allows for reverse lookup of enum instances by their name, facilitating the
+ * conversion from strings to enum instances. It supports dynamic retrieval of enum instances in
+ * scenarios where the enum type is determined at runtime.
+ *
+ *
+ * @param value The string representation of the enum constant to be retrieved.
+ * @return The {@link ClientStatusCodeEnum} instance corresponding to the given string value, or
+ * throws an {@link IllegalArgumentException} if no matching instance is found.
+ */
+ @JsonCreator
+ public static ClientStatusCodeEnum fromValue(String value) {
+ ClientStatusCodeEnum constant = CONSTANTS.get(value);
+ if (constant == null) {
+ throw new IllegalArgumentException(value);
+ } else {
+ return constant;
+ }
+ }
+
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/legacy/ClientTypeCodeEnum.java b/core/src/main/java/ca/bc/gov/app/dto/legacy/ClientTypeCodeEnum.java
new file mode 100644
index 0000000..8dd5259
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/legacy/ClientTypeCodeEnum.java
@@ -0,0 +1,55 @@
+package ca.bc.gov.app.dto.legacy;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.HashMap;
+import java.util.Map;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * Enumeration representing different types of clients.
+ *
+ * This enum defines various types of clients identified by single or multiple characters (e.g., C,
+ * S, A, I, P, L, RSP, USP). It includes a static block to initialize a map for reverse lookup,
+ * allowing retrieval of enum instances by their name.
+ *
+ */
+@Getter
+@AllArgsConstructor
+public enum ClientTypeCodeEnum {
+ A("Association"), B("First Nation Band"), C("Corporation"), F("Ministry of Forests and Range"), G(
+ "Government"), I("Individual"), L("Limited Partnership"), P("General Partnership"), R(
+ "First Nation Group"), S("Society"), T("First Nation Tribal Council"), U(
+ "Unregistered Company");
+
+ private final String description;
+ private static final Map CONSTANTS = new HashMap<>();
+
+ static {
+ for (ClientTypeCodeEnum c : values()) {
+ CONSTANTS.put(c.description, c);
+ }
+ }
+
+ /**
+ * Retrieves the enum instance corresponding to the given string value.
+ *
+ * This method allows for reverse lookup of enum instances by their name, facilitating the
+ * conversion from strings to enum instances. It supports dynamic retrieval of enum instances in
+ * scenarios where the enum type is determined at runtime.
+ *
+ *
+ * @param value The string representation of the enum constant to be retrieved.
+ * @return The {@link ClientTypeCodeEnum} instance corresponding to the given string value, or
+ * throws an {@link IllegalArgumentException} if no matching instance is found.
+ */
+ public static ClientTypeCodeEnum fromValue(String value) {
+ ClientTypeCodeEnum constant = CONSTANTS.get(value);
+ if (constant == null) {
+ throw new IllegalArgumentException(value);
+ } else {
+ return constant;
+ }
+ }
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/legacy/ContactSearchDto.java b/core/src/main/java/ca/bc/gov/app/dto/legacy/ContactSearchDto.java
new file mode 100644
index 0000000..536819d
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/legacy/ContactSearchDto.java
@@ -0,0 +1,19 @@
+package ca.bc.gov.app.dto.legacy;
+
+import org.apache.commons.lang3.StringUtils;
+
+public record ContactSearchDto(
+ String firstName,
+ String middleName,
+ String lastName,
+ String email,
+ String phone,
+ String phone2,
+ String fax
+) {
+
+ public boolean isValid() {
+ return !StringUtils.isAnyBlank(firstName, lastName, email, phone);
+ }
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientContactDto.java b/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientContactDto.java
new file mode 100644
index 0000000..352a4f7
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientContactDto.java
@@ -0,0 +1,20 @@
+package ca.bc.gov.app.dto.legacy;
+
+import lombok.With;
+
+@With
+public record ForestClientContactDto(
+ String clientNumber,
+ String clientLocnCode,
+ String contactCode,
+ String contactName,
+ String businessPhone,
+ String secondaryPhone,
+ String faxNumber,
+ String emailAddress,
+ String createdBy,
+ String updatedBy,
+ Long orgUnit
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientDto.java b/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientDto.java
index 4eca569..96ba2ae 100644
--- a/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientDto.java
+++ b/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientDto.java
@@ -1,131 +1,35 @@
package ca.bc.gov.app.dto.legacy;
-import ca.bc.gov.app.dto.client.ClientStatusCodeEnum;
-import ca.bc.gov.app.dto.client.ClientTypeCodeEnum;
-import io.swagger.v3.oas.annotations.media.Schema;
+import java.time.LocalDate;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import lombok.With;
import org.apache.commons.lang3.StringUtils;
-@Schema(
- description = "Represents a client from the legacy forest database.",
- title = "ForestClient",
- example = """
- {
- "clientNumber": "00000002",
- "clientName": "BAXTER",
- "legalFirstName": "",
- "legalMiddleName": "",
- "clientStatusCode": "ACT",
- "clientTypeCode": "I",
- "clientIdTypeCode": "C",
- "clientIdentification": "00000002",
- "registryCompanyTypeCode": "BC",
- "corpRegnNmbr": "00000002",
- "clientAcronym": "",
- "wcbFirmNumber": "",
- "ocgSupplierNmbr": "",
- "clientComment": ""
- }"""
-)
+@With
public record ForestClientDto(
- @Schema(
- description = "The client number.",
- example = "00000002"
- )
String clientNumber,
- @Schema(description = """
- The client last name if it's an individual or
- the company name if it's a company""",
- example = "BAXTER"
- )
String clientName,
- @Schema(description = """
- The first name of the individual,
- or null if it's a company""",
- example = "JAMES")
String legalFirstName,
- @Schema(description = """
- The middle name of the individual,
- or null if it's a company""",
- example = "Canter")
String legalMiddleName,
- @Schema(description = """
- The status of the client, can be any of the following:
-
- ACT (Active)
- DAC (Deactivated)
- DEC (Deceased)
- REC (Receivership)
- SPN (Suspended)""",
- example = "ACT")
String clientStatusCode,
- @Schema(description = """
- The type of client, can be any of the following:
-
- A (Association)
- B (First Nation Band)
- C (Corporation)
- F (Ministry of Forests and Range)
- G (Government)
- I (Individual)
- L (Limited Partnership)
- P (General Partnership)
- R (First Nation Group)
- S (Society)
- T (First Nation Tribal Council)
- U (Unregistered Company)""",
- example = "I")
String clientTypeCode,
-
- @Schema(description = """
- The type of client, can be any of the following:
-
- A (Association)
- B (First Nation Band)
- C (Corporation)
- F (Ministry of Forests and Range)
- G (Government)
- I (Individual)
- L (Limited Partnership)
- P (General Partnership)
- R (First Nation Group)
- S (Society)
- T (First Nation Tribal Council)
- U (Unregistered Company)""",
- example = "C")
+ LocalDate birthdate,
String clientIdTypeCode,
- @Schema(description = "An ID to identify companies",example = "Wull.")
String clientIdentification,
- @Schema(description = """
- The type of company, such as:
-
- BC (BC Registered Business)
- FM (Sole Proprietorship)""",
- example = "FM")
String registryCompanyTypeCode,
- @Schema(description = "Company registration number",
- example = "00000002")
String corpRegnNmbr,
- @Schema(description = "An acronyms for this client",
- example = "JAMES BAXTER")
- String clientAcronym,
- @Schema(description = "WCB firm number",
- example = "00000002")
+ String clientComment,
+ String createdBy,
+ String updatedBy,
+ Long orgUnit,
+ String acronym,
String wcbFirmNumber,
- @Schema(description = "OCG supplier number",
- example = "00000002")
- String ocgSupplierNmbr,
- @Schema(description = "A comment for this client",
- example = "This is a comment")
- String clientComment
+ String ocgSupplierNmbr
+
) {
- /**
- * Returns the legal name of the client already formatted
- * @return A string with the legal name
- */
public String legalName() {
if (StringUtils.defaultString(clientTypeCode).equalsIgnoreCase("I")) {
return
@@ -140,20 +44,18 @@ public String legalName() {
return StringUtils.defaultString(clientName);
}
- /**
- * Returns a map with the client information
- * @return A map with the client information
- */
- public Map description() {
+ public Map description(String userName) {
return
Map.of(
+ "userName", userName,
"number", clientNumber,
"name", legalName(),
"status", ClientStatusCodeEnum.valueOf(clientStatusCode),
"type", ClientTypeCodeEnum.valueOf(clientTypeCode),
"identifier",
- StringUtils.defaultString(registryCompanyTypeCode) +
- StringUtils.defaultString(corpRegnNmbr)
+ StringUtils.defaultString(registryCompanyTypeCode)
+ + StringUtils.defaultString(corpRegnNmbr)
);
}
+
}
\ No newline at end of file
diff --git a/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientLocationDto.java b/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientLocationDto.java
new file mode 100644
index 0000000..860066f
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/legacy/ForestClientLocationDto.java
@@ -0,0 +1,34 @@
+package ca.bc.gov.app.dto.legacy;
+
+
+import java.time.LocalDate;
+import lombok.With;
+
+@With
+public record ForestClientLocationDto(
+ String clientNumber,
+ String clientLocnCode,
+ String clientLocnName,
+ String addressOne,
+ String addressTwo,
+ String addressThree,
+ String city,
+ String province,
+ String postalCode,
+ String country,
+ String businessPhone,
+ String homePhone,
+ String cellPhone,
+ String faxNumber,
+ String emailAddress,
+ String locnExpiredInd,
+ LocalDate returnedMailDate,
+ String trustLocationInd,
+ String cliLocnComment,
+ String createdBy,
+ String updatedBy,
+ Long updateOrgUnit,
+ Long addOrgUnit
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/legacy/PredictiveSearchResultDto.java b/core/src/main/java/ca/bc/gov/app/dto/legacy/PredictiveSearchResultDto.java
new file mode 100644
index 0000000..f751576
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/legacy/PredictiveSearchResultDto.java
@@ -0,0 +1,34 @@
+package ca.bc.gov.app.dto.legacy;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.commons.lang3.StringUtils;
+
+public record PredictiveSearchResultDto(
+ String clientNumber,
+ String clientAcronym,
+ String clientName,
+ String clientFirstName,
+ String doingBusinessAs,
+ String clientIdentification,
+ String clientMiddleName,
+ String city,
+ String clientType,
+ String clientStatus,
+ long score
+) {
+
+ @JsonProperty("clientFullName")
+ public String clientFullName() {
+ String finalName = Stream.of(this.clientFirstName, this.clientMiddleName, this.clientName)
+ .filter(StringUtils::isNotBlank)
+ .map(String::trim)
+ .collect(Collectors.joining(" "));
+
+ return StringUtils.isNotBlank(this.doingBusinessAs)
+ ? finalName + " (" + this.doingBusinessAs + ")"
+ : finalName;
+ }
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/opendata/Crs.java b/core/src/main/java/ca/bc/gov/app/dto/opendata/Crs.java
new file mode 100644
index 0000000..451ddcb
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/opendata/Crs.java
@@ -0,0 +1,7 @@
+package ca.bc.gov.app.dto.opendata;
+
+public record Crs(
+ String type,
+ CrsProperties properties
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/opendata/CrsProperties.java b/core/src/main/java/ca/bc/gov/app/dto/opendata/CrsProperties.java
new file mode 100644
index 0000000..9e3d260
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/opendata/CrsProperties.java
@@ -0,0 +1,6 @@
+package ca.bc.gov.app.dto.opendata;
+
+public record CrsProperties(
+ String name
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/opendata/Feature.java b/core/src/main/java/ca/bc/gov/app/dto/opendata/Feature.java
new file mode 100644
index 0000000..b501f5d
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/opendata/Feature.java
@@ -0,0 +1,12 @@
+package ca.bc.gov.app.dto.opendata;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public record Feature(
+ String type,
+ String id,
+ Geometry geometry,
+ @JsonProperty("geometry_name") String geometryName,
+ FeatureProperties properties
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/opendata/FeatureProperties.java b/core/src/main/java/ca/bc/gov/app/dto/opendata/FeatureProperties.java
new file mode 100644
index 0000000..ff2a368
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/opendata/FeatureProperties.java
@@ -0,0 +1,68 @@
+package ca.bc.gov.app.dto.opendata;
+
+import ca.bc.gov.app.dto.legacy.ClientTypeCodeEnum;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Objects;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+import org.apache.commons.lang3.StringUtils;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public record FeatureProperties(
+ @JsonProperty("GmlID") String gmlId,
+ @JsonProperty("OBJECTID") int objectId,
+ @JsonProperty("Numéro_de_bande___Band_Number") int bandNumber,
+ @JsonProperty("Numéro_du_conseil_tribal___Tribal_Council_Number") int tribeNumber,
+ @JsonProperty("Nom_de_bande___Band_Name") String bandName,
+ @JsonProperty("Nom_du_conseil_tribal___Tribal_Council_Name") String tribeName,
+ @JsonProperty("COMMUNITY_LOCATION_ID") int communityLocationId,
+ @JsonProperty("FIRST_NATION_BC_NAME") String firstNationBCName,
+ @JsonProperty("FIRST_NATION_FEDERAL_NAME") String firstNationFederalName,
+ @JsonProperty("FIRST_NATION_FEDERAL_ID") int firstNationFederalId,
+ @JsonProperty("URL_TO_BC_WEBSITE") String urlToBCWebsite,
+ @JsonProperty("URL_TO_FEDERAL_WEBSITE") String urlToFederalWebsite,
+ @JsonProperty("URL_TO_FIRST_NATION_WEBSITE") String urlToFirstNationWebsite,
+ @JsonProperty("MEMBER_ORGANIZATION_NAMES") String memberOrganizationNames,
+ @JsonProperty("LANGUAGE_GROUP") String languageGroup,
+ @JsonProperty("BC_REGIONAL_OFFICE") String bcRegionalOffice,
+ @JsonProperty("MAPSHEET_NUMBER") String mapsheetNumber,
+ @JsonProperty("PREFERRED_NAME") String preferredName,
+ @JsonProperty("ALTERNATIVE_NAME_1") String alternativeName1,
+ @JsonProperty("ALTERNATIVE_NAME_2") String alternativeName2,
+ @JsonProperty("ADDRESS_LINE1") String addressLine1,
+ @JsonProperty("ADDRESS_LINE2") String addressLine2,
+ @JsonProperty("OFFICE_CITY") String officeCity,
+ @JsonProperty("OFFICE_PROVINCE") String officeProvince,
+ @JsonProperty("OFFICE_POSTAL_CODE") String officePostalCode,
+ @JsonProperty("LOCATION_DESCRIPTION") String locationDescription,
+ @JsonProperty("SITE_NAME") String siteName,
+ @JsonProperty("SITE_NUMBER") String siteNumber,
+ @JsonProperty("COMMENTS") String comments,
+ @JsonProperty("SE_ANNO_CAD_DATA") Object seAnnoCadData,
+ @JsonProperty("CPC_CODE") String cpcCode
+) {
+
+ public String getNationName() {
+ return Stream
+ .of(firstNationBCName(), bandName(), tribeName())
+ .filter(StringUtils::isNotBlank)
+ .findFirst()
+ .orElse(StringUtils.EMPTY);
+ }
+
+ public int getNationId() {
+ return IntStream
+ .of(firstNationFederalId(), bandNumber(), tribeNumber())
+ .filter(id -> id > 0)
+ .filter(Objects::nonNull)
+ .findFirst()
+ .orElse(0);
+ }
+
+ public ClientTypeCodeEnum getFirstNationType() {
+ return
+ StringUtils.isNotBlank(tribeName()) ? ClientTypeCodeEnum.T : ClientTypeCodeEnum.B;
+ }
+
+}
\ No newline at end of file
diff --git a/core/src/main/java/ca/bc/gov/app/dto/opendata/Geometry.java b/core/src/main/java/ca/bc/gov/app/dto/opendata/Geometry.java
new file mode 100644
index 0000000..7e70272
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/opendata/Geometry.java
@@ -0,0 +1,9 @@
+package ca.bc.gov.app.dto.opendata;
+
+import java.util.List;
+
+public record Geometry(
+ String type,
+ List coordinates
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/opendata/OpenData.java b/core/src/main/java/ca/bc/gov/app/dto/opendata/OpenData.java
new file mode 100644
index 0000000..74ab997
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/opendata/OpenData.java
@@ -0,0 +1,10 @@
+package ca.bc.gov.app.dto.opendata;
+
+import java.util.List;
+
+public record OpenData(
+ String type,
+ Crs crs,
+ List features
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/processor/MessagingWrapper.java b/core/src/main/java/ca/bc/gov/app/dto/processor/MessagingWrapper.java
new file mode 100644
index 0000000..4f2daf0
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/processor/MessagingWrapper.java
@@ -0,0 +1,37 @@
+package ca.bc.gov.app.dto.processor;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+public record MessagingWrapper(
+ T payload,
+ Map parameters
+) {
+
+ public MessagingWrapper(T payload, Map parameters) {
+ this.payload = payload;
+ this.parameters = new HashMap<>(parameters);
+ }
+
+
+ public MessagingWrapper withParameter(String key, Object value) {
+ this.parameters.put(key, value);
+ return this;
+ }
+
+ @SuppressWarnings({"unchecked", "unused"})
+ public P getParameter(String key,Class
clazz) {
+ if (Objects.isNull(this.parameters.get(key)))
+ return null;
+ return (P) this.parameters.get(key);
+ }
+
+ public
P getInfoParameter(String key,Class
clazz) {
+ Map info = getParameter("info",Map.class);
+ if (Objects.isNull(info))
+ return null;
+ return (P) info.get(key);
+ }
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/submissions/MatcherResult.java b/core/src/main/java/ca/bc/gov/app/dto/submissions/MatcherResult.java
new file mode 100644
index 0000000..2123c3b
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/submissions/MatcherResult.java
@@ -0,0 +1,46 @@
+package ca.bc.gov.app.dto.submissions;
+
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * This record represents the result of a matching operation.
+ * It contains the name of the field that was matched and a set of values that were found.
+ */
+public record MatcherResult(
+ String fieldName, // The name of the field that was matched
+ Set values // The set of values that were found
+) {
+
+ /**
+ * This method is used to add a value to the set of values.
+ * It checks if the value is not blank and the set of values is not null before adding the value.
+ *
+ * @param value The value to be added to the set of values.
+ */
+ public void addValue(String value) {
+ if (StringUtils.isNotBlank(value) && this.values != null) {
+ this.values.add(value);
+ }
+ }
+
+ /**
+ * This method is used to get a string representation of the set of values.
+ * It joins the values with a comma.
+ *
+ * @return A string representation of the set of values.
+ */
+ public String value() {
+ return String.join(",", this.values);
+ }
+
+ /**
+ * This method is used to check if there is a match.
+ * It checks if the set of values is not null and not empty.
+ *
+ * @return A boolean indicating if there is a match.
+ */
+ public boolean hasMatch() {
+ return this.values != null && !this.values.isEmpty();
+ }
+}
\ No newline at end of file
diff --git a/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionAddressDto.java b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionAddressDto.java
new file mode 100644
index 0000000..3652827
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionAddressDto.java
@@ -0,0 +1,13 @@
+package ca.bc.gov.app.dto.submissions;
+
+public record SubmissionAddressDto(
+ Integer index,
+ String streetAddress,
+ String country,
+ String province,
+ String city,
+ String postalCode,
+ String name
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionApproveRejectDto.java b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionApproveRejectDto.java
new file mode 100644
index 0000000..1cdd976
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionApproveRejectDto.java
@@ -0,0 +1,11 @@
+package ca.bc.gov.app.dto.submissions;
+
+import java.util.List;
+
+public record SubmissionApproveRejectDto(
+ boolean approved,
+ List reasons,
+ String message
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionBusinessDto.java b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionBusinessDto.java
new file mode 100644
index 0000000..e5192c3
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionBusinessDto.java
@@ -0,0 +1,18 @@
+package ca.bc.gov.app.dto.submissions;
+
+import java.time.LocalDate;
+
+public record SubmissionBusinessDto(
+ String businessType,
+ String registrationNumber,
+ String clientNumber,
+ String organizationName,
+ String clientType,
+ String clientTypeDesc,
+ String goodStandingInd,
+ LocalDate birthdate,
+ String district,
+ String districtDesc
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionContactDto.java b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionContactDto.java
new file mode 100644
index 0000000..39d1e9b
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionContactDto.java
@@ -0,0 +1,16 @@
+package ca.bc.gov.app.dto.submissions;
+
+import java.util.Set;
+
+public record SubmissionContactDto(
+ Integer index,
+ String contactType,
+ String firstName,
+ String lastName,
+ String phoneNumber,
+ String emailAddress,
+ Set locations,
+ String userId
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionDetailsDto.java b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionDetailsDto.java
new file mode 100644
index 0000000..5f91ef6
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionDetailsDto.java
@@ -0,0 +1,25 @@
+package ca.bc.gov.app.dto.submissions;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Map;
+import lombok.With;
+
+@With
+public record SubmissionDetailsDto(
+ Long submissionId,
+ String submissionStatus,
+ String submissionType,
+ LocalDateTime submittedTimestamp,
+ LocalDateTime updateTimestamp,
+ LocalDateTime approvedTimestamp,
+ String updateUser,
+ SubmissionBusinessDto business,
+ List contact,
+ List address,
+ Map matchers,
+ String rejectionReason,
+ String confirmedMatchUserId
+) {
+
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionInformationDto.java b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionInformationDto.java
new file mode 100644
index 0000000..366e2b6
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionInformationDto.java
@@ -0,0 +1,15 @@
+package ca.bc.gov.app.dto.submissions;
+
+import java.time.LocalDate;
+import lombok.With;
+
+@With
+public record SubmissionInformationDto(
+ Integer submissionId,
+ String corporationName,
+ LocalDate dateOfBirth,
+ String registrationNumber,
+ String goodStanding,
+ String clientType
+) {
+}
diff --git a/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionProcessKindEnum.java b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionProcessKindEnum.java
new file mode 100644
index 0000000..b467d78
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/dto/submissions/SubmissionProcessKindEnum.java
@@ -0,0 +1,33 @@
+package ca.bc.gov.app.dto.submissions;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Enum representing the kind of submission process.
+ */
+public enum SubmissionProcessKindEnum {
+ HOT,
+ COLD;
+
+ private static final Map CONSTANTS = new HashMap<>();
+
+ static {
+ for (SubmissionProcessKindEnum c : values()) {
+ CONSTANTS.put(c.name(), c);
+ }
+ }
+
+ /**
+ * Returns the SubmissionProcessKindEnum corresponding to the given value.
+ * If the value is not found, it defaults to COLD.
+ *
+ * @param value the value to look up
+ * @return the corresponding SubmissionProcessKindEnum, or COLD if not found
+ */
+ public static SubmissionProcessKindEnum fromValue(String value) {
+ SubmissionProcessKindEnum constant = CONSTANTS.get(value);
+ return Objects.requireNonNullElse(constant, COLD);
+ }
+}
\ No newline at end of file
diff --git a/core/src/main/java/ca/bc/gov/app/util/LogUtil.java b/core/src/main/java/ca/bc/gov/app/util/LogUtil.java
deleted file mode 100644
index 6f090d7..0000000
--- a/core/src/main/java/ca/bc/gov/app/util/LogUtil.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package ca.bc.gov.app.util;
-
-import java.util.function.Consumer;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.slf4j.Logger;
-import org.slf4j.event.Level;
-
-/**
- * Log Util
- * Utility class for logging.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public class LogUtil {
-
- /**
- * Log Content
- * Log the content of the future at the specified level.
- *
- * @param The type that will be passed through the future.
- * @return the same content of the future
- */
- public static Consumer logContent(Logger logger, Level logLevel) {
- return message -> logger.atLevel(logLevel).log("{}", message);
- }
-}
diff --git a/core/src/main/java/ca/bc/gov/app/util/PkceUtil.java b/core/src/main/java/ca/bc/gov/app/util/PkceUtil.java
new file mode 100644
index 0000000..94a4ef4
--- /dev/null
+++ b/core/src/main/java/ca/bc/gov/app/util/PkceUtil.java
@@ -0,0 +1,43 @@
+package ca.bc.gov.app.util;
+
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.Base64;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
+/**
+ * Utility class for generating PKCE code verifier and code challenge.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public class PkceUtil {
+
+ /**
+ * Generates a random string of 43 characters (256 bits) for use as a code verifier.
+ *
+ * @return a random string of 43 characters (256 bits)
+ */
+ public static String generateCodeVerifier() {
+ SecureRandom random = new SecureRandom();
+ byte[] codeVerifierBytes = new byte[32]; // 256 bits (43 characters after base64 encoding)
+ random.nextBytes(codeVerifierBytes);
+ return Base64.getUrlEncoder().withoutPadding().encodeToString(codeVerifierBytes);
+ }
+
+ /**
+ * Generates a code challenge from the given code verifier.
+ *
+ * @param codeVerifier the code verifier to generate a code challenge from
+ *
+ * @return the code challenge
+ * @throws NoSuchAlgorithmException if the SHA-256 algorithm is not available
+ */
+ public static String generateCodeChallenge(String codeVerifier) throws NoSuchAlgorithmException {
+ MessageDigest digest = MessageDigest.getInstance("SHA-256");
+ byte[] codeChallengeBytes = digest.digest(codeVerifier.getBytes(StandardCharsets.US_ASCII));
+ return Base64.getUrlEncoder().withoutPadding().encodeToString(codeChallengeBytes);
+ }
+
+}
diff --git a/core/src/test/java/ca/bc/gov/app/util/PkceUtilTest.java b/core/src/test/java/ca/bc/gov/app/util/PkceUtilTest.java
new file mode 100644
index 0000000..1e1a057
--- /dev/null
+++ b/core/src/test/java/ca/bc/gov/app/util/PkceUtilTest.java
@@ -0,0 +1,30 @@
+package ca.bc.gov.app.util;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+
+import java.security.NoSuchAlgorithmException;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+@DisplayName("Unit Test | PkceUtil")
+class PkceUtilTest {
+
+ @Test
+ @DisplayName("should generate code verifier")
+ void shouldGenerateCodeVerifier() {
+ assertThat(PkceUtil.generateCodeVerifier())
+ .isNotNull()
+ .isNotEmpty()
+ .hasSize(43);
+ }
+
+ @Test
+ @DisplayName("should generate code challenge")
+ void shouldGenerateCodeChallenge() throws NoSuchAlgorithmException {
+ assertThat(PkceUtil.generateCodeChallenge(PkceUtil.generateCodeVerifier()))
+ .isNotNull()
+ .isNotEmpty()
+ .hasSize(43);
+ }
+
+}
\ No newline at end of file