diff --git a/backend/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionService.java b/backend/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionService.java index 7242ab6975..f272efde26 100644 --- a/backend/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionService.java +++ b/backend/src/main/java/ca/bc/gov/app/service/client/ClientSubmissionService.java @@ -136,8 +136,8 @@ public Mono submit( .submissionStatus(SubmissionStatusEnum.N) .submissionType(SubmissionTypeCodeEnum.SPP) .submissionDate(LocalDateTime.now()) - .createdBy(userName) - .updatedBy(userName) + .createdBy(userId) + .updatedBy(userId) .build() ) //Save submission to begin with diff --git a/backend/src/test/java/ca/bc/gov/app/controller/client/ClientSubmissionControllerIntegrationTest.java b/backend/src/test/java/ca/bc/gov/app/controller/client/ClientSubmissionControllerIntegrationTest.java index ca8227e849..d6e71dbacf 100644 --- a/backend/src/test/java/ca/bc/gov/app/controller/client/ClientSubmissionControllerIntegrationTest.java +++ b/backend/src/test/java/ca/bc/gov/app/controller/client/ClientSubmissionControllerIntegrationTest.java @@ -211,7 +211,7 @@ void shouldListAndSearch( .jsonPath("$.[0].requestType").isEqualTo("Submission pending processing") .jsonPath("$.[0].status").isEqualTo("New") .jsonPath("$.[0].clientType").isEqualTo("General Partnership") - .jsonPath("$.[0].user").isEqualTo("Test User"); + .jsonPath("$.[0].user").isEqualTo("testUserId"); } } @@ -227,7 +227,7 @@ void shouldGetSubmissionDetails() { .expectStatus().isOk() .expectBody() .jsonPath("$.submissionId").isEqualTo(1) - .jsonPath("$.updateUser").isEqualTo("Test User") + .jsonPath("$.updateUser").isEqualTo("testUserId") .jsonPath("$.submissionType").isEqualTo("Submission pending processing"); } diff --git a/frontend/cypress/e2e/FormBCSCPage.cy.ts b/frontend/cypress/e2e/FormBCSCPage.cy.ts new file mode 100644 index 0000000000..b30940fff1 --- /dev/null +++ b/frontend/cypress/e2e/FormBCSCPage.cy.ts @@ -0,0 +1,199 @@ +/* eslint-disable no-undef */ +describe("BCSC Form", () => { + beforeEach(() => { + cy.intercept("http://localhost:8080/api/clients/name/*", { + fixture: "business.json", + }).as("searchCompany"); + + cy.intercept("GET", "/api/clients/XX9016140", { + fixture: "example.json", + }).as("selectCompany"); + + cy.intercept("GET","/api/clients/getCountryByCode/CA",{ + fixture: "countryCodeCA.json", + }).as("getCanadaByCode"); + + cy.intercept("POST", "/api/clients/submissions", { + statusCode: 201, + headers: { + location: "http://localhost:8080/api/clients/submissions/1", + "x-sub-id": "123456" + }, + }).as("submitForm"); + + cy.visit("/"); + cy.wait(500); + + cy.get("#landing-title").should("contain", "Client Management System"); + + cy.get("#landing-subtitle").should( + "contain", + "Create and manage client accounts" + ); + + + cy.login("uattest@gov.bc.ca", "Uat Test", "ca.bc.gov.flnr.fam.dev", + { + address: { + formatted: "{\"street_address\":\"4000 SEYMOUR PLACE\",\"country\":\"CA\",\"locality\":\"VICTORIA\",\"region\":\"BC\",\"postal_code\":\"V8Z 1C8\"}" + }, + given_name: "James", + family_name: "Baxter", + birthdate: "1986-11-12" + } + ); + }); + + it("should submit the form with a phone number", () => { + + cy + .get('#phoneNumberId') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('2503008326'); + + cy + .get('#phoneNumberId') + .blur(); + + cy.get('[data-test="wizard-submit-button"]') + .click(); + + cy.get('.fluid-heading-05').should('contain', 'Application submitted!'); + }); + + it("should add a new contact", () => { + + cy + .get('#phoneNumberId') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('2503008326'); + + cy + .get('.form-steps-section > [kind="tertiary"]') + .should("be.visible") + .click(); + + cy + .get('#role_1') + .should("be.visible") + .shadow() + .find("input") + .click(); + + cy + .get('cds-combo-box-item') + .should("be.visible") + .click(); + + cy + .get('#firstName_1') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('James'); + + cy.get('#lastName_1') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('McCloud'); + + cy.get('#email_1') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('jmccloud@starfox.aa'); + + cy.get('#phoneNumber_1') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('2773008326'); + + cy.get('[data-test="wizard-submit-button"]') + .click(); + + cy.get('.fluid-heading-05').should('contain', 'Application submitted!'); + + }); + + it("should add a new contact, then remove it", () => { + + cy + .get('#phoneNumberId') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('2503008326'); + + cy + .get('.form-steps-section > [kind="tertiary"]') + .should("be.visible") + .click(); + + cy + .get('#role_1') + .should("be.visible") + .shadow() + .find("input") + .click(); + + cy + .get('cds-combo-box-item') + .should("be.visible") + .click(); + + cy + .get('#firstName_1') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('James'); + + cy.get('#lastName_1') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('McCloud'); + + cy.get('#email_1') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('jmccloud@starfox.aa'); + + cy.get('#phoneNumber_1') + .should("be.visible") + .shadow() + .find("input") + .should("have.value", "") + .type('2773008326'); + + cy.get('#deleteContact_1').click(); + + cy.wait(150); + + cy.get('#modal-global > cds-modal-footer > .cds--modal-submit-btn').click(); + + cy.get('[data-test="wizard-submit-button"]') + .click(); + + cy.get('.fluid-heading-05').should('contain', 'Application submitted!'); + }); + + +}); \ No newline at end of file diff --git a/frontend/cypress/fixtures/countryCodeCA.json b/frontend/cypress/fixtures/countryCodeCA.json new file mode 100644 index 0000000000..1dc837b076 --- /dev/null +++ b/frontend/cypress/fixtures/countryCodeCA.json @@ -0,0 +1,4 @@ +{ + "code": "CA", + "name": "Canada" +} \ No newline at end of file diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index 156f791c70..5ff663bd05 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -55,7 +55,11 @@ Cypress.Commands.add('expireLocalStorage', (key: string) => { }) }) -Cypress.Commands.add('login', (email: string, name: string, provider: string) => { +Cypress.Commands.add('login', ( + email: string, + name: string, + provider: string, + extra:any = '{}') => { cy.get('.landing-button').should('be.visible') const jwtBody = { 'custom:idp_display_name': name, @@ -63,9 +67,11 @@ Cypress.Commands.add('login', (email: string, name: string, provider: string) => 'custom:idp_user_id': generateRandomHex(32), email, firstName: 'UAT', - lastName: 'Test' + lastName: 'Test', + ...extra } + const payloadString = btoa(JSON.stringify(jwtBody)) .replace(/\+/g, '-') .replace(/\//g, '_') diff --git a/frontend/cypress/support/cypress.d.ts b/frontend/cypress/support/cypress.d.ts index b61dee23c9..3e7193a162 100644 --- a/frontend/cypress/support/cypress.d.ts +++ b/frontend/cypress/support/cypress.d.ts @@ -1,14 +1,13 @@ declare namespace Cypress { interface Chainable { - login(email: string, name: string): Chainable; - addCookie(name: string, value: string): Chainable; - addToLocalStorage(key: string, value: any): Chainable; - expireLocalStorage(key: string): Chainable; - addToSessionStorage(key: string, value: any): Chainable; - expireSessionStorage(key: string): Chainable; - expireCookie(name: string): Chainable; - login(email: string, name: string, provider: string): Chainable; - logout(): Chainable; - getMany(names: string[]): Chainable; + addCookie(name: string, value: string): Chainable; + addToLocalStorage(key: string, value: any): Chainable; + expireLocalStorage(key: string): Chainable; + addToSessionStorage(key: string, value: any): Chainable; + expireSessionStorage(key: string): Chainable; + expireCookie(name: string): Chainable; + login(email: string, name: string, provider: string, extras: any): Chainable; + logout(): Chainable; + getMany(names: string[]): Chainable; } } diff --git a/frontend/src/pages/FormBCSCPage.vue b/frontend/src/pages/FormBCSCPage.vue index 06fcc2f9bc..74af534b98 100644 --- a/frontend/src/pages/FormBCSCPage.vue +++ b/frontend/src/pages/FormBCSCPage.vue @@ -1,201 +1,3 @@ - + + diff --git a/frontend/stub/__files/response-getCountryByCode-CA.json b/frontend/stub/__files/response-getCountryByCode-CA.json new file mode 100644 index 0000000000..6d47f9f984 --- /dev/null +++ b/frontend/stub/__files/response-getCountryByCode-CA.json @@ -0,0 +1 @@ +{ "code": "CA", "name": "Canada" } diff --git a/frontend/stub/__files/response-getCountryByCode-US.json b/frontend/stub/__files/response-getCountryByCode-US.json new file mode 100644 index 0000000000..2bbc415b62 --- /dev/null +++ b/frontend/stub/__files/response-getCountryByCode-US.json @@ -0,0 +1 @@ +{ "code": "US", "name": "United States of America" } \ No newline at end of file diff --git a/frontend/stub/mappings/backend.json b/frontend/stub/mappings/backend.json index 1561a3048a..b21fe0dce1 100644 --- a/frontend/stub/mappings/backend.json +++ b/frontend/stub/mappings/backend.json @@ -74,6 +74,18 @@ } }, + { + "name":"Get Country by CountryCode", + "request": { + "urlPattern": "/api/clients/getCountryByCode/(.*)", + "method": "GET" + }, + "response": { + "status": 200, + "transformers": ["response-template"], + "bodyFileName": "response-getCountryByCode-{{request.path.[3]}}.json" } + }, + { "name":"Submission Success for XX", "request": { diff --git a/legacy/src/test/resources/db/migration/V2__full_client.sql b/legacy/src/test/resources/db/migration/V2__full_client.sql index ed6499b3e3..a682208034 100644 --- a/legacy/src/test/resources/db/migration/V2__full_client.sql +++ b/legacy/src/test/resources/db/migration/V2__full_client.sql @@ -36,6 +36,10 @@ INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_D INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('OTHR','Other Identification',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('PASS','Canadian Passport',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('UNKN','Unknown',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BCEI','BCeID',TIMESTAMP'2023-11-29 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2023-11-29 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BCSC','BC Services Card',TIMESTAMP'2023-11-29 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2023-11-29 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BCRE','BC Registry',TIMESTAMP'2023-11-29 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2023-11-29 13:00:40.0'); + INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('AF','Obsolete - Amalgamated from',TIMESTAMP'2005-09-05 00:00:00.0',TIMESTAMP'2007-03-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('AT','Obsolete - Amalgamated To',TIMESTAMP'2005-09-05 00:00:00.0',TIMESTAMP'2007-03-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); diff --git a/processor/src/main/java/ca/bc/gov/app/ApplicationConstant.java b/processor/src/main/java/ca/bc/gov/app/ApplicationConstant.java index 179b8f067b..6d0dc3baed 100644 --- a/processor/src/main/java/ca/bc/gov/app/ApplicationConstant.java +++ b/processor/src/main/java/ca/bc/gov/app/ApplicationConstant.java @@ -53,6 +53,7 @@ public final class ApplicationConstant { public static final String SUBMISSION_LEGACY_RSP_CHANNEL = "submissionLegacyRSPChannel"; public static final String SUBMISSION_LEGACY_OTHER_CHANNEL = "submissionLegacyOtherChannel"; public static final String CLIENT_EXISTS = "client-exists"; + public static final String CLIENT_SUBMITTER_NAME = "client-submitter-name"; public static final BcRegistryDocumentRequestBodyDto BUSINESS_SUMMARY_FILING_HISTORY = diff --git a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceService.java b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceService.java index 71998a5190..fc61cbbbb0 100644 --- a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceService.java +++ b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceService.java @@ -166,24 +166,34 @@ public Mono> checkClientData(Message message) { message.getPayload() ) ) - .map(clientNumber -> - MessageBuilder - .withPayload(existingClient.get() ? message.getPayload() : clientNumber) - .copyHeaders(message.getHeaders()) - .setHeader(ApplicationConstant.SUBMISSION_ID, message.getPayload()) - .setHeader(ApplicationConstant.CLIENT_EXISTS, existingClient.get()) - .setHeader(ApplicationConstant.CLIENT_TYPE_CODE, clientTypeCode.get()) - .setHeader(ApplicationConstant.FOREST_CLIENT_NUMBER, clientNumber) - .setReplyChannelName( - existingClient.get() ? ApplicationConstant.SUBMISSION_LEGACY_LOCATION_CHANNEL - : getNextChannel()) - .setHeader("output-channel", - existingClient.get() ? ApplicationConstant.SUBMISSION_LEGACY_LOCATION_CHANNEL - : getNextChannel()) - .setHeader(MessageHeaders.REPLY_CHANNEL, - existingClient.get() ? ApplicationConstant.SUBMISSION_LEGACY_LOCATION_CHANNEL - : getNextChannel()) - .build() + .flatMap(clientNumber -> + + contactRepository + .findFirstBySubmissionId(message.getPayload()) + .map(contact -> + MessageBuilder + .withPayload(existingClient.get() ? message.getPayload() : clientNumber) + .copyHeaders(message.getHeaders()) + .setHeader(ApplicationConstant.SUBMISSION_ID, message.getPayload()) + .setHeader(ApplicationConstant.CLIENT_EXISTS, existingClient.get()) + .setHeader(ApplicationConstant.CLIENT_TYPE_CODE, clientTypeCode.get()) + .setHeader(ApplicationConstant.FOREST_CLIENT_NUMBER, clientNumber) + .setHeader(ApplicationConstant.CLIENT_SUBMITTER_NAME, + contact.getFirstName() + " " + contact.getLastName()) + .setReplyChannelName( + existingClient.get() + ? ApplicationConstant.SUBMISSION_LEGACY_LOCATION_CHANNEL + : getNextChannel()) + .setHeader("output-channel", + existingClient.get() + ? ApplicationConstant.SUBMISSION_LEGACY_LOCATION_CHANNEL + : getNextChannel()) + .setHeader(MessageHeaders.REPLY_CHANNEL, + existingClient.get() + ? ApplicationConstant.SUBMISSION_LEGACY_LOCATION_CHANNEL + : getNextChannel()) + .build() + ) ); } @@ -418,7 +428,7 @@ public Mono> createContact(Message message) { toContact .apply(locationContact.getSubmissionContactId()) .flatMap(forestClientContact -> - getNextContactId() + getNextContactId() .doOnNext(forestClientContact::setClientContactId) .thenReturn(forestClientContact) ) @@ -504,35 +514,35 @@ protected String getUser(Message message, String headerName) { private Mono getNextClientNumber() { return - legacyR2dbcEntityTemplate - .getDatabaseClient() - .sql(""" - UPDATE - max_client_nmbr - SET - client_number = (SELECT LPAD(TO_NUMBER(NVL(max(CLIENT_NUMBER),'0'))+1,8,'0') FROM FOREST_CLIENT)""" - ) - .fetch() - .rowsUpdated() - .then( - legacyR2dbcEntityTemplate - .getDatabaseClient() - .sql("SELECT client_number FROM max_client_nmbr") - .map((row, rowMetadata) -> row.get("client_number", String.class)) - .first() - ); + legacyR2dbcEntityTemplate + .getDatabaseClient() + .sql(""" + UPDATE + max_client_nmbr + SET + client_number = (SELECT LPAD(TO_NUMBER(NVL(max(CLIENT_NUMBER),'0'))+1,8,'0') FROM FOREST_CLIENT)""" + ) + .fetch() + .rowsUpdated() + .then( + legacyR2dbcEntityTemplate + .getDatabaseClient() + .sql("SELECT client_number FROM max_client_nmbr") + .map((row, rowMetadata) -> row.get("client_number", String.class)) + .first() + ); } private Mono getNextDoingBusinessAs() { return - legacyR2dbcEntityTemplate - .getDatabaseClient() - .sql("select THE.client_dba_seq.NEXTVAL from dual") - .fetch() - .first() - .map(row -> row.get("NEXTVAL")) - .map(String::valueOf) - .map(Integer::parseInt); + legacyR2dbcEntityTemplate + .getDatabaseClient() + .sql("select THE.client_dba_seq.NEXTVAL from dual") + .fetch() + .first() + .map(row -> row.get("NEXTVAL")) + .map(String::valueOf) + .map(Integer::parseInt); } private Mono getNextContactId() { @@ -585,7 +595,7 @@ private boolean isRegisteredSoleProprietorship(ForestClientEntity forestClient) StringUtils.equalsIgnoreCase( forestClient .getClientIdTypeCode(), - "OTHR" + "BCRE" ); } diff --git a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyClientPersistenceService.java b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyClientPersistenceService.java index 52fc087e57..6b56aef1a5 100644 --- a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyClientPersistenceService.java +++ b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyClientPersistenceService.java @@ -87,7 +87,8 @@ public Mono> generateForestClient(Message me getUser(message, ApplicationConstant.UPDATED_BY) ) .withClientComment( - "Client details acquired from BC Registry " + + getUser(message, ApplicationConstant.CLIENT_SUBMITTER_NAME) + + " submitted the client details acquired from BC Registry " + submissionDetail.getIncorporationNumber() ) .withClientName(submissionDetail.getOrganizationName().toUpperCase()) diff --git a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyIndividualPersistenceService.java b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyIndividualPersistenceService.java index 0683d2b7cc..61220add32 100644 --- a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyIndividualPersistenceService.java +++ b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyIndividualPersistenceService.java @@ -52,12 +52,13 @@ public LegacyIndividualPersistenceService( /** * This method is responsible for filtering the submission based on the type. + * * @param clientTypeCode - the client type code. * @return - true if the type is I, otherwise false. */ @Override boolean filterByType(String clientTypeCode) { - return StringUtils.equalsIgnoreCase(clientTypeCode,"I"); + return StringUtils.equalsIgnoreCase(clientTypeCode, "I"); } @Override @@ -88,11 +89,22 @@ public Mono> generateForestClient(Message me getUser(message, ApplicationConstant.UPDATED_BY) ) .withBirthdate(detailEntity.getBirthdate()) - .withLegalFirstName(ProcessorUtil.splitName(detailEntity.getOrganizationName())[1].toUpperCase()) - .withClientName(ProcessorUtil.splitName(detailEntity.getOrganizationName())[0].toUpperCase()) - .withClientComment("Individual with data acquired from BC Services Card") + .withLegalFirstName(ProcessorUtil.splitName( + detailEntity.getOrganizationName())[1].toUpperCase()) + .withClientName(ProcessorUtil.splitName( + detailEntity.getOrganizationName())[0].toUpperCase()) + .withClientComment( + getUser(message, ApplicationConstant.CLIENT_SUBMITTER_NAME) + + " submitted the individual with data acquired from BC Services Card" + ) .withClientTypeCode("I") - .withClientNumber(message.getHeaders().get(ApplicationConstant.FOREST_CLIENT_NUMBER, String.class)) + .withClientIdTypeCode("BCSC") + //Assuming that individuals can only be created by BCSC users + .withClientIdentification( + getUser(message, ApplicationConstant.CREATED_BY).replace("bcsc\\", + StringUtils.EMPTY)) + .withClientNumber(message.getHeaders() + .get(ApplicationConstant.FOREST_CLIENT_NUMBER, String.class)) ) .map(forestClient -> MessageBuilder diff --git a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceService.java b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceService.java index 0b31544079..6321fa2386 100644 --- a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceService.java +++ b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceService.java @@ -99,7 +99,9 @@ public Mono> generateForestClient(Message me .withClientIdentification(submissionDetail.getIncorporationNumber()) .withClientComment( String.join(" ", - "Sole proprietorship registered on BC Registry with number", + getUser(message, ApplicationConstant.CLIENT_SUBMITTER_NAME), + "submitted the", + "sole proprietor registered on BC Registry with number", submissionDetail.getIncorporationNumber(), "and company name", submissionDetail.getOrganizationName().toUpperCase() @@ -157,7 +159,7 @@ public Mono> generateForestClient(Message me .withLegalFirstName(contact[0]) .withClientName(contact[1]) .withClientTypeCode("I") - .withClientIdTypeCode("OTHR") + .withClientIdTypeCode("BCRE") .withClientNumber(message.getHeaders() .get(ApplicationConstant.FOREST_CLIENT_NUMBER, String.class)) ) diff --git a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyUnregisteredSPPersistenceService.java b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyUnregisteredSPPersistenceService.java index d599b54c44..9a99b27a97 100644 --- a/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyUnregisteredSPPersistenceService.java +++ b/processor/src/main/java/ca/bc/gov/app/service/legacy/LegacyUnregisteredSPPersistenceService.java @@ -97,7 +97,8 @@ public Mono> generateForestClient(Message me .withClientName(ProcessorUtil.splitName(detail.getOrganizationName())[0].toUpperCase()) .withLegalMiddleName(ProcessorUtil.splitName(detail.getOrganizationName())[2].toUpperCase()) .withClientComment( - "Sole proprietorship with data acquired from BC Business eID") + getUser(message, ApplicationConstant.CLIENT_SUBMITTER_NAME) + + " submitted the sole proprietor with data acquired from Business BCeID") .withClientTypeCode("I") .withClientNumber(message.getHeaders().get(ApplicationConstant.FOREST_CLIENT_NUMBER, String.class)) ) diff --git a/processor/src/test/java/ca/bc/gov/app/service/client/ClientSubmissionAutoProcessingServiceIntegrationTest.java b/processor/src/test/java/ca/bc/gov/app/service/client/ClientSubmissionAutoProcessingServiceIntegrationTest.java index 752db6c6c9..e0c9c26e85 100644 --- a/processor/src/test/java/ca/bc/gov/app/service/client/ClientSubmissionAutoProcessingServiceIntegrationTest.java +++ b/processor/src/test/java/ca/bc/gov/app/service/client/ClientSubmissionAutoProcessingServiceIntegrationTest.java @@ -24,6 +24,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.SpyBean; import org.springframework.integration.support.MessageBuilder; @@ -62,14 +63,14 @@ void shouldApproveSubmission() { .alias("Submission lookup") .atMost(Duration.ofSeconds(2)) .untilAsserted(() -> - verify(submissionRepository, times(1)).findById(eq(1)) + verify(submissionRepository, atLeastOnce()).findById(eq(1)) ); await() .alias("Submission persistence") .atMost(Duration.ofSeconds(5)) .untilAsserted(() -> - verify(submissionRepository, times(1)).save(any(SubmissionEntity.class)) + verify(submissionRepository, atLeastOnce()).save(any(SubmissionEntity.class)) ); } @@ -92,7 +93,7 @@ void shouldCompleteProcessing() { .alias("Submission matches and loads") .atMost(Duration.ofSeconds(5)) .untilAsserted(() -> - verify(submissionMatchDetailRepository, times(1)).findBySubmissionId(eq(2)) + verify(submissionMatchDetailRepository, atLeastOnce()).findBySubmissionId(eq(2)) ); await() diff --git a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceServiceTest.java b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceServiceTest.java index 0c3b5c2701..0df79fda1c 100644 --- a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceServiceTest.java +++ b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyAbstractPersistenceServiceTest.java @@ -387,6 +387,15 @@ void shouldCheckClientData( when(legacyR2dbcEntityTemplate.selectOne(any(), any())) .thenReturn( Mono.just(ForestClientEntity.builder().clientNumber("00000000").build())); + when(contactRepository.findFirstBySubmissionId(any())) + .thenReturn(Mono.just( + SubmissionContactEntity + .builder() + .firstName("Jhon") + .lastName("Snow") + .build() + ) + ); service .checkClientData( @@ -437,6 +446,12 @@ void shouldCheckClientData( .isNotNull() .isInstanceOf(Boolean.class) .isEqualTo(StringUtils.isNotBlank(clientNumber)); + + assertThat(message.getHeaders().get(ApplicationConstant.CLIENT_SUBMITTER_NAME)) + .as("client submitter name") + .isNotNull() + .isInstanceOf(String.class) + .isEqualTo("Jhon Snow"); }) .verifyComplete(); } diff --git a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyClientPersistenceServiceTest.java b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyClientPersistenceServiceTest.java index d5b76d2c0b..2a7c54e4f1 100644 --- a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyClientPersistenceServiceTest.java +++ b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyClientPersistenceServiceTest.java @@ -59,13 +59,13 @@ class LegacyClientPersistenceServiceTest { @ParameterizedTest(name = "type: {0} expected: {1}") @MethodSource("byType") @DisplayName("filter by type") - void shouldFilterByType(String type, boolean expected){ + void shouldFilterByType(String type, boolean expected) { assertEquals(expected, service.filterByType(type)); } @Test @DisplayName("get next channel") - void shouldGetNextChannel(){ + void shouldGetNextChannel() { assertEquals(ApplicationConstant.SUBMISSION_LEGACY_OTHER_CHANNEL, service.getNextChannel()); } @@ -96,6 +96,7 @@ void shouldCreateForestClient() { .setHeader(ApplicationConstant.FOREST_CLIENT_NUMBER, "00000001") .setHeader(ApplicationConstant.CREATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) .setHeader(ApplicationConstant.UPDATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) + .setHeader(ApplicationConstant.CLIENT_SUBMITTER_NAME, "Jhon Snow") .build() ) .as(StepVerifier::create) @@ -111,7 +112,8 @@ void shouldCreateForestClient() { .hasFieldOrPropertyWithValue("registryCompanyTypeCode", "FM") .hasFieldOrPropertyWithValue("corpRegnNmbr", "0159297") .hasFieldOrPropertyWithValue("clientNumber", "00000001") - .hasFieldOrPropertyWithValue("clientComment", "Client details acquired from BC Registry FM0159297"); + .hasFieldOrPropertyWithValue("clientComment", + "Jhon Snow submitted the client details acquired from BC Registry FM0159297"); assertThat(message.getHeaders().get(ApplicationConstant.SUBMISSION_ID)) .isNotNull() @@ -145,7 +147,7 @@ void shouldCreateForestClient() { .verifyComplete(); } - private static Stream byType(){ + private static Stream byType() { return Stream.of( Arguments.of("I", false), Arguments.of("C", true), diff --git a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyIndividualPersistenceServiceTest.java b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyIndividualPersistenceServiceTest.java index 8138d43d25..2625cbbb4f 100644 --- a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyIndividualPersistenceServiceTest.java +++ b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyIndividualPersistenceServiceTest.java @@ -1,14 +1,13 @@ package ca.bc.gov.app.service.legacy; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import ca.bc.gov.app.ApplicationConstant; import ca.bc.gov.app.entity.client.SubmissionDetailEntity; -import ca.bc.gov.app.entity.legacy.ForestClientEntity; import ca.bc.gov.app.repository.client.CountryCodeRepository; import ca.bc.gov.app.repository.client.SubmissionContactRepository; import ca.bc.gov.app.repository.client.SubmissionDetailRepository; @@ -23,7 +22,6 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.springframework.data.r2dbc.core.R2dbcEntityTemplate; -import org.springframework.data.r2dbc.core.ReactiveInsertOperation.ReactiveInsert; import org.springframework.integration.support.MessageBuilder; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -60,22 +58,22 @@ class LegacyIndividualPersistenceServiceTest { @ParameterizedTest(name = "type: {0} expected: {1}") @MethodSource("byType") @DisplayName("filter by type") - void shouldFilterByType(String type, boolean expected){ + void shouldFilterByType(String type, boolean expected) { assertEquals(expected, service.filterByType(type)); } @Test @DisplayName("get next channel") - void shouldGetNextChannel(){ - assertEquals(ApplicationConstant.SUBMISSION_LEGACY_INDIVIDUAL_CHANNEL, service.getNextChannel()); + void shouldGetNextChannel() { + assertEquals(ApplicationConstant.SUBMISSION_LEGACY_INDIVIDUAL_CHANNEL, + service.getNextChannel()); } @Test @DisplayName("create forest client") void shouldCreateForestClient() { - ReactiveInsert reactiveInsert = mock(ReactiveInsert.class); SubmissionDetailEntity entity = SubmissionDetailEntity.builder() .submissionId(2) @@ -97,6 +95,7 @@ void shouldCreateForestClient() { .setHeader(ApplicationConstant.FOREST_CLIENT_NUMBER, "00000001") .setHeader(ApplicationConstant.CREATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) .setHeader(ApplicationConstant.UPDATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) + .setHeader(ApplicationConstant.CLIENT_SUBMITTER_NAME, "Jhon Snow") .build() ) .as(StepVerifier::create) @@ -109,9 +108,13 @@ void shouldCreateForestClient() { .isNotNull() .hasFieldOrPropertyWithValue("clientName", "BAXTER") .hasFieldOrPropertyWithValue("legalFirstName", "JAMES") - .hasFieldOrPropertyWithValue("clientComment", "Individual with data acquired from BC Services Card") + .hasFieldOrPropertyWithValue("clientComment", + "Jhon Snow submitted the individual with data acquired from BC Services Card") .hasFieldOrPropertyWithValue("clientTypeCode", "I") - .hasFieldOrPropertyWithValue("clientNumber", "00000001"); + .hasFieldOrPropertyWithValue("clientNumber", "00000001") + .hasFieldOrPropertyWithValue("clientIdTypeCode", "BCSC") + .hasFieldOrPropertyWithValue("clientIdentification", + ApplicationConstant.PROCESSOR_USER_NAME); assertThat(message.getHeaders().get(ApplicationConstant.SUBMISSION_ID)) .isNotNull() @@ -145,7 +148,7 @@ void shouldCreateForestClient() { .verifyComplete(); } - private static Stream byType(){ + private static Stream byType() { return Stream.of( Arguments.of("I", true), Arguments.of("C", false), diff --git a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceServiceTest.java b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceServiceTest.java index 10960c9898..3e2431396a 100644 --- a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceServiceTest.java +++ b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyRegisteredSPPersistenceServiceTest.java @@ -113,6 +113,7 @@ void shouldCreateForestClient() { .setHeader(ApplicationConstant.FOREST_CLIENT_NUMBER, "00000001") .setHeader(ApplicationConstant.CREATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) .setHeader(ApplicationConstant.UPDATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) + .setHeader(ApplicationConstant.CLIENT_SUBMITTER_NAME, "Jhon Snow") .build() ) .as(StepVerifier::create) @@ -125,13 +126,14 @@ void shouldCreateForestClient() { .isNotNull() .hasFieldOrPropertyWithValue("clientName", "BAXTER") .hasFieldOrPropertyWithValue("legalFirstName", "JAMES") - .hasFieldOrPropertyWithValue("clientIdTypeCode", "OTHR") + .hasFieldOrPropertyWithValue("clientIdTypeCode", "BCRE") .hasFieldOrPropertyWithValue("clientIdentification", "FM00184546") .hasFieldOrPropertyWithValue("registryCompanyTypeCode", "FM") .hasFieldOrPropertyWithValue("corpRegnNmbr", "00184546") .hasFieldOrPropertyWithValue("clientComment", String.join(" ", - "Sole proprietorship registered on BC Registry with number", + "Jhon Snow submitted the", + "sole proprietor registered on BC Registry with number", "FM00184546", "and company name", "BAXTER CORP" @@ -203,6 +205,7 @@ void shouldCreateForestClientWhenNoBcRegData() { .setHeader(ApplicationConstant.FOREST_CLIENT_NUMBER, "00000001") .setHeader(ApplicationConstant.CREATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) .setHeader(ApplicationConstant.UPDATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) + .setHeader(ApplicationConstant.CLIENT_SUBMITTER_NAME, "Jhon Snow") .build() ) .as(StepVerifier::create) @@ -215,13 +218,14 @@ void shouldCreateForestClientWhenNoBcRegData() { .isNotNull() .hasFieldOrPropertyWithValue("clientName", "BAXTER") .hasFieldOrPropertyWithValue("legalFirstName", "JAMES") - .hasFieldOrPropertyWithValue("clientIdTypeCode", "OTHR") + .hasFieldOrPropertyWithValue("clientIdTypeCode", "BCRE") .hasFieldOrPropertyWithValue("clientIdentification", "FM00184546") .hasFieldOrPropertyWithValue("registryCompanyTypeCode", "FM") .hasFieldOrPropertyWithValue("corpRegnNmbr", "00184546") .hasFieldOrPropertyWithValue("clientComment", String.join(" ", - "Sole proprietorship registered on BC Registry with number", + "Jhon Snow submitted the", + "sole proprietor registered on BC Registry with number", "FM00184546", "and company name", "BAXTER CORP" @@ -305,7 +309,7 @@ void shouldCreateClient() { TestConstants .CLIENT_ENTITY .withClientTypeCode("I") - .withClientIdTypeCode("OTHR") + .withClientIdTypeCode("BCRE") )); when(legacyR2dbcEntityTemplate.getDatabaseClient()) .thenReturn(dbCLient); @@ -321,7 +325,7 @@ void shouldCreateClient() { TestConstants .CLIENT_ENTITY .withClientTypeCode("I") - .withClientIdTypeCode("OTHR") + .withClientIdTypeCode("BCRE") ) .setHeader(ApplicationConstant.SUBMISSION_ID, 2) .setHeader(ApplicationConstant.CREATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) @@ -329,6 +333,7 @@ void shouldCreateClient() { .setHeader(ApplicationConstant.CLIENT_TYPE_CODE, "RSP") .setHeader(ApplicationConstant.FOREST_CLIENT_NUMBER, "00000000") .setHeader(ApplicationConstant.FOREST_CLIENT_NAME, "CHAMPAGNE SUPERNOVA") + .setHeader(ApplicationConstant.CLIENT_SUBMITTER_NAME, "Jhon Snow") .build() ) .as(StepVerifier::create) diff --git a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyUnregisteredSPPersistenceServiceTest.java b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyUnregisteredSPPersistenceServiceTest.java index 1af3e9f554..20a78ce64b 100644 --- a/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyUnregisteredSPPersistenceServiceTest.java +++ b/processor/src/test/java/ca/bc/gov/app/service/legacy/LegacyUnregisteredSPPersistenceServiceTest.java @@ -1,7 +1,7 @@ package ca.bc.gov.app.service.legacy; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -59,13 +59,13 @@ class LegacyUnregisteredSPPersistenceServiceTest { @ParameterizedTest(name = "type: {0} expected: {1}") @MethodSource("byType") @DisplayName("filter by type") - void shouldFilterByType(String type, boolean expected){ + void shouldFilterByType(String type, boolean expected) { assertEquals(expected, service.filterByType(type)); } @Test @DisplayName("get next channel") - void shouldGetNextChannel(){ + void shouldGetNextChannel() { assertEquals(ApplicationConstant.SUBMISSION_LEGACY_USP_CHANNEL, service.getNextChannel()); } @@ -93,6 +93,7 @@ void shouldCreateForestClient() { .setHeader(ApplicationConstant.FOREST_CLIENT_NUMBER, "00000001") .setHeader(ApplicationConstant.CREATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) .setHeader(ApplicationConstant.UPDATED_BY, ApplicationConstant.PROCESSOR_USER_NAME) + .setHeader(ApplicationConstant.CLIENT_SUBMITTER_NAME, "Jhon Snow") .build() ) .as(StepVerifier::create) @@ -106,7 +107,8 @@ void shouldCreateForestClient() { .hasFieldOrPropertyWithValue("clientName", "BAXTER") .hasFieldOrPropertyWithValue("legalFirstName", "JAMES") .hasFieldOrPropertyWithValue("legalMiddleName", StringUtils.EMPTY) - .hasFieldOrPropertyWithValue("clientComment","Sole proprietorship with data acquired from BC Business eID") + .hasFieldOrPropertyWithValue("clientComment", + "Jhon Snow submitted the sole proprietor with data acquired from Business BCeID") .hasFieldOrPropertyWithValue("clientTypeCode", "I") .hasFieldOrPropertyWithValue("clientNumber", "00000001"); @@ -142,7 +144,7 @@ void shouldCreateForestClient() { .verifyComplete(); } - private static Stream byType(){ + private static Stream byType() { return Stream.of( Arguments.of("I", false), Arguments.of("C", false), diff --git a/processor/src/test/resources/db/migration/V1__init.sql b/processor/src/test/resources/db/migration/V1__init.sql new file mode 100644 index 0000000000..fd178d4c7a --- /dev/null +++ b/processor/src/test/resources/db/migration/V1__init.sql @@ -0,0 +1,1083 @@ +CREATE TABLE THE.CLIENT_TYPE_CODE ( + CLIENT_TYPE_CODE VARCHAR2(1) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CTCD_PK PRIMARY KEY (CLIENT_TYPE_CODE), + CONSTRAINT SYS_C0012021 CHECK ("CLIENT_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0012022 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0012023 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012024 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012025 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.RESTORED_BLOB_STORAGE ( + BSTO_SEQ_NBR NUMBER(15,0) NOT NULL, + BSTO_TABLE_NAME VARCHAR2(30) NOT NULL, + BSTO_TABLE_PRIMARY_KEY VARCHAR2(1000) NOT NULL, + BSTO_FILE_NAME VARCHAR2(60) NULL, + BSTO_FILE_DESCRIPTION VARCHAR2(300) NULL, + CONSTRAINT SYS_C0011049 CHECK ("BSTO_SEQ_NBR" IS NOT NULL), + CONSTRAINT SYS_C0011050 CHECK ("BSTO_TABLE_NAME" IS NOT NULL), + CONSTRAINT SYS_C0011051 CHECK ("BSTO_TABLE_PRIMARY_KEY" IS NOT NULL) +); + +CREATE TABLE THE.RESTORED_FOREST_COMMENT ( + COMM_SEQ_NBR NUMBER(15,0) NOT NULL, + COMM_MODULE VARCHAR2(15) NULL, + COMM_ITEM_TYPE VARCHAR2(30) NULL, + COMM_ITEM_SEQ_NBR NUMBER(15,0) NULL, + COMM_COMMENT_DATE DATE NOT NULL, + COMM_COMMENT VARCHAR2(4000) NOT NULL, + COMM_AGENCY VARCHAR2(15) NOT NULL, + COMM_AGENT VARCHAR2(15) NOT NULL, + COMM_RESPONSE_DATE DATE NULL, + COMM_RESPONDANT VARCHAR2(15) NULL, + COMM_RESPONSE VARCHAR2(4000) NULL, + COMM_ACTION_REQUIRED VARCHAR2(1) NULL, + COMM_ACTION_ITEM VARCHAR2(2000) NULL, + COMM_COMMENT_TYPE VARCHAR2(30) NULL, + COMM_FDP_ID VARCHAR2(50) NULL, + COMM_PARENT_SEQ_NBR NUMBER(15,0) NULL, + CONSTRAINT SYS_C0011056 CHECK ("COMM_SEQ_NBR" IS NOT NULL), + CONSTRAINT SYS_C0011057 CHECK ("COMM_COMMENT_DATE" IS NOT NULL), + CONSTRAINT SYS_C0011058 CHECK ("COMM_COMMENT" IS NOT NULL), + CONSTRAINT SYS_C0011059 CHECK ("COMM_AGENCY" IS NOT NULL), + CONSTRAINT SYS_C0011060 CHECK ("COMM_AGENT" IS NOT NULL) +); + +CREATE TABLE THE.CLIENT_UPDATE_ACTION_CODE ( + CLIENT_UPDATE_ACTION_CODE VARCHAR2(4) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CUAC_PK PRIMARY KEY (CLIENT_UPDATE_ACTION_CODE), + CONSTRAINT SYS_C0012618 CHECK ("CLIENT_UPDATE_ACTION_CODE" IS NOT NULL), + CONSTRAINT SYS_C0012619 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0012620 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012621 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012622 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.MAX_CLIENT_NMBR ( + DUMMY_ACCESS_KEY VARCHAR2(1) NOT NULL, + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + CONSTRAINT SYS_C0023534 CHECK ("DUMMY_ACCESS_KEY" IS NOT NULL), + CONSTRAINT SYS_C0023535 CHECK ("CLIENT_NUMBER" IS NOT NULL) +); +CREATE UNIQUE INDEX "I1$_MAX_CLIENT_NMBR" ON THE.MAX_CLIENT_NMBR (DUMMY_ACCESS_KEY); + +CREATE TABLE THE.CLIENT_UPDATE_REASON_CODE ( + CLIENT_UPDATE_REASON_CODE VARCHAR2(4) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CURCD_PK PRIMARY KEY (CLIENT_UPDATE_REASON_CODE), + CONSTRAINT SYS_C0012098 CHECK ("CLIENT_UPDATE_REASON_CODE" IS NOT NULL), + CONSTRAINT SYS_C0012099 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0012100 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012101 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012102 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.CODE_LIST_TABLE ( + COLUMN_NAME VARCHAR2(18) NOT NULL, + CODE_ARGUMENT VARCHAR2(50) NOT NULL, + EXPANDED_RESULT VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + CONSTRAINT SYS_C0029139 CHECK ("COLUMN_NAME" IS NOT NULL), + CONSTRAINT SYS_C0029140 CHECK ("CODE_ARGUMENT" IS NOT NULL), + CONSTRAINT SYS_C0029141 CHECK ("EXPANDED_RESULT" IS NOT NULL), + CONSTRAINT SYS_C0029142 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0029143 CHECK ("EXPIRY_DATE" IS NOT NULL) +); +CREATE UNIQUE INDEX "I1$_CODE_LIST_TABLE" ON THE.CODE_LIST_TABLE (COLUMN_NAME,CODE_ARGUMENT); + +CREATE TABLE THE.CODE_SUBSET_TBL ( + CODE_SUBSET_NAME VARCHAR2(18) NOT NULL, + COLUMN_NAME VARCHAR2(18) NOT NULL, + CODE_ARGUMENT VARCHAR2(50) NOT NULL, + IN_EFFECT_DATE DATE NULL, + EXPIRED_DATE DATE NULL, + CONSTRAINT SYS_C0029088 CHECK ("CODE_SUBSET_NAME" IS NOT NULL), + CONSTRAINT SYS_C0029089 CHECK ("COLUMN_NAME" IS NOT NULL), + CONSTRAINT SYS_C0029090 CHECK ("CODE_ARGUMENT" IS NOT NULL) +); +CREATE UNIQUE INDEX "I1$_CODE_SUBSET_TBL" ON THE.CODE_SUBSET_TBL (CODE_SUBSET_NAME,COLUMN_NAME,CODE_ARGUMENT); + +CREATE TABLE THE.CODE_TABLE ( + COLUMN_NAME VARCHAR2(18) NOT NULL, + CODE_CUSTODIAN NUMBER(10,0) NOT NULL, + UPDATE_AUTHORITY VARCHAR2(40) NOT NULL, + CODE_DESCRIPTION VARCHAR2(254) NOT NULL, + DISTRIBUTE_TYPE_CD VARCHAR2(3) NOT NULL, + CONSTRAINT SYS_C0032456 CHECK ("COLUMN_NAME" IS NOT NULL), + CONSTRAINT SYS_C0032458 CHECK ("CODE_CUSTODIAN" IS NOT NULL), + CONSTRAINT SYS_C0032460 CHECK ("UPDATE_AUTHORITY" IS NOT NULL), + CONSTRAINT SYS_C0032462 CHECK ("CODE_DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0032464 CHECK ("DISTRIBUTE_TYPE_CD" IS NOT NULL) +); +CREATE UNIQUE INDEX "I1$_CODE_TABLE" ON THE.CODE_TABLE (COLUMN_NAME); + +CREATE TABLE THE.CLIENT_ID_TYPE_CODE ( + CLIENT_ID_TYPE_CODE VARCHAR2(4) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CITC_PK PRIMARY KEY (CLIENT_ID_TYPE_CODE), + CONSTRAINT SYS_C0012128 CHECK ("CLIENT_ID_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0012129 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0012130 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012131 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012132 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.EXTERNAL_CLIENT_REORG_SYSTEM ( + APPLICATION_ACRONYM VARCHAR2(10) NOT NULL, + APPLICATION_UPDATE_IND VARCHAR2(1) NOT NULL, + ENTRY_TIMESTAMP DATE NOT NULL, + ENTRY_USERID VARCHAR2(30) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + CONSTRAINT ECRS_PK PRIMARY KEY (APPLICATION_ACRONYM), + CONSTRAINT SYS_C0022987 CHECK ("APPLICATION_ACRONYM" IS NOT NULL), + CONSTRAINT SYS_C0022988 CHECK ("APPLICATION_UPDATE_IND" IS NOT NULL), + CONSTRAINT SYS_C0022989 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0022990 CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0022991 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0022992 CHECK ("UPDATE_USERID" IS NOT NULL) +); + +CREATE TABLE THE.CLIENT_RELATIONSHIP_CODE ( + CLIENT_RELATIONSHIP_CODE VARCHAR2(2) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT RELCD_PK PRIMARY KEY (CLIENT_RELATIONSHIP_CODE), + CONSTRAINT SYS_C0012256 CHECK ("CLIENT_RELATIONSHIP_CODE" IS NOT NULL), + CONSTRAINT SYS_C0012257 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0012258 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012259 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012260 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.ORG_UNIT ( + ORG_UNIT_NO NUMBER(10,0) NOT NULL, + ORG_UNIT_CODE VARCHAR2(6) NOT NULL, + ORG_UNIT_NAME VARCHAR2(100) NOT NULL, + LOCATION_CODE VARCHAR2(3) NOT NULL, + AREA_CODE VARCHAR2(3) NOT NULL, + TELEPHONE_NO VARCHAR2(7) NOT NULL, + ORG_LEVEL_CODE VARCHAR2(1) NOT NULL, + OFFICE_NAME_CODE VARCHAR2(2) NOT NULL, + ROLLUP_REGION_NO NUMBER(10,0) NOT NULL, + ROLLUP_REGION_CODE VARCHAR2(6) NOT NULL, + ROLLUP_DIST_NO NUMBER(10,0) NOT NULL, + ROLLUP_DIST_CODE VARCHAR2(6) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NULL, + CONSTRAINT ORG_UNIT_PK PRIMARY KEY (ORG_UNIT_NO), + CONSTRAINT SYS_C008931 CHECK ("ORG_UNIT_NO" IS NOT NULL), + CONSTRAINT SYS_C008932 CHECK ("ORG_UNIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C008933 CHECK ("ORG_UNIT_NAME" IS NOT NULL), + CONSTRAINT SYS_C008934 CHECK ("LOCATION_CODE" IS NOT NULL), + CONSTRAINT SYS_C008935 CHECK ("AREA_CODE" IS NOT NULL), + CONSTRAINT SYS_C008936 CHECK ("TELEPHONE_NO" IS NOT NULL), + CONSTRAINT SYS_C008938 CHECK ("ORG_LEVEL_CODE" IS NOT NULL), + CONSTRAINT SYS_C008939 CHECK ("OFFICE_NAME_CODE" IS NOT NULL), + CONSTRAINT SYS_C008941 CHECK ("ROLLUP_REGION_NO" IS NOT NULL), + CONSTRAINT SYS_C008942 CHECK ("ROLLUP_REGION_CODE" IS NOT NULL), + CONSTRAINT SYS_C008944 CHECK ("ROLLUP_DIST_NO" IS NOT NULL), + CONSTRAINT SYS_C008946 CHECK ("ROLLUP_DIST_CODE" IS NOT NULL), + CONSTRAINT SYS_C008947 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C008949 CHECK ("EXPIRY_DATE" IS NOT NULL) +); +CREATE UNIQUE INDEX "I2$_ORG_UNIT" ON THE.ORG_UNIT (ORG_UNIT_CODE,ORG_UNIT_NO); +CREATE UNIQUE INDEX "I3$_ORG_UNIT" ON THE.ORG_UNIT (ORG_UNIT_CODE); +CREATE UNIQUE INDEX "I4$_ORG_UNIT" ON THE.ORG_UNIT (ORG_UNIT_NO,ORG_UNIT_CODE,ORG_UNIT_NAME,LOCATION_CODE,TELEPHONE_NO,ORG_LEVEL_CODE,OFFICE_NAME_CODE); +CREATE INDEX "I5$_ORG_UNIT" ON THE.ORG_UNIT (ROLLUP_DIST_CODE,ROLLUP_REGION_CODE); +CREATE INDEX "I6$_ORG_UNIT" ON THE.ORG_UNIT (ROLLUP_REGION_NO,ROLLUP_DIST_NO); +CREATE INDEX "I7$_ORG_UNIT" ON THE.ORG_UNIT (ROLLUP_REGION_CODE,ROLLUP_DIST_CODE); +CREATE UNIQUE INDEX "I8$_ORG_UNIT" ON THE.ORG_UNIT (ORG_UNIT_NO,ORG_UNIT_CODE); +CREATE UNIQUE INDEX "I9$_ORG_UNIT" ON THE.ORG_UNIT (ORG_UNIT_CODE,ORG_LEVEL_CODE,ORG_UNIT_NO,ORG_UNIT_NAME); + +CREATE TABLE THE.CLIENT_AUDIT_CODE ( + CLIENT_AUDIT_CODE VARCHAR2(3) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CAUDC_PK PRIMARY KEY (CLIENT_AUDIT_CODE), + CONSTRAINT SYS_C0012678 CHECK ("CLIENT_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0012679 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0012680 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012681 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012682 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.CLIENT_REORG_STATUS_CODE ( + CLIENT_REORG_STATUS_CODE VARCHAR2(4) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CRSCD_PK PRIMARY KEY (CLIENT_REORG_STATUS_CODE), + CONSTRAINT SYS_C0024849 CHECK ("CLIENT_REORG_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0024850 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0024851 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0024852 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0024853 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.CLIENT_REORG_TYPE_CODE ( + CLIENT_REORG_TYPE_CODE VARCHAR2(4) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CRTCD_PK PRIMARY KEY (CLIENT_REORG_TYPE_CODE), + CONSTRAINT SYS_C0024555 CHECK ("CLIENT_REORG_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0024556 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0024557 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0024558 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0024559 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.CLIENT_REORG_AUDIT_CODE ( + CLIENT_REORG_AUDIT_CODE VARCHAR2(3) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CRAC_PK PRIMARY KEY (CLIENT_REORG_AUDIT_CODE), + CONSTRAINT SYS_C0024973 CHECK ("CLIENT_REORG_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0024974 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0024975 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0024976 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0024977 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.CLIENT_STATUS_CODE ( + CLIENT_STATUS_CODE VARCHAR2(3) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CSTC_PK PRIMARY KEY (CLIENT_STATUS_CODE), + CONSTRAINT SYS_C0012691 CHECK ("CLIENT_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0012692 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0012693 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012694 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012695 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.REGISTRY_COMPANY_TYPE_CODE ( + REGISTRY_COMPANY_TYPE_CODE VARCHAR2(4) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CRCTC_PK PRIMARY KEY (REGISTRY_COMPANY_TYPE_CODE), + CONSTRAINT SYS_C0012219 CHECK ("REGISTRY_COMPANY_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0012220 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0012221 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012222 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012223 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.LOCATION ( + LOCATION_CODE VARCHAR2(3) NOT NULL, + STREET VARCHAR2(40) NOT NULL, + CITY VARCHAR2(15) NOT NULL, + PROVINCE VARCHAR2(4) NOT NULL, + PCODE VARCHAR2(6) NOT NULL, + CONSTRAINT SYS_C0021115 CHECK ("LOCATION_CODE" IS NOT NULL), + CONSTRAINT SYS_C0021116 CHECK ("STREET" IS NOT NULL), + CONSTRAINT SYS_C0021117 CHECK ("CITY" IS NOT NULL), + CONSTRAINT SYS_C0021118 CHECK ("PROVINCE" IS NOT NULL), + CONSTRAINT SYS_C0021119 CHECK ("PCODE" IS NOT NULL) +); +CREATE UNIQUE INDEX "I1$_LOCATION" ON THE.LOCATION (LOCATION_CODE); +CREATE INDEX "I2$_LOCATION" ON THE.LOCATION (CITY); + +CREATE TABLE THE.CLIENT_REORGANIZATION ( + CLIENT_REORGANIZATION_ID NUMBER(12,0) NOT NULL, + EFFECTIVE_DATE DATE NULL, + EXPIRY_DATE DATE NULL, + COMMENTS VARCHAR2(4000) NULL, + PARTIAL_REORG_IND VARCHAR2(1) NOT NULL, + CLIENT_REORG_STATUS_CODE VARCHAR2(4) NOT NULL, + CLIENT_REORG_TYPE_CODE VARCHAR2(4) NOT NULL, + COMPLETED_TIMESTAMP DATE NULL, + REVISION_COUNT NUMBER(5,0) NOT NULL, + ENTRY_TIMESTAMP DATE NOT NULL, + ENTRY_USERID VARCHAR2(30) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + CONSTRAINT CREORG_PK PRIMARY KEY (CLIENT_REORGANIZATION_ID), + CONSTRAINT SYS_C0025015 CHECK ("CLIENT_REORGANIZATION_ID" IS NOT NULL), + CONSTRAINT SYS_C0025016 CHECK ("PARTIAL_REORG_IND" IS NOT NULL), + CONSTRAINT SYS_C0025017 CHECK ("CLIENT_REORG_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0025018 CHECK ("CLIENT_REORG_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0025019 CHECK ("REVISION_COUNT" IS NOT NULL), + CONSTRAINT SYS_C0025020 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0025021 CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0025022 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0025023 CHECK ("UPDATE_USERID" IS NOT NULL) +); +CREATE INDEX CREORG_CRSC_FK_I ON THE.CLIENT_REORGANIZATION (CLIENT_REORG_STATUS_CODE); +CREATE INDEX CREORG_CRTC_FK_I ON THE.CLIENT_REORGANIZATION (CLIENT_REORG_TYPE_CODE); + +ALTER TABLE THE.CLIENT_REORGANIZATION ADD CONSTRAINT CREORG_CRSC_FK FOREIGN KEY (CLIENT_REORG_STATUS_CODE) REFERENCES THE.CLIENT_REORG_STATUS_CODE(CLIENT_REORG_STATUS_CODE); +ALTER TABLE THE.CLIENT_REORGANIZATION ADD CONSTRAINT CREORG_CRTC_FK FOREIGN KEY (CLIENT_REORG_TYPE_CODE) REFERENCES THE.CLIENT_REORG_TYPE_CODE(CLIENT_REORG_TYPE_CODE); + +CREATE TABLE THE.EXTERNAL_CLIENT_REORG_RESULT ( + EXTERNAL_CLIENT_REORG_RSLT_ID NUMBER(12,0) NOT NULL, + CLIENT_REORGANIZATION_ID NUMBER(12,0) NOT NULL, + ORIGINAL_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + ORIGINAL_CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + RESULTING_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + RESULTING_CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + APPLICATION_ACRONYM VARCHAR2(10) NOT NULL, + EXECUTED_PROCEDURE VARCHAR2(50) NOT NULL, + EXECUTED_TIMESTAMP DATE NOT NULL, + EXECUTED_BY_USERID VARCHAR2(30) NOT NULL, + UPDATED_TABLE VARCHAR2(50) NULL, + UPDATE_ROW_COUNT NUMBER(9,0) NULL, + ERROR_MESSAGE VARCHAR2(2000) NULL, + CONSTRAINT ECRR_PK PRIMARY KEY (EXTERNAL_CLIENT_REORG_RSLT_ID), + CONSTRAINT SYS_C0023039 CHECK ("EXTERNAL_CLIENT_REORG_RSLT_ID" IS NOT NULL), + CONSTRAINT SYS_C0023040 CHECK ("CLIENT_REORGANIZATION_ID" IS NOT NULL), + CONSTRAINT SYS_C0023041 CHECK ("ORIGINAL_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0023042 CHECK ("ORIGINAL_CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0023043 CHECK ("RESULTING_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0023044 CHECK ("RESULTING_CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0023045 CHECK ("APPLICATION_ACRONYM" IS NOT NULL), + CONSTRAINT SYS_C0023046 CHECK ("EXECUTED_PROCEDURE" IS NOT NULL), + CONSTRAINT SYS_C0023047 CHECK ("EXECUTED_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0023048 CHECK ("EXECUTED_BY_USERID" IS NOT NULL) +); +CREATE INDEX ECRR_CRD_FK_I ON THE.EXTERNAL_CLIENT_REORG_RESULT (CLIENT_REORGANIZATION_ID,ORIGINAL_CLIENT_NUMBER,ORIGINAL_CLIENT_LOCN_CODE,RESULTING_CLIENT_NUMBER,RESULTING_CLIENT_LOCN_CODE); +CREATE INDEX ECRR_ECRS_FK_I ON THE.EXTERNAL_CLIENT_REORG_RESULT (APPLICATION_ACRONYM); + +ALTER TABLE THE.EXTERNAL_CLIENT_REORG_RESULT ADD CONSTRAINT ECRR_ECRS_FK FOREIGN KEY (APPLICATION_ACRONYM) REFERENCES THE.EXTERNAL_CLIENT_REORG_SYSTEM(APPLICATION_ACRONYM); + +CREATE TABLE THE.CLIENT_RELATIONSHIP_TYPE_XREF ( + CLIENT_RELATIONSHIP_CODE VARCHAR2(2) NOT NULL, + PRIMARY_CLIENT_TYPE_CODE VARCHAR2(1) NOT NULL, + SECONDARY_CLIENT_TYPE_CODE VARCHAR2(1) NOT NULL, + REVISION_COUNT NUMBER(5,0) NOT NULL, + ENTRY_USERID VARCHAR2(30) NOT NULL, + ENTRY_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CRX_PK PRIMARY KEY (CLIENT_RELATIONSHIP_CODE,SECONDARY_CLIENT_TYPE_CODE,PRIMARY_CLIENT_TYPE_CODE), + CONSTRAINT SYS_C0019306 CHECK ("CLIENT_RELATIONSHIP_CODE" IS NOT NULL), + CONSTRAINT SYS_C0019307 CHECK ("PRIMARY_CLIENT_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0019308 CHECK ("SECONDARY_CLIENT_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0019309 CHECK ("REVISION_COUNT" IS NOT NULL), + CONSTRAINT SYS_C0019310 CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0019311 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0019312 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0019313 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); +CREATE INDEX CRX_PCTC_FK_I ON THE.CLIENT_RELATIONSHIP_TYPE_XREF (PRIMARY_CLIENT_TYPE_CODE); +CREATE INDEX CRX_RELCD_FK_I ON THE.CLIENT_RELATIONSHIP_TYPE_XREF (CLIENT_RELATIONSHIP_CODE); +CREATE INDEX CRX_SCTC_FK_I ON THE.CLIENT_RELATIONSHIP_TYPE_XREF (SECONDARY_CLIENT_TYPE_CODE); + + +ALTER TABLE THE.CLIENT_RELATIONSHIP_TYPE_XREF ADD CONSTRAINT CRX_PCTC_FK FOREIGN KEY (PRIMARY_CLIENT_TYPE_CODE) REFERENCES THE.CLIENT_TYPE_CODE(CLIENT_TYPE_CODE); +ALTER TABLE THE.CLIENT_RELATIONSHIP_TYPE_XREF ADD CONSTRAINT CRX_RELCD_FK FOREIGN KEY (CLIENT_RELATIONSHIP_CODE) REFERENCES THE.CLIENT_RELATIONSHIP_CODE(CLIENT_RELATIONSHIP_CODE); +ALTER TABLE THE.CLIENT_RELATIONSHIP_TYPE_XREF ADD CONSTRAINT CRX_SCTC_FK FOREIGN KEY (SECONDARY_CLIENT_TYPE_CODE) REFERENCES THE.CLIENT_TYPE_CODE(CLIENT_TYPE_CODE); + +CREATE TABLE THE.BUSINESS_CONTACT_CODE ( + BUSINESS_CONTACT_CODE VARCHAR2(3) NOT NULL, + DESCRIPTION VARCHAR2(120) NOT NULL, + EFFECTIVE_DATE DATE NOT NULL, + EXPIRY_DATE DATE NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT BCC_PK PRIMARY KEY (BUSINESS_CONTACT_CODE), + CONSTRAINT SYS_C0012316 CHECK ("BUSINESS_CONTACT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0012317 CHECK ("DESCRIPTION" IS NOT NULL), + CONSTRAINT SYS_C0012318 CHECK ("EFFECTIVE_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012319 CHECK ("EXPIRY_DATE" IS NOT NULL), + CONSTRAINT SYS_C0012320 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); + +CREATE TABLE THE.MAILING_COUNTRY ( + COUNTRY_NAME VARCHAR2(50) NOT NULL, + COUNTRY_CODE VARCHAR2(3) NULL, + CONSTRAINT CTRY_PK PRIMARY KEY (COUNTRY_NAME), + CONSTRAINT SYS_C0012419 CHECK ("COUNTRY_NAME" IS NOT NULL) +); + +CREATE TABLE THE.MAILING_PROVINCE_STATE ( + COUNTRY_NAME VARCHAR2(50) NOT NULL, + PROVINCE_STATE_NAME VARCHAR2(50) NOT NULL, + PROVINCE_STATE_CODE VARCHAR2(2) NULL, + CONSTRAINT PROV_PK PRIMARY KEY (PROVINCE_STATE_NAME,COUNTRY_NAME), + CONSTRAINT SYS_C0012368 CHECK ("COUNTRY_NAME" IS NOT NULL), + CONSTRAINT SYS_C0012369 CHECK ("PROVINCE_STATE_NAME" IS NOT NULL) +); +CREATE INDEX PROV_CTRY_FK_I ON THE.MAILING_PROVINCE_STATE (COUNTRY_NAME); +ALTER TABLE THE.MAILING_PROVINCE_STATE ADD CONSTRAINT PROV_CTRY_FK FOREIGN KEY (COUNTRY_NAME) REFERENCES THE.MAILING_COUNTRY(COUNTRY_NAME); + +CREATE TABLE THE.MAILING_CITY ( + COUNTRY_NAME VARCHAR2(50) NOT NULL, + PROVINCE_STATE_NAME VARCHAR2(50) NOT NULL, + CITY_NAME VARCHAR2(30) NOT NULL, + CONSTRAINT CTY_PK PRIMARY KEY (CITY_NAME,PROVINCE_STATE_NAME,COUNTRY_NAME), + CONSTRAINT SYS_C0010890 CHECK ("COUNTRY_NAME" IS NOT NULL), + CONSTRAINT SYS_C0010893 CHECK ("PROVINCE_STATE_NAME" IS NOT NULL), + CONSTRAINT SYS_C0010896 CHECK ("CITY_NAME" IS NOT NULL) +); +CREATE INDEX CTY_PROV_FK_I ON THE.MAILING_CITY (PROVINCE_STATE_NAME,COUNTRY_NAME); +ALTER TABLE THE.MAILING_CITY ADD CONSTRAINT CTY_PROV_FK FOREIGN KEY (PROVINCE_STATE_NAME,COUNTRY_NAME) REFERENCES THE.MAILING_PROVINCE_STATE(PROVINCE_STATE_NAME,COUNTRY_NAME); + +CREATE TABLE THE.CLIENT_REORG_AUDIT ( + CLIENT_REORG_AUDIT_ID NUMBER(12,0) NOT NULL, + CLIENT_REORG_AUDIT_CODE VARCHAR2(3) NOT NULL, + CLIENT_REORGANIZATION_ID NUMBER(12,0) NOT NULL, + EFFECTIVE_DATE DATE NULL, + EXPIRY_DATE DATE NULL, + COMMENTS VARCHAR2(4000) NULL, + PARTIAL_REORG_IND VARCHAR2(1) NOT NULL, + CLIENT_REORG_STATUS_CODE VARCHAR2(4) NOT NULL, + CLIENT_REORG_TYPE_CODE VARCHAR2(4) NOT NULL, + COMPLETED_TIMESTAMP DATE NULL, + ENTRY_TIMESTAMP DATE NOT NULL, + ENTRY_USERID VARCHAR2(30) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + CONSTRAINT CREA_PK PRIMARY KEY (CLIENT_REORG_AUDIT_ID), + CONSTRAINT SYS_C0024919 CHECK ("CLIENT_REORG_AUDIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0024920 CHECK ("CLIENT_REORG_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0024921 CHECK ("CLIENT_REORGANIZATION_ID" IS NOT NULL), + CONSTRAINT SYS_C0024922 CHECK ("PARTIAL_REORG_IND" IS NOT NULL), + CONSTRAINT SYS_C0024923 CHECK ("CLIENT_REORG_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0024924 CHECK ("CLIENT_REORG_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0024925 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0024926 CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0024927 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0024928 CHECK ("UPDATE_USERID" IS NOT NULL) +); +CREATE INDEX CREA_AAC_FK_I ON THE.CLIENT_REORG_AUDIT (CLIENT_REORG_AUDIT_CODE); +ALTER TABLE THE.CLIENT_REORG_AUDIT ADD CONSTRAINT CREA_CRAC_FK FOREIGN KEY (CLIENT_REORG_AUDIT_CODE) REFERENCES THE.CLIENT_REORG_AUDIT_CODE(CLIENT_REORG_AUDIT_CODE); + + +CREATE TABLE THE.CLIENT_TYPE_COMPANY_XREF ( + CLIENT_TYPE_CODE VARCHAR2(1) NOT NULL, + REGISTRY_COMPANY_TYPE_CODE VARCHAR2(4) NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + CONSTRAINT CTCX_PK PRIMARY KEY (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE), + CONSTRAINT SYS_C0011915 CHECK ("CLIENT_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0011916 CHECK ("REGISTRY_COMPANY_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0011917 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011918 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0011919 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011920 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); +CREATE INDEX CTCX_CRCTC_FK_I ON THE.CLIENT_TYPE_COMPANY_XREF (REGISTRY_COMPANY_TYPE_CODE); +CREATE INDEX CTCX_CTC_FK_I ON THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE); +ALTER TABLE THE.CLIENT_TYPE_COMPANY_XREF ADD CONSTRAINT CTCX_CRCTC_FK FOREIGN KEY (REGISTRY_COMPANY_TYPE_CODE) REFERENCES THE.REGISTRY_COMPANY_TYPE_CODE(REGISTRY_COMPANY_TYPE_CODE); +ALTER TABLE THE.CLIENT_TYPE_COMPANY_XREF ADD CONSTRAINT CTCX_CTC_FK FOREIGN KEY (CLIENT_TYPE_CODE) REFERENCES THE.CLIENT_TYPE_CODE(CLIENT_TYPE_CODE); + + +CREATE TABLE THE.FOREST_CLIENT ( + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + CLIENT_NAME VARCHAR2(60) NOT NULL, + LEGAL_FIRST_NAME VARCHAR2(30) NULL, + LEGAL_MIDDLE_NAME VARCHAR2(30) NULL, + CLIENT_STATUS_CODE VARCHAR2(3) NOT NULL, + CLIENT_TYPE_CODE VARCHAR2(1) NOT NULL, + BIRTHDATE DATE NULL, + CLIENT_ID_TYPE_CODE VARCHAR2(4) NULL, + CLIENT_IDENTIFICATION VARCHAR2(40) NULL, + REGISTRY_COMPANY_TYPE_CODE VARCHAR2(4) NULL, + CORP_REGN_NMBR VARCHAR2(9) NULL, + CLIENT_ACRONYM VARCHAR2(8) NULL, + WCB_FIRM_NUMBER VARCHAR2(6) NULL, + OCG_SUPPLIER_NMBR VARCHAR2(10) NULL, + CLIENT_COMMENT VARCHAR2(4000) NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, + REVISION_COUNT NUMBER(5,0) NOT NULL, + CONSTRAINT FOREST_CLIENT_PK PRIMARY KEY (CLIENT_NUMBER), + CONSTRAINT SYS_C0029588 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0029589 CHECK ("CLIENT_NAME" IS NOT NULL), + CONSTRAINT SYS_C0029590 CHECK ("CLIENT_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029591 CHECK ("CLIENT_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029592 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029593 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029594 CHECK ("ADD_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0029595 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029596 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029597 CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0029598 CHECK ("REVISION_COUNT" IS NOT NULL) +); +CREATE UNIQUE INDEX FC_ACRONYM_I ON THE.FOREST_CLIENT (CLIENT_ACRONYM); +CREATE INDEX FC_CITC_FK_I ON THE.FOREST_CLIENT (CLIENT_ID_TYPE_CODE); +CREATE INDEX FC_CSC_FK_I ON THE.FOREST_CLIENT (CLIENT_STATUS_CODE); +CREATE INDEX FC_CTCX_FK_I ON THE.FOREST_CLIENT (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE); +CREATE INDEX FC_OU_FK_I ON THE.FOREST_CLIENT (ADD_ORG_UNIT); +CREATE INDEX FC_OU_IS_UPDATED_BY_FK_I ON THE.FOREST_CLIENT (UPDATE_ORG_UNIT); +CREATE UNIQUE INDEX "I2$_FOREST_CLIENT" ON THE.FOREST_CLIENT (CLIENT_NAME,LEGAL_FIRST_NAME,LEGAL_MIDDLE_NAME,CLIENT_NUMBER); +CREATE INDEX "I4$_FOREST_CLIENT" ON THE.FOREST_CLIENT (OCG_SUPPLIER_NMBR); +CREATE INDEX "I5$_FOREST_CLIENT" ON THE.FOREST_CLIENT (CORP_REGN_NMBR); +ALTER TABLE THE.FOREST_CLIENT ADD CONSTRAINT FC_CITC_FK FOREIGN KEY (CLIENT_ID_TYPE_CODE) REFERENCES THE.CLIENT_ID_TYPE_CODE(CLIENT_ID_TYPE_CODE); +ALTER TABLE THE.FOREST_CLIENT ADD CONSTRAINT FC_CSC_FK FOREIGN KEY (CLIENT_STATUS_CODE) REFERENCES THE.CLIENT_STATUS_CODE(CLIENT_STATUS_CODE); +ALTER TABLE THE.FOREST_CLIENT ADD CONSTRAINT FC_CTCX_FK FOREIGN KEY (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE) REFERENCES THE.CLIENT_TYPE_COMPANY_XREF(CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE); +ALTER TABLE THE.FOREST_CLIENT ADD CONSTRAINT FC_OU_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.FOREST_CLIENT ADD CONSTRAINT FC_OU_IS_UPDATED_BY_FK FOREIGN KEY (UPDATE_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); + + +CREATE TABLE THE.CLIENT_REORG_LINK ( + CLIENT_REORGANIZATION_ID NUMBER(12,0) NOT NULL, + ORIGINAL_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + RESULTING_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + REVISION_COUNT NUMBER(5,0) NOT NULL, + ENTRY_TIMESTAMP DATE NOT NULL, + ENTRY_USERID VARCHAR2(30) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + CONSTRAINT CRL_PK PRIMARY KEY (CLIENT_REORGANIZATION_ID,ORIGINAL_CLIENT_NUMBER,RESULTING_CLIENT_NUMBER), + CONSTRAINT SYS_C0023174 CHECK ("CLIENT_REORGANIZATION_ID" IS NOT NULL), + CONSTRAINT SYS_C0023175 CHECK ("ORIGINAL_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0023176 CHECK ("RESULTING_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0023177 CHECK ("REVISION_COUNT" IS NOT NULL), + CONSTRAINT SYS_C0023178 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0023179 CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0023180 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0023181 CHECK ("UPDATE_USERID" IS NOT NULL) +); +CREATE INDEX CRL_CR_FK_I ON THE.CLIENT_REORG_LINK (CLIENT_REORGANIZATION_ID); +CREATE INDEX CRL_FC_FK_I ON THE.CLIENT_REORG_LINK (ORIGINAL_CLIENT_NUMBER); +CREATE INDEX CRL_FC_INCLUDES_RESULTING_FK_I ON THE.CLIENT_REORG_LINK (RESULTING_CLIENT_NUMBER); + +ALTER TABLE THE.CLIENT_REORG_LINK ADD CONSTRAINT CRL_CR_FK FOREIGN KEY (CLIENT_REORGANIZATION_ID) REFERENCES THE.CLIENT_REORGANIZATION(CLIENT_REORGANIZATION_ID); +ALTER TABLE THE.CLIENT_REORG_LINK ADD CONSTRAINT CRL_FC_FK FOREIGN KEY (ORIGINAL_CLIENT_NUMBER) REFERENCES THE.FOREST_CLIENT(CLIENT_NUMBER); +ALTER TABLE THE.CLIENT_REORG_LINK ADD CONSTRAINT CRL_FC_INCLUDES_RESULTING_FK FOREIGN KEY (RESULTING_CLIENT_NUMBER) REFERENCES THE.FOREST_CLIENT(CLIENT_NUMBER); + +CREATE TABLE THE.CLIENT_LOCATION ( + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + CLIENT_LOCN_NAME VARCHAR2(40) NULL, + HDBS_COMPANY_CODE VARCHAR2(5) NULL, + ADDRESS_1 VARCHAR2(40) NOT NULL, + ADDRESS_2 VARCHAR2(40) NULL, + ADDRESS_3 VARCHAR2(40) NULL, + CITY VARCHAR2(30) NOT NULL, + PROVINCE VARCHAR2(50) NULL, + POSTAL_CODE VARCHAR2(10) NULL, + COUNTRY VARCHAR2(50) NOT NULL, + BUSINESS_PHONE VARCHAR2(10) NULL, + HOME_PHONE VARCHAR2(10) NULL, + CELL_PHONE VARCHAR2(10) NULL, + FAX_NUMBER VARCHAR2(10) NULL, + EMAIL_ADDRESS VARCHAR2(128) NULL, + LOCN_EXPIRED_IND VARCHAR2(1) NOT NULL, + RETURNED_MAIL_DATE DATE NULL, + TRUST_LOCATION_IND VARCHAR2(1) NOT NULL, + CLI_LOCN_COMMENT VARCHAR2(4000) NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + REVISION_COUNT NUMBER(5,0) NOT NULL, + CONSTRAINT "BIN$A8NnKNSZAszgVAAQ4CNh2g==$0" CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT "BIN$A8NnKNSaAszgVAAQ4CNh2g==$0" CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), + CONSTRAINT "BIN$A8NnKNSbAszgVAAQ4CNh2g==$0" CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT "BIN$A8NnKNScAszgVAAQ4CNh2g==$0" CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT "BIN$A8NnKNSdAszgVAAQ4CNh2g==$0" CHECK ("ADD_ORG_UNIT" IS NOT NULL), + CONSTRAINT "BIN$A8NnKNSeAszgVAAQ4CNh2g==$0" CHECK ("REVISION_COUNT" IS NOT NULL), + CONSTRAINT CLIENT_LOCATION_PK PRIMARY KEY (CLIENT_NUMBER,CLIENT_LOCN_CODE), + CONSTRAINT SYS_C0030524 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0030525 CHECK ("CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0030526 CHECK ("ADDRESS_1" IS NOT NULL), + CONSTRAINT SYS_C0030527 CHECK ("CITY" IS NOT NULL), + CONSTRAINT SYS_C0030528 CHECK ("COUNTRY" IS NOT NULL), + CONSTRAINT SYS_C0030529 CHECK ("LOCN_EXPIRED_IND" IS NOT NULL), + CONSTRAINT SYS_C0030530 CHECK ("TRUST_LOCATION_IND" IS NOT NULL), + CONSTRAINT SYS_C0030531 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL) +); +CREATE INDEX CL_FC_FK_I ON THE.CLIENT_LOCATION (CLIENT_NUMBER); +CREATE INDEX CL_OU_FK_I ON THE.CLIENT_LOCATION (UPDATE_ORG_UNIT); +CREATE INDEX CL_OU_IS_CREATED_BY_FK_I ON THE.CLIENT_LOCATION (ADD_ORG_UNIT); +CREATE INDEX "I2$_CLIENT_LOCATION" ON THE.CLIENT_LOCATION (HDBS_COMPANY_CODE); +ALTER TABLE THE.CLIENT_LOCATION ADD CONSTRAINT CL_FC_FK FOREIGN KEY (CLIENT_NUMBER) REFERENCES THE.FOREST_CLIENT(CLIENT_NUMBER); +ALTER TABLE THE.CLIENT_LOCATION ADD CONSTRAINT CL_OU_FK FOREIGN KEY (UPDATE_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.CLIENT_LOCATION ADD CONSTRAINT CL_OU_IS_CREATED_BY_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); + +CREATE TABLE THE.CLIENT_CONTACT ( + CLIENT_CONTACT_ID NUMBER(12,0) NOT NULL, + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + BUS_CONTACT_CODE VARCHAR2(3) NOT NULL, + CONTACT_NAME VARCHAR2(120) NOT NULL, + BUSINESS_PHONE VARCHAR2(10) NULL, + CELL_PHONE VARCHAR2(10) NULL, + FAX_NUMBER VARCHAR2(10) NULL, + EMAIL_ADDRESS VARCHAR2(128) NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + REVISION_COUNT NUMBER(5,0) NOT NULL, + CONSTRAINT CLC_PK PRIMARY KEY (CLIENT_CONTACT_ID), + CONSTRAINT SYS_C0030038 CHECK ("CLIENT_CONTACT_ID" IS NOT NULL), + CONSTRAINT SYS_C0030040 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0030042 CHECK ("CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0030044 CHECK ("BUS_CONTACT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0030046 CHECK ("CONTACT_NAME" IS NOT NULL), + CONSTRAINT SYS_C0030048 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0030050 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0030051 CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0030052 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0030053 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0030054 CHECK ("ADD_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0030055 CHECK ("REVISION_COUNT" IS NOT NULL) +); +CREATE INDEX CC_BCC_FK_I ON THE.CLIENT_CONTACT (BUS_CONTACT_CODE); +CREATE INDEX CC_CL_FK_I ON THE.CLIENT_CONTACT (CLIENT_NUMBER,CLIENT_LOCN_CODE); +CREATE INDEX CC_OU_FK_I ON THE.CLIENT_CONTACT (ADD_ORG_UNIT); +CREATE INDEX CC_OU_IS_UPDATED_BY_FK_I ON THE.CLIENT_CONTACT (UPDATE_ORG_UNIT); +ALTER TABLE THE.CLIENT_CONTACT ADD CONSTRAINT CC_BCC_FK FOREIGN KEY (BUS_CONTACT_CODE) REFERENCES THE.BUSINESS_CONTACT_CODE(BUSINESS_CONTACT_CODE); +ALTER TABLE THE.CLIENT_CONTACT ADD CONSTRAINT CC_CL_FK FOREIGN KEY (CLIENT_NUMBER,CLIENT_LOCN_CODE) REFERENCES THE.CLIENT_LOCATION(CLIENT_NUMBER,CLIENT_LOCN_CODE); +ALTER TABLE THE.CLIENT_CONTACT ADD CONSTRAINT CC_OU_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.CLIENT_CONTACT ADD CONSTRAINT CC_OU_IS_UPDATED_BY_FK FOREIGN KEY (UPDATE_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); + +CREATE TABLE THE.CLIENT_REORG_DETAIL ( + CLIENT_REORGANIZATION_ID NUMBER(12,0) NOT NULL, + ORIGINAL_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + ORIGINAL_CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + RESULTING_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + RESULTING_CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + REVISION_COUNT NUMBER(5,0) NOT NULL, + ENTRY_TIMESTAMP DATE NOT NULL, + ENTRY_USERID VARCHAR2(30) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + CONSTRAINT CRD_PK PRIMARY KEY (CLIENT_REORGANIZATION_ID,ORIGINAL_CLIENT_NUMBER,ORIGINAL_CLIENT_LOCN_CODE,RESULTING_CLIENT_NUMBER,RESULTING_CLIENT_LOCN_CODE), + CONSTRAINT SYS_C0023091 CHECK ("CLIENT_REORGANIZATION_ID" IS NOT NULL), + CONSTRAINT SYS_C0023093 CHECK ("ORIGINAL_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0023095 CHECK ("ORIGINAL_CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0023097 CHECK ("RESULTING_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0023099 CHECK ("RESULTING_CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0023101 CHECK ("REVISION_COUNT" IS NOT NULL), + CONSTRAINT SYS_C0023103 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0023105 CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0023107 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0023109 CHECK ("UPDATE_USERID" IS NOT NULL) +); +CREATE INDEX CRD_CL_FK_I ON THE.CLIENT_REORG_DETAIL (ORIGINAL_CLIENT_NUMBER,ORIGINAL_CLIENT_LOCN_CODE); +CREATE INDEX CRD_CL_INCLUDES_RESULTING_FK_I ON THE.CLIENT_REORG_DETAIL (RESULTING_CLIENT_NUMBER,RESULTING_CLIENT_LOCN_CODE); +CREATE INDEX CRD_CR_FK_I ON THE.CLIENT_REORG_DETAIL (CLIENT_REORGANIZATION_ID); +ALTER TABLE THE.CLIENT_REORG_DETAIL ADD CONSTRAINT CRD_CL_FK FOREIGN KEY (ORIGINAL_CLIENT_NUMBER,ORIGINAL_CLIENT_LOCN_CODE) REFERENCES THE.CLIENT_LOCATION(CLIENT_NUMBER,CLIENT_LOCN_CODE); +ALTER TABLE THE.CLIENT_REORG_DETAIL ADD CONSTRAINT CRD_CL_INCLUDES_RESULTING_FK FOREIGN KEY (RESULTING_CLIENT_NUMBER,RESULTING_CLIENT_LOCN_CODE) REFERENCES THE.CLIENT_LOCATION(CLIENT_NUMBER,CLIENT_LOCN_CODE); +ALTER TABLE THE.CLIENT_REORG_DETAIL ADD CONSTRAINT CRD_CR_FK FOREIGN KEY (CLIENT_REORGANIZATION_ID) REFERENCES THE.CLIENT_REORGANIZATION(CLIENT_REORGANIZATION_ID); + +CREATE TABLE THE.CLIENT_DOING_BUSINESS_AS ( + CLIENT_DBA_ID NUMBER(12,0) NOT NULL, + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + DOING_BUSINESS_AS_NAME VARCHAR2(120) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + REVISION_COUNT NUMBER(5,0) NOT NULL, + CONSTRAINT CDBA_PK PRIMARY KEY (CLIENT_DBA_ID), + CONSTRAINT SYS_C0011796 CHECK ("CLIENT_DBA_ID" IS NOT NULL), + CONSTRAINT SYS_C0011797 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0011798 CHECK ("DOING_BUSINESS_AS_NAME" IS NOT NULL), + CONSTRAINT SYS_C0011799 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0011800 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011801 CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0011802 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0011803 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011804 CHECK ("ADD_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0011805 CHECK ("REVISION_COUNT" IS NOT NULL) +); +CREATE INDEX CDBA_FC_FK_I ON THE.CLIENT_DOING_BUSINESS_AS (CLIENT_NUMBER); +CREATE INDEX CDBA_OU_FK_I ON THE.CLIENT_DOING_BUSINESS_AS (ADD_ORG_UNIT); +CREATE INDEX CDBA_OU_IS_UPDATED_BY_FK_I ON THE.CLIENT_DOING_BUSINESS_AS (UPDATE_ORG_UNIT); +ALTER TABLE THE.CLIENT_DOING_BUSINESS_AS ADD CONSTRAINT CDBA_FC_FK FOREIGN KEY (CLIENT_NUMBER) REFERENCES THE.FOREST_CLIENT(CLIENT_NUMBER); +ALTER TABLE THE.CLIENT_DOING_BUSINESS_AS ADD CONSTRAINT CDBA_OU_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.CLIENT_DOING_BUSINESS_AS ADD CONSTRAINT CDBA_OU_IS_UPDATED_BY_FK FOREIGN KEY (UPDATE_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); + +CREATE TABLE THE.CLIENT_REORG_LINK_AUDIT ( + CLIENT_REORG_LINK_AUDIT_ID NUMBER(12,0) NOT NULL, + CLIENT_REORG_AUDIT_CODE VARCHAR2(3) NOT NULL, + CLIENT_REORGANIZATION_ID NUMBER(12,0) NOT NULL, + ORIGINAL_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + RESULTING_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + ENTRY_TIMESTAMP DATE NOT NULL, + ENTRY_USERID VARCHAR2(30) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + CONSTRAINT CRLA_PK PRIMARY KEY (CLIENT_REORG_LINK_AUDIT_ID), + CONSTRAINT SYS_C0022934 CHECK ("CLIENT_REORG_LINK_AUDIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0022935 CHECK ("CLIENT_REORG_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0022936 CHECK ("CLIENT_REORGANIZATION_ID" IS NOT NULL), + CONSTRAINT SYS_C0022937 CHECK ("ORIGINAL_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0022938 CHECK ("RESULTING_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0022939 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0022940 CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0022941 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0022942 CHECK ("UPDATE_USERID" IS NOT NULL) +); +CREATE INDEX CRLA_AAC_FK_I ON THE.CLIENT_REORG_LINK_AUDIT (CLIENT_REORG_AUDIT_CODE); +ALTER TABLE THE.CLIENT_REORG_LINK_AUDIT ADD CONSTRAINT CRLA_CRAC_FK FOREIGN KEY (CLIENT_REORG_AUDIT_CODE) REFERENCES THE.CLIENT_REORG_AUDIT_CODE(CLIENT_REORG_AUDIT_CODE); + +CREATE TABLE THE.CLIENT_REORG_DETAIL_AUDIT ( + CLIENT_REORG_DETAIL_AUDIT_ID NUMBER(12,0) NOT NULL, + CLIENT_REORG_AUDIT_CODE VARCHAR2(3) NOT NULL, + CLIENT_REORGANIZATION_ID NUMBER(12,0) NOT NULL, + ORIGINAL_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + ORIGINAL_CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + RESULTING_CLIENT_NUMBER VARCHAR2(8) NOT NULL, + RESULTING_CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + ENTRY_TIMESTAMP DATE NOT NULL, + ENTRY_USERID VARCHAR2(30) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + CONSTRAINT CRDA_PK PRIMARY KEY (CLIENT_REORG_DETAIL_AUDIT_ID), + CONSTRAINT SYS_C0024617 CHECK ("CLIENT_REORG_DETAIL_AUDIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0024618 CHECK ("CLIENT_REORG_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0024619 CHECK ("CLIENT_REORGANIZATION_ID" IS NOT NULL), + CONSTRAINT SYS_C0024620 CHECK ("ORIGINAL_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0024621 CHECK ("ORIGINAL_CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0024622 CHECK ("RESULTING_CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0024623 CHECK ("RESULTING_CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0024624 CHECK ("ENTRY_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0024625 CHECK ("ENTRY_USERID" IS NOT NULL), + CONSTRAINT SYS_C0024626 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0024627 CHECK ("UPDATE_USERID" IS NOT NULL) +); +CREATE INDEX CRDA_AAC_FK_I ON THE.CLIENT_REORG_DETAIL_AUDIT (CLIENT_REORG_AUDIT_CODE); +ALTER TABLE THE.CLIENT_REORG_DETAIL_AUDIT ADD CONSTRAINT CRDA_CRAC_FK FOREIGN KEY (CLIENT_REORG_AUDIT_CODE) REFERENCES THE.CLIENT_REORG_AUDIT_CODE(CLIENT_REORG_AUDIT_CODE); + +CREATE TABLE THE.FOR_CLI_AUDIT ( + FOREST_CLIENT_AUDIT_ID NUMBER(12,0) NOT NULL, + CLIENT_AUDIT_CODE VARCHAR2(3) NOT NULL, + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + CLIENT_NAME VARCHAR2(60) NOT NULL, + LEGAL_FIRST_NAME VARCHAR2(30) NULL, + LEGAL_MIDDLE_NAME VARCHAR2(30) NULL, + CLIENT_STATUS_CODE VARCHAR2(3) NOT NULL, + CLIENT_TYPE_CODE VARCHAR2(1) NOT NULL, + BIRTHDATE DATE NULL, + CLIENT_ID_TYPE_CODE VARCHAR2(4) NULL, + CLIENT_IDENTIFICATION VARCHAR2(40) NULL, + REGISTRY_COMPANY_TYPE_CODE VARCHAR2(4) NULL, + CORP_REGN_NMBR VARCHAR2(9) NULL, + CLIENT_ACRONYM VARCHAR2(8) NULL, + WCB_FIRM_NUMBER VARCHAR2(6) NULL, + OCG_SUPPLIER_NMBR VARCHAR2(10) NULL, + CLIENT_COMMENT VARCHAR2(4000) NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, + CONSTRAINT FCAUD_PK PRIMARY KEY (FOREST_CLIENT_AUDIT_ID), + CONSTRAINT SYS_C0029950 CHECK ("FOREST_CLIENT_AUDIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0029951 CHECK ("CLIENT_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029952 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0029953 CHECK ("CLIENT_NAME" IS NOT NULL), + CONSTRAINT SYS_C0029954 CHECK ("CLIENT_STATUS_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029955 CHECK ("CLIENT_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029956 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029957 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029958 CHECK ("ADD_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0029959 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029960 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029961 CHECK ("UPDATE_ORG_UNIT" IS NOT NULL) +); +CREATE INDEX FCA_CAUDC_FK_I ON THE.FOR_CLI_AUDIT (CLIENT_AUDIT_CODE); +CREATE INDEX FCA_FC_FK_I ON THE.FOR_CLI_AUDIT (CLIENT_NUMBER); +CREATE INDEX FCA_OU_FK_I ON THE.FOR_CLI_AUDIT (ADD_ORG_UNIT); +CREATE INDEX FCA_OU_IS_UPDATED_BY_FK_I ON THE.FOR_CLI_AUDIT (UPDATE_ORG_UNIT); +ALTER TABLE THE.FOR_CLI_AUDIT ADD CONSTRAINT FCA_CAUDC_FK FOREIGN KEY (CLIENT_AUDIT_CODE) REFERENCES THE.CLIENT_AUDIT_CODE(CLIENT_AUDIT_CODE); +ALTER TABLE THE.FOR_CLI_AUDIT ADD CONSTRAINT FCA_FC_FK FOREIGN KEY (CLIENT_NUMBER) REFERENCES THE.FOREST_CLIENT(CLIENT_NUMBER); +ALTER TABLE THE.FOR_CLI_AUDIT ADD CONSTRAINT FCA_OU_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.FOR_CLI_AUDIT ADD CONSTRAINT FCA_OU_IS_UPDATED_BY_FK FOREIGN KEY (UPDATE_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); + +CREATE TABLE THE.CLIENT_DOING_BUSINESS_AS_AUDIT ( + CLIENT_DBA_AUDIT_ID NUMBER(12,0) NOT NULL, + CLIENT_AUDIT_CODE VARCHAR2(3) NOT NULL, + CLIENT_DBA_ID NUMBER(12,0) NOT NULL, + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + DOING_BUSINESS_AS_NAME VARCHAR2(120) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + CONSTRAINT CDBAA_PK PRIMARY KEY (CLIENT_DBA_AUDIT_ID), + CONSTRAINT SYS_C0011716 CHECK ("CLIENT_DBA_AUDIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0011717 CHECK ("CLIENT_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0011718 CHECK ("CLIENT_DBA_ID" IS NOT NULL), + CONSTRAINT SYS_C0011719 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0011720 CHECK ("DOING_BUSINESS_AS_NAME" IS NOT NULL), + CONSTRAINT SYS_C0011721 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0011722 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011723 CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0011724 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0011725 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011726 CHECK ("ADD_ORG_UNIT" IS NOT NULL) +); +CREATE INDEX CDBAA_CAUDC_FK_I ON THE.CLIENT_DOING_BUSINESS_AS_AUDIT (CLIENT_AUDIT_CODE); +CREATE INDEX CDBAA_OU_FK_I ON THE.CLIENT_DOING_BUSINESS_AS_AUDIT (ADD_ORG_UNIT); +CREATE INDEX CDBAA_OU_IS_UPDATED_BY_FK_I ON THE.CLIENT_DOING_BUSINESS_AS_AUDIT (UPDATE_ORG_UNIT); +ALTER TABLE THE.CLIENT_DOING_BUSINESS_AS_AUDIT ADD CONSTRAINT CDBAA_CAUDC_FK FOREIGN KEY (CLIENT_AUDIT_CODE) REFERENCES THE.CLIENT_AUDIT_CODE(CLIENT_AUDIT_CODE); +ALTER TABLE THE.CLIENT_DOING_BUSINESS_AS_AUDIT ADD CONSTRAINT CDBAA_OU_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.CLIENT_DOING_BUSINESS_AS_AUDIT ADD CONSTRAINT CDBAA_OU_IS_UPDATED_BY_FK FOREIGN KEY (UPDATE_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); + +CREATE TABLE THE.CLIENT_ACTION_REASON_XREF ( + CLIENT_UPDATE_ACTION_CODE VARCHAR2(4) NOT NULL, + CLIENT_UPDATE_REASON_CODE VARCHAR2(4) NOT NULL, + CLIENT_TYPE_CODE VARCHAR2(1) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + CONSTRAINT CARX_PK PRIMARY KEY (CLIENT_UPDATE_ACTION_CODE,CLIENT_UPDATE_REASON_CODE,CLIENT_TYPE_CODE), + CONSTRAINT SYS_C0038307 CHECK ("CLIENT_UPDATE_ACTION_CODE" IS NOT NULL), + CONSTRAINT SYS_C0038309 CHECK ("CLIENT_UPDATE_REASON_CODE" IS NOT NULL), + CONSTRAINT SYS_C0038311 CHECK ("CLIENT_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0038313 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0038315 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0038317 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0038319 CHECK ("ADD_USERID" IS NOT NULL) +); +CREATE INDEX CARX_CTC_FK_I ON THE.CLIENT_ACTION_REASON_XREF (CLIENT_TYPE_CODE); +CREATE INDEX CARX_CUAC_FK_I ON THE.CLIENT_ACTION_REASON_XREF (CLIENT_UPDATE_ACTION_CODE); +CREATE INDEX CARX_CURC_FK_I ON THE.CLIENT_ACTION_REASON_XREF (CLIENT_UPDATE_REASON_CODE); +ALTER TABLE THE.CLIENT_ACTION_REASON_XREF ADD CONSTRAINT CARX_CTC_FK FOREIGN KEY (CLIENT_TYPE_CODE) REFERENCES THE.CLIENT_TYPE_CODE(CLIENT_TYPE_CODE); +ALTER TABLE THE.CLIENT_ACTION_REASON_XREF ADD CONSTRAINT CARX_CUAC_FK FOREIGN KEY (CLIENT_UPDATE_ACTION_CODE) REFERENCES THE.CLIENT_UPDATE_ACTION_CODE(CLIENT_UPDATE_ACTION_CODE); +ALTER TABLE THE.CLIENT_ACTION_REASON_XREF ADD CONSTRAINT CARX_CURC_FK FOREIGN KEY (CLIENT_UPDATE_REASON_CODE) REFERENCES THE.CLIENT_UPDATE_REASON_CODE(CLIENT_UPDATE_REASON_CODE); + +CREATE TABLE THE.CLIENT_UPDATE_REASON ( + CLIENT_UPDATE_REASON_ID NUMBER(12,0) NOT NULL, + CLIENT_UPDATE_ACTION_CODE VARCHAR2(4) NOT NULL, + CLIENT_UPDATE_REASON_CODE VARCHAR2(4) NOT NULL, + CLIENT_TYPE_CODE VARCHAR2(1) NOT NULL, + FOREST_CLIENT_AUDIT_ID NUMBER(12,0) NOT NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + CONSTRAINT CU_PK PRIMARY KEY (CLIENT_UPDATE_REASON_ID), + CONSTRAINT SYS_C0038356 CHECK ("CLIENT_UPDATE_REASON_ID" IS NOT NULL), + CONSTRAINT SYS_C0038357 CHECK ("CLIENT_UPDATE_ACTION_CODE" IS NOT NULL), + CONSTRAINT SYS_C0038358 CHECK ("CLIENT_UPDATE_REASON_CODE" IS NOT NULL), + CONSTRAINT SYS_C0038359 CHECK ("CLIENT_TYPE_CODE" IS NOT NULL), + CONSTRAINT SYS_C0038360 CHECK ("FOREST_CLIENT_AUDIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0038361 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0038362 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0038363 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0038364 CHECK ("ADD_USERID" IS NOT NULL) +); +CREATE INDEX CU_CARX_FK_I ON THE.CLIENT_UPDATE_REASON (CLIENT_UPDATE_ACTION_CODE,CLIENT_UPDATE_REASON_CODE,CLIENT_TYPE_CODE); +CREATE INDEX CU_FCA_FK_I ON THE.CLIENT_UPDATE_REASON (FOREST_CLIENT_AUDIT_ID); +ALTER TABLE THE.CLIENT_UPDATE_REASON ADD CONSTRAINT CU_CARX_FK FOREIGN KEY (CLIENT_UPDATE_ACTION_CODE,CLIENT_UPDATE_REASON_CODE,CLIENT_TYPE_CODE) REFERENCES THE.CLIENT_ACTION_REASON_XREF(CLIENT_UPDATE_ACTION_CODE,CLIENT_UPDATE_REASON_CODE,CLIENT_TYPE_CODE); +ALTER TABLE THE.CLIENT_UPDATE_REASON ADD CONSTRAINT CU_FCA_FK FOREIGN KEY (FOREST_CLIENT_AUDIT_ID) REFERENCES THE.FOR_CLI_AUDIT(FOREST_CLIENT_AUDIT_ID); + +CREATE TABLE THE.CLI_CON_AUDIT ( + CLIENT_CONTACT_AUDIT_ID NUMBER(12,0) NOT NULL, + CLIENT_AUDIT_CODE VARCHAR2(3) NOT NULL, + CLIENT_CONTACT_ID NUMBER(12,0) NULL, + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + BUS_CONTACT_CODE VARCHAR2(3) NOT NULL, + CONTACT_NAME VARCHAR2(120) NOT NULL, + BUSINESS_PHONE VARCHAR2(10) NULL, + CELL_PHONE VARCHAR2(10) NULL, + FAX_NUMBER VARCHAR2(10) NULL, + EMAIL_ADDRESS VARCHAR2(128) NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT_NO NUMBER(10,0) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + CONSTRAINT CCA_PK PRIMARY KEY (CLIENT_CONTACT_AUDIT_ID), + CONSTRAINT SYS_C0029803 CHECK ("CLIENT_CONTACT_AUDIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0029804 CHECK ("CLIENT_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029805 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0029806 CHECK ("CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029807 CHECK ("BUS_CONTACT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029808 CHECK ("CONTACT_NAME" IS NOT NULL), + CONSTRAINT SYS_C0029809 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029810 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029811 CHECK ("UPDATE_ORG_UNIT_NO" IS NOT NULL), + CONSTRAINT SYS_C0029812 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029813 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029814 CHECK ("ADD_ORG_UNIT" IS NOT NULL) +); +CREATE INDEX CCA_OU_FK_I ON THE.CLI_CON_AUDIT (ADD_ORG_UNIT); +CREATE INDEX CCA_OU_IS_UPDATED_BY_FK_I ON THE.CLI_CON_AUDIT (UPDATE_ORG_UNIT_NO); +CREATE UNIQUE INDEX "I1$_CLI_CON_AUDIT" ON THE.CLI_CON_AUDIT (CLIENT_NUMBER,CLIENT_LOCN_CODE,BUS_CONTACT_CODE,UPDATE_TIMESTAMP); +ALTER TABLE THE.CLI_CON_AUDIT ADD CONSTRAINT CCA_CAUDC_FK FOREIGN KEY (CLIENT_AUDIT_CODE) REFERENCES THE.CLIENT_AUDIT_CODE(CLIENT_AUDIT_CODE); +ALTER TABLE THE.CLI_CON_AUDIT ADD CONSTRAINT CCA_OU_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.CLI_CON_AUDIT ADD CONSTRAINT CCA_OU_IS_UPDATED_BY_FK FOREIGN KEY (UPDATE_ORG_UNIT_NO) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); + +CREATE TABLE THE.CLI_LOCN_AUDIT ( + CLIENT_LOCATION_AUDIT_ID NUMBER(12,0) NOT NULL, + CLIENT_AUDIT_CODE VARCHAR2(3) NOT NULL, + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + CLIENT_LOCN_NAME VARCHAR2(40) NULL, + HDBS_COMPANY_CODE VARCHAR2(5) NULL, + ADDRESS_1 VARCHAR2(40) NOT NULL, + ADDRESS_2 VARCHAR2(40) NULL, + ADDRESS_3 VARCHAR2(40) NULL, + CITY VARCHAR2(30) NOT NULL, + PROVINCE VARCHAR2(50) NULL, + POSTAL_CODE VARCHAR2(10) NULL, + COUNTRY VARCHAR2(50) NOT NULL, + BUSINESS_PHONE VARCHAR2(10) NULL, + HOME_PHONE VARCHAR2(10) NULL, + CELL_PHONE VARCHAR2(10) NULL, + FAX_NUMBER VARCHAR2(10) NULL, + EMAIL_ADDRESS VARCHAR2(128) NULL, + LOCN_EXPIRED_IND VARCHAR2(1) NOT NULL, + RETURNED_MAIL_DATE DATE NULL, + TRUST_LOCATION_IND VARCHAR2(1) NULL, + CLI_LOCN_COMMENT VARCHAR2(4000) NULL, + CLIENT_UPDATE_ACTION_CODE VARCHAR2(4) NULL, + CLIENT_UPDATE_REASON_CODE VARCHAR2(4) NULL, + CLIENT_TYPE_CODE VARCHAR2(1) NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + CONSTRAINT CLA_PK PRIMARY KEY (CLIENT_LOCATION_AUDIT_ID), + CONSTRAINT SYS_C0029886 CHECK ("CLIENT_LOCATION_AUDIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0029887 CHECK ("CLIENT_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029888 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0029889 CHECK ("CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0029890 CHECK ("ADDRESS_1" IS NOT NULL), + CONSTRAINT SYS_C0029891 CHECK ("CITY" IS NOT NULL), + CONSTRAINT SYS_C0029892 CHECK ("COUNTRY" IS NOT NULL), + CONSTRAINT SYS_C0029893 CHECK ("LOCN_EXPIRED_IND" IS NOT NULL), + CONSTRAINT SYS_C0029894 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029895 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029896 CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0029897 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0029898 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0029899 CHECK ("ADD_ORG_UNIT" IS NOT NULL) +); +CREATE INDEX CLA_CARX_FK_I ON THE.CLI_LOCN_AUDIT (CLIENT_UPDATE_ACTION_CODE,CLIENT_UPDATE_REASON_CODE,CLIENT_TYPE_CODE); +CREATE INDEX CLA_CAUDC_FK_I ON THE.CLI_LOCN_AUDIT (CLIENT_AUDIT_CODE); +CREATE INDEX CLA_CL_FK_I ON THE.CLI_LOCN_AUDIT (CLIENT_NUMBER,CLIENT_LOCN_CODE); +CREATE INDEX CLA_OU_FK_I ON THE.CLI_LOCN_AUDIT (UPDATE_ORG_UNIT); +CREATE INDEX CLA_OU_IS_CREATED_BY_FK_I ON THE.CLI_LOCN_AUDIT (ADD_ORG_UNIT); +ALTER TABLE THE.CLI_LOCN_AUDIT ADD CONSTRAINT CLA_CARX_FK FOREIGN KEY (CLIENT_UPDATE_ACTION_CODE,CLIENT_UPDATE_REASON_CODE,CLIENT_TYPE_CODE) REFERENCES THE.CLIENT_ACTION_REASON_XREF(CLIENT_UPDATE_ACTION_CODE,CLIENT_UPDATE_REASON_CODE,CLIENT_TYPE_CODE); +ALTER TABLE THE.CLI_LOCN_AUDIT ADD CONSTRAINT CLA_CAUDC_FK FOREIGN KEY (CLIENT_AUDIT_CODE) REFERENCES THE.CLIENT_AUDIT_CODE(CLIENT_AUDIT_CODE); +ALTER TABLE THE.CLI_LOCN_AUDIT ADD CONSTRAINT CLA_CL_FK FOREIGN KEY (CLIENT_NUMBER,CLIENT_LOCN_CODE) REFERENCES THE.CLIENT_LOCATION(CLIENT_NUMBER,CLIENT_LOCN_CODE); +ALTER TABLE THE.CLI_LOCN_AUDIT ADD CONSTRAINT CLA_OU_FK FOREIGN KEY (UPDATE_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.CLI_LOCN_AUDIT ADD CONSTRAINT CLA_OU_IS_CREATED_BY_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); + +CREATE TABLE THE.RELATED_CLIENT ( + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + RELATED_CLNT_NMBR VARCHAR2(8) NOT NULL, + RELATED_CLNT_LOCN VARCHAR2(2) NOT NULL, + RELATIONSHIP_CODE VARCHAR2(2) NOT NULL, + SIGNING_AUTH_IND VARCHAR2(1) NULL, + PERCENT_OWNERSHIP NUMBER(4,1) NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + REVISION_COUNT NUMBER(5,0) NOT NULL, + CONSTRAINT RCLI_PK PRIMARY KEY (CLIENT_NUMBER,CLIENT_LOCN_CODE,RELATED_CLNT_NMBR,RELATED_CLNT_LOCN), + CONSTRAINT SYS_C0011626 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0011627 CHECK ("CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0011628 CHECK ("RELATED_CLNT_NMBR" IS NOT NULL), + CONSTRAINT SYS_C0011629 CHECK ("RELATED_CLNT_LOCN" IS NOT NULL), + CONSTRAINT SYS_C0011630 CHECK ("RELATIONSHIP_CODE" IS NOT NULL), + CONSTRAINT SYS_C0011631 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0011632 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011633 CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0011634 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0011635 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011636 CHECK ("ADD_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0011637 CHECK ("REVISION_COUNT" IS NOT NULL) +); +CREATE INDEX RC_CL_FK_I ON THE.RELATED_CLIENT (CLIENT_NUMBER,CLIENT_LOCN_CODE); +CREATE INDEX RC_CL_HAS_RELATIONSHIP_FOR_F_I ON THE.RELATED_CLIENT (RELATED_CLNT_NMBR,RELATED_CLNT_LOCN); +CREATE INDEX RC_OU_FK_I ON THE.RELATED_CLIENT (ADD_ORG_UNIT); +CREATE INDEX RC_OU_IS_UPDATED_BY_FK_I ON THE.RELATED_CLIENT (UPDATE_ORG_UNIT); +CREATE INDEX RC_RELCD_FK_I ON THE.RELATED_CLIENT (RELATIONSHIP_CODE); +ALTER TABLE THE.RELATED_CLIENT ADD CONSTRAINT RC_CL_FK FOREIGN KEY (CLIENT_NUMBER,CLIENT_LOCN_CODE) REFERENCES THE.CLIENT_LOCATION(CLIENT_NUMBER,CLIENT_LOCN_CODE); +ALTER TABLE THE.RELATED_CLIENT ADD CONSTRAINT RC_CL_HAS_RELATIONSHIP_FOR_FK FOREIGN KEY (RELATED_CLNT_NMBR,RELATED_CLNT_LOCN) REFERENCES THE.CLIENT_LOCATION(CLIENT_NUMBER,CLIENT_LOCN_CODE); +ALTER TABLE THE.RELATED_CLIENT ADD CONSTRAINT RC_OU_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.RELATED_CLIENT ADD CONSTRAINT RC_OU_IS_UPDATED_BY_FK FOREIGN KEY (UPDATE_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.RELATED_CLIENT ADD CONSTRAINT RC_RELCD_FK FOREIGN KEY (RELATIONSHIP_CODE) REFERENCES THE.CLIENT_RELATIONSHIP_CODE(CLIENT_RELATIONSHIP_CODE); + +CREATE TABLE THE.REL_CLI_AUDIT ( + RELATED_CLIENT_AUDIT_ID NUMBER(12,0) NOT NULL, + CLIENT_AUDIT_CODE VARCHAR2(3) NOT NULL, + CLIENT_NUMBER VARCHAR2(8) NOT NULL, + CLIENT_LOCN_CODE VARCHAR2(2) NOT NULL, + RELATED_CLNT_NMBR VARCHAR2(8) NOT NULL, + RELATED_CLNT_LOCN VARCHAR2(2) NULL, + RELATIONSHIP_CODE VARCHAR2(2) NULL, + SIGNING_AUTH_IND VARCHAR2(1) NULL, + PERCENT_OWNERSHIP NUMBER(4,1) NULL, + UPDATE_TIMESTAMP DATE NOT NULL, + UPDATE_USERID VARCHAR2(30) NOT NULL, + UPDATE_ORG_UNIT NUMBER(10,0) NOT NULL, + ADD_TIMESTAMP DATE NOT NULL, + ADD_USERID VARCHAR2(30) NOT NULL, + ADD_ORG_UNIT NUMBER(10,0) NOT NULL, + CONSTRAINT RCA_PK PRIMARY KEY (RELATED_CLIENT_AUDIT_ID), + CONSTRAINT SYS_C0011541 CHECK ("RELATED_CLIENT_AUDIT_ID" IS NOT NULL), + CONSTRAINT SYS_C0011542 CHECK ("CLIENT_AUDIT_CODE" IS NOT NULL), + CONSTRAINT SYS_C0011543 CHECK ("CLIENT_NUMBER" IS NOT NULL), + CONSTRAINT SYS_C0011544 CHECK ("CLIENT_LOCN_CODE" IS NOT NULL), + CONSTRAINT SYS_C0011545 CHECK ("RELATED_CLNT_NMBR" IS NOT NULL), + CONSTRAINT SYS_C0011546 CHECK ("UPDATE_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0011547 CHECK ("UPDATE_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011548 CHECK ("UPDATE_ORG_UNIT" IS NOT NULL), + CONSTRAINT SYS_C0011549 CHECK ("ADD_TIMESTAMP" IS NOT NULL), + CONSTRAINT SYS_C0011550 CHECK ("ADD_USERID" IS NOT NULL), + CONSTRAINT SYS_C0011551 CHECK ("ADD_ORG_UNIT" IS NOT NULL) +); +CREATE UNIQUE INDEX "I1$_REL_CLI_AUDIT" ON THE.REL_CLI_AUDIT (CLIENT_NUMBER,CLIENT_LOCN_CODE,RELATED_CLNT_NMBR,UPDATE_TIMESTAMP); +CREATE INDEX RCA_CAUDC_FK_I ON THE.REL_CLI_AUDIT (CLIENT_AUDIT_CODE); +CREATE INDEX RCA_CLI_LOCN_I ON THE.REL_CLI_AUDIT (CLIENT_NUMBER,CLIENT_LOCN_CODE); +CREATE INDEX RCA_OU_FK_I ON THE.REL_CLI_AUDIT (ADD_ORG_UNIT); +CREATE INDEX RCA_OU_IS_UPDATED_BY_FK_I ON THE.REL_CLI_AUDIT (UPDATE_ORG_UNIT); +CREATE INDEX RCA_REL_CLI_LOCN_I ON THE.REL_CLI_AUDIT (RELATED_CLNT_NMBR,RELATED_CLNT_LOCN); +ALTER TABLE THE.REL_CLI_AUDIT ADD CONSTRAINT RCA_CAUDC_FK FOREIGN KEY (CLIENT_AUDIT_CODE) REFERENCES THE.CLIENT_AUDIT_CODE(CLIENT_AUDIT_CODE); +ALTER TABLE THE.REL_CLI_AUDIT ADD CONSTRAINT RCA_OU_FK FOREIGN KEY (ADD_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); +ALTER TABLE THE.REL_CLI_AUDIT ADD CONSTRAINT RCA_OU_IS_UPDATED_BY_FK FOREIGN KEY (UPDATE_ORG_UNIT) REFERENCES THE.ORG_UNIT(ORG_UNIT_NO); \ No newline at end of file diff --git a/processor/src/test/resources/db/migration/V2__full_client.sql b/processor/src/test/resources/db/migration/V2__full_client.sql new file mode 100644 index 0000000000..a682208034 --- /dev/null +++ b/processor/src/test/resources/db/migration/V2__full_client.sql @@ -0,0 +1,175 @@ +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('AP','Accounts Payable',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('AR','Accounts Receivable',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BA','First Nations Administrator',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BC','First Nations Council Member',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BL','Billing',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BM','First Nations Manager',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BN','First Nations Treaty Negotiator',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('CH','Chief',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('CL','Collections',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DI','Director',TIMESTAMP'2005-02-17 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('EX','Export',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('GP','General Partner',TIMESTAMP'2006-11-21 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('IL','Interior Log Cost Reporting',TIMESTAMP'2015-04-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('LB','Log Broker',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('LP','Limited Partner',TIMESTAMP'2006-11-21 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('RC','Recreation Agreement Holder',TIMESTAMP'2005-03-21 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('SI','Scale Site Contact',TIMESTAMP'2007-08-02 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('SP','SPAR System Contact',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('SR','Stumpage Rates',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('SS','Scaling Software Vendor Contact',TIMESTAMP'2001-09-12 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('TC','BCTS Contractor',TIMESTAMP'2003-04-16 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('TN','Tenure Administration',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); +INSERT INTO THE.BUSINESS_CONTACT_CODE (BUSINESS_CONTACT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('TP','EDI Trading Partner',TIMESTAMP'2000-07-25 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2016-03-11 09:35:17.0'); + +INSERT INTO THE.CLIENT_AUDIT_CODE (CLIENT_AUDIT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DEL','Delete',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-03-14 14:43:00.0'); +INSERT INTO THE.CLIENT_AUDIT_CODE (CLIENT_AUDIT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('INS','Insert',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-03-14 14:43:00.0'); +INSERT INTO THE.CLIENT_AUDIT_CODE (CLIENT_AUDIT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('UPD','Update',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-03-14 14:43:00.0'); + +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BCDL','British Columbia Drivers Licence',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BCID','British Columbia Identification',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BRTH','Birth Certificate',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('CITZ','Citizenship Card',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('EXDL','Extraprovincial Drivers Licence',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('FNID','First Nation Status ID',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('MILI','Canadian Military ID',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('OTHR','Other Identification',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('PASS','Canadian Passport',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('UNKN','Unknown',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BCEI','BCeID',TIMESTAMP'2023-11-29 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2023-11-29 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BCSC','BC Services Card',TIMESTAMP'2023-11-29 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2023-11-29 13:00:40.0'); +INSERT INTO THE.CLIENT_ID_TYPE_CODE (CLIENT_ID_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BCRE','BC Registry',TIMESTAMP'2023-11-29 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2023-11-29 13:00:40.0'); + + +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('AF','Obsolete - Amalgamated from',TIMESTAMP'2005-09-05 00:00:00.0',TIMESTAMP'2007-03-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('AT','Obsolete - Amalgamated To',TIMESTAMP'2005-09-05 00:00:00.0',TIMESTAMP'2007-03-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('PA','General Partner',TIMESTAMP'2005-09-05 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('AG','Agent',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BR','Broker',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('CL','Corporate Linkage',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DB','Does Business With',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('FA','First Nations Company Affiliation',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('FI','First Nations Member Owned',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('FM','Family Member',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('FO','First Nations Owned',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('FP','First Nations Organizational Association',TIMESTAMP'2007-12-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('JV','Joint Venture Participant',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('OF','Officer',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); +INSERT INTO THE.CLIENT_RELATIONSHIP_CODE (CLIENT_RELATIONSHIP_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('SH','Shareholder',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-10 14:10:14.0'); + +INSERT INTO THE.CLIENT_REORG_AUDIT_CODE (CLIENT_REORG_AUDIT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DEL','Delete',TIMESTAMP'2001-11-19 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:32:25.0'); +INSERT INTO THE.CLIENT_REORG_AUDIT_CODE (CLIENT_REORG_AUDIT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('INS','Insert',TIMESTAMP'2001-11-19 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:32:25.0'); +INSERT INTO THE.CLIENT_REORG_AUDIT_CODE (CLIENT_REORG_AUDIT_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('UPD','Update',TIMESTAMP'2001-11-19 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:32:25.0'); + +INSERT INTO THE.CLIENT_REORG_STATUS_CODE (CLIENT_REORG_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('APP','Approved',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:32:54.0'); +INSERT INTO THE.CLIENT_REORG_STATUS_CODE (CLIENT_REORG_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('CAN','Cancelled',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:32:54.0'); +INSERT INTO THE.CLIENT_REORG_STATUS_CODE (CLIENT_REORG_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('COM','Complete',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:32:54.0'); +INSERT INTO THE.CLIENT_REORG_STATUS_CODE (CLIENT_REORG_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('EXP','Expired',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:32:54.0'); +INSERT INTO THE.CLIENT_REORG_STATUS_CODE (CLIENT_REORG_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('PND','Pending',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:32:54.0'); +INSERT INTO THE.CLIENT_REORG_STATUS_CODE (CLIENT_REORG_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('PRC','Processing',TIMESTAMP'2001-10-22 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:32:54.0'); + +INSERT INTO THE.CLIENT_REORG_TYPE_CODE (CLIENT_REORG_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('ACQU','Acquisition',TIMESTAMP'2006-08-23 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:33:23.0'); +INSERT INTO THE.CLIENT_REORG_TYPE_CODE (CLIENT_REORG_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('AMAL','Amalgamation',TIMESTAMP'2006-08-23 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2006-11-01 08:33:23.0'); + +INSERT INTO THE.CLIENT_STATUS_CODE (CLIENT_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('ACT','Active',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-03-14 14:42:21.0'); +INSERT INTO THE.CLIENT_STATUS_CODE (CLIENT_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DAC','Deactivated',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-03-14 14:42:21.0'); +INSERT INTO THE.CLIENT_STATUS_CODE (CLIENT_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DEC','Deceased',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-03-14 14:42:21.0'); +INSERT INTO THE.CLIENT_STATUS_CODE (CLIENT_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('REC','Receivership',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-03-14 14:42:21.0'); +INSERT INTO THE.CLIENT_STATUS_CODE (CLIENT_STATUS_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('SPN','Suspended',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-03-14 14:42:21.0'); + +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('A','Association',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('B','First Nation Band',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('C','Corporation',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('F','Ministry of Forests and Range',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('G','Government',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('I','Individual',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('L','Limited Partnership',TIMESTAMP'2006-11-21 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('P','General Partnership',TIMESTAMP'2009-03-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('R','First Nation Group',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('S','Society',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('T','First Nation Tribal Council',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); +INSERT INTO THE.CLIENT_TYPE_CODE (CLIENT_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('U','Unregistered Company',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2009-03-17 16:17:35.0'); + +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('A','Extraprovincial Company',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('B','Extraprovincial Company',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BC','British Columbia Company',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('C','Continuation In',TIMESTAMP'2007-08-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('CP','Cooperative Association',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DINA','Federal First Nations ID',TIMESTAMP'2007-10-11 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('EPR','Extraprovincial Company',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('FOR','Extraprovincial Company',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('LIC','Extraprovincial Company',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('NON','Non Registered Company',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('REG','Extraprovincial Company',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('S','British Columbia Society',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('XCP','Extraprovincial Cooperative Association',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('XS','Extraprovincial Society',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2008-02-28 09:50:45.0'); +INSERT INTO THE.REGISTRY_COMPANY_TYPE_CODE (REGISTRY_COMPANY_TYPE_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('FM','Sole Proprietorship',TIMESTAMP'2023-10-10 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2023-10-10 00:00:00.0'); + +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('A','CP','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('A','XCP','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('C','A','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('C','B','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('C','BC','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('C','EPR','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('C','FOR','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('C','LIC','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('C','REG','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('S','S','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('S','XS','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('U','NON','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0','CLIADMIN',TIMESTAMP'2007-01-01 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('C','C','CLIADMIN',TIMESTAMP'2007-08-14 10:29:27.0','CLIADMIN',TIMESTAMP'2007-08-14 10:29:27.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('B','DINA','CLIADMIN',TIMESTAMP'2007-10-16 12:50:08.0','CLIADMIN',TIMESTAMP'2007-10-16 12:50:08.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('T','DINA','CLIADMIN',TIMESTAMP'2007-10-16 12:50:12.0','CLIADMIN',TIMESTAMP'2007-10-16 12:50:12.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('I','FM','CLIADMIN',TIMESTAMP'2023-10-10 00:00:00.0','CLIADMIN',TIMESTAMP'2023-10-10 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('U','FM','CLIADMIN',TIMESTAMP'2023-10-10 00:00:00.0','CLIADMIN',TIMESTAMP'2023-10-10 00:00:00.0'); +INSERT INTO THE.CLIENT_TYPE_COMPANY_XREF (CLIENT_TYPE_CODE,REGISTRY_COMPANY_TYPE_CODE,ADD_USERID,ADD_TIMESTAMP,UPDATE_USERID,UPDATE_TIMESTAMP) VALUES ('P','FM','CLIADMIN',TIMESTAMP'2023-10-10 00:00:00.0','CLIADMIN',TIMESTAMP'2023-10-10 00:00:00.0'); + +INSERT INTO THE.CLIENT_UPDATE_ACTION_CODE (CLIENT_UPDATE_ACTION_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('ACDC','Deceased Client Activated',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:22.0'); +INSERT INTO THE.CLIENT_UPDATE_ACTION_CODE (CLIENT_UPDATE_ACTION_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('ADDR','Address Change',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:22.0'); +INSERT INTO THE.CLIENT_UPDATE_ACTION_CODE (CLIENT_UPDATE_ACTION_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DAC','Deactivated',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:22.0'); +INSERT INTO THE.CLIENT_UPDATE_ACTION_CODE (CLIENT_UPDATE_ACTION_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('ID','ID Change',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:22.0'); +INSERT INTO THE.CLIENT_UPDATE_ACTION_CODE (CLIENT_UPDATE_ACTION_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('NAME','Name Change',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:22.0'); +INSERT INTO THE.CLIENT_UPDATE_ACTION_CODE (CLIENT_UPDATE_ACTION_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('RACT','Reactivated',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:22.0'); +INSERT INTO THE.CLIENT_UPDATE_ACTION_CODE (CLIENT_UPDATE_ACTION_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('SPN','Suspended',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:22.0'); +INSERT INTO THE.CLIENT_UPDATE_ACTION_CODE (CLIENT_UPDATE_ACTION_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('USPN','Unsuspended',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-07-12 13:00:22.0'); + +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('BKR','Bankruptcy',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('CNTI','Continuation In',TIMESTAMP'2007-08-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('CNTO','Continuation Out',TIMESTAMP'2007-08-02 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('CORR','Correction',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DEC','Deceased',TIMESTAMP'2007-08-02 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DIS','Dissolved',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('DUPL','Duplicate Client',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('EXEC','Executor Acting on Behalf of Deceased Client',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('IBKR','Bankruptcy in Progress',TIMESTAMP'2007-07-27 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('IDIS','Dissolution in Progress',TIMESTAMP'2007-07-27 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('IEST','Estate in Progress',TIMESTAMP'2007-07-27 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('IREC','Receivership In Progress',TIMESTAMP'2007-07-27 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('LNAM','Legal Name Change',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('MOVE','Moved',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('NLDB','No Longer Doing Business with MoFR',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('OBLG','Obligation Satisfied',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('REC','Receivership',TIMESTAMP'2007-07-27 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('REID','Replacement ID',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('RORG','Company Reorganization',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('RSPN','Related to a Suspended Client',TIMESTAMP'2007-10-22 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('TEMP','Temporary Process',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('VFIN','Violation - Financial',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); +INSERT INTO THE.CLIENT_UPDATE_REASON_CODE (CLIENT_UPDATE_REASON_CODE,DESCRIPTION,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES ('VTEN','Violation - Tenure',TIMESTAMP'2007-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2007-12-19 09:13:27.0'); + +INSERT INTO THE.MAILING_COUNTRY (COUNTRY_NAME,COUNTRY_CODE) VALUES ('BRAZIL','BR'); +INSERT INTO THE.MAILING_COUNTRY (COUNTRY_NAME,COUNTRY_CODE) VALUES ('CANADA','CA'); +INSERT INTO THE.MAILING_COUNTRY (COUNTRY_NAME,COUNTRY_CODE) VALUES ('COLOMBIA','CO'); +INSERT INTO THE.MAILING_COUNTRY (COUNTRY_NAME,COUNTRY_CODE) VALUES ('USA','US'); + +INSERT INTO THE.MAILING_PROVINCE_STATE (COUNTRY_NAME, PROVINCE_STATE_NAME, PROVINCE_STATE_CODE) VALUES('CANADA', 'British Columbia', 'BC'); +INSERT INTO THE.MAILING_PROVINCE_STATE (COUNTRY_NAME, PROVINCE_STATE_NAME, PROVINCE_STATE_CODE) VALUES('USA', 'Washington', 'WA'); +INSERT INTO THE.MAILING_PROVINCE_STATE (COUNTRY_NAME, PROVINCE_STATE_NAME, PROVINCE_STATE_CODE) VALUES('BRAZIL', 'Sao Paulo', 'SP'); + +INSERT INTO THE.MAILING_CITY (COUNTRY_NAME,PROVINCE_STATE_NAME,CITY_NAME) VALUES ('CANADA','British Columbia','VICTORIA'); +INSERT INTO THE.MAILING_CITY (COUNTRY_NAME,PROVINCE_STATE_NAME,CITY_NAME) VALUES ('USA','Washington','SEATTLE'); +INSERT INTO THE.MAILING_CITY (COUNTRY_NAME,PROVINCE_STATE_NAME,CITY_NAME) VALUES ('BRAZIL','Sao Paulo','CAMPINAS'); + +INSERT INTO THE.ORG_UNIT (ORG_UNIT_NO,ORG_UNIT_CODE,ORG_UNIT_NAME,LOCATION_CODE,AREA_CODE,TELEPHONE_NO,ORG_LEVEL_CODE,OFFICE_NAME_CODE,ROLLUP_REGION_NO,ROLLUP_REGION_CODE,ROLLUP_DIST_NO,ROLLUP_DIST_CODE,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES (1,'DEV','Development Team','010','250','3871701','H','VA',0,' ',0,' ',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2011-08-29 15:49:08.0'); +INSERT INTO THE.ORG_UNIT (ORG_UNIT_NO,ORG_UNIT_CODE,ORG_UNIT_NAME,LOCATION_CODE,AREA_CODE,TELEPHONE_NO,ORG_LEVEL_CODE,OFFICE_NAME_CODE,ROLLUP_REGION_NO,ROLLUP_REGION_CODE,ROLLUP_DIST_NO,ROLLUP_DIST_CODE,EFFECTIVE_DATE,EXPIRY_DATE,UPDATE_TIMESTAMP) VALUES (70,'HVA','Timber Pricing Branch','010','250','3871701','H','VA',0,' ',0,' ',TIMESTAMP'1905-01-01 00:00:00.0',TIMESTAMP'9999-12-31 00:00:00.0',TIMESTAMP'2011-08-29 15:49:08.0'); diff --git a/processor/src/test/resources/db/migration/V3__pre_packages.sql b/processor/src/test/resources/db/migration/V3__pre_packages.sql new file mode 100644 index 0000000000..d4bf1985cf --- /dev/null +++ b/processor/src/test/resources/db/migration/V3__pre_packages.sql @@ -0,0 +1,2 @@ +CREATE SEQUENCE client_dba_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE; +CREATE SEQUENCE client_contact_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE; \ No newline at end of file diff --git a/processor/src/test/resources/db/migration/V4__manual_data.sql b/processor/src/test/resources/db/migration/V4__manual_data.sql new file mode 100644 index 0000000000..0cd93b4c9c --- /dev/null +++ b/processor/src/test/resources/db/migration/V4__manual_data.sql @@ -0,0 +1,118 @@ +INSERT INTO THE.FOREST_CLIENT (CLIENT_NUMBER,CLIENT_NAME,LEGAL_FIRST_NAME,LEGAL_MIDDLE_NAME,CLIENT_STATUS_CODE,CLIENT_TYPE_CODE,BIRTHDATE,CLIENT_ID_TYPE_CODE,CLIENT_IDENTIFICATION,REGISTRY_COMPANY_TYPE_CODE,CORP_REGN_NMBR,CLIENT_ACRONYM,WCB_FIRM_NUMBER,OCG_SUPPLIER_NMBR,CLIENT_COMMENT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,REVISION_COUNT) VALUES +('00000001','BAXTER','JAMES',NULL,'ACT','I',TIMESTAMP'1959-05-18 00:00:00.0','BCDL',NULL,NULL,'00000001',NULL,NULL,NULL,'Il.',TIMESTAMP'1989-11-26 08:52:38.0','CONV',70,TIMESTAMP'1999-02-16 10:40:05.0','JDOH',70,1) ; + +INSERT INTO THE.CLIENT_DOING_BUSINESS_AS (CLIENT_DBA_ID,CLIENT_NUMBER,DOING_BUSINESS_AS_NAME,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,REVISION_COUNT) VALUES +(client_dba_seq.NEXTVAL,'00000001','BAXTER''S FAMILY',TIMESTAMP'2007-04-24 12:21:47.0','IDIR\ITISWATTLES',70,TIMESTAMP'2007-04-24 12:21:47.0','IDIR\ITISWATTLES',70,1); + +INSERT INTO THE.CLIENT_LOCATION (CLIENT_NUMBER,CLIENT_LOCN_CODE,CLIENT_LOCN_NAME,HDBS_COMPANY_CODE,ADDRESS_1,ADDRESS_2,ADDRESS_3,CITY,PROVINCE,POSTAL_CODE,COUNTRY,BUSINESS_PHONE,HOME_PHONE,CELL_PHONE,FAX_NUMBER,EMAIL_ADDRESS,LOCN_EXPIRED_IND,RETURNED_MAIL_DATE,TRUST_LOCATION_IND,CLI_LOCN_COMMENT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,REVISION_COUNT) VALUES +('00000001','00',NULL,'01382','2080 Labieux Rd',NULL,NULL,'NANAIMO','BC','V9T6J9','CANADA',NULL,'8006618773',NULL,NULL,NULL,'N',NULL,'N',NULL,TIMESTAMP'2002-03-22 15:52:03.0','JBAXTER',70,TIMESTAMP'1989-11-26 08:52:09.0','CONV',70,1); + +-- 00000002 Doug Funny, Doing Buseness and Location + +INSERT INTO THE.FOREST_CLIENT (CLIENT_NUMBER,CLIENT_NAME,LEGAL_FIRST_NAME,LEGAL_MIDDLE_NAME,CLIENT_STATUS_CODE,CLIENT_TYPE_CODE,BIRTHDATE,CLIENT_ID_TYPE_CODE,CLIENT_IDENTIFICATION,REGISTRY_COMPANY_TYPE_CODE,CORP_REGN_NMBR,CLIENT_ACRONYM,WCB_FIRM_NUMBER,OCG_SUPPLIER_NMBR,CLIENT_COMMENT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,REVISION_COUNT) VALUES +('00000002','FUNNY','THOMAS','Yansi','ACT','I',TIMESTAMP'1939-07-04 00:00:00.0','BCDL','Wull.',NULL,'00000002',NULL,NULL,NULL,'C v.',TIMESTAMP'1989-11-26 08:52:38.0','CONV',70,TIMESTAMP'2000-08-24 15:59:37.0','PLOUSY',70,1); + +INSERT INTO THE.CLIENT_DOING_BUSINESS_AS (CLIENT_DBA_ID,CLIENT_NUMBER,DOING_BUSINESS_AS_NAME,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,REVISION_COUNT) VALUES +(client_dba_seq.NEXTVAL,'00000002','DOUG FUNNY',TIMESTAMP'2007-04-24 12:21:47.0','IDIR\ITISWATTLES',70,TIMESTAMP'2007-04-24 12:21:47.0','IDIR\ITISWATTLES',70,1); + +INSERT INTO THE.CLIENT_LOCATION (CLIENT_NUMBER,CLIENT_LOCN_CODE,CLIENT_LOCN_NAME,HDBS_COMPANY_CODE,ADDRESS_1,ADDRESS_2,ADDRESS_3,CITY,PROVINCE,POSTAL_CODE,COUNTRY,BUSINESS_PHONE,HOME_PHONE,CELL_PHONE,FAX_NUMBER,EMAIL_ADDRESS,LOCN_EXPIRED_IND,RETURNED_MAIL_DATE,TRUST_LOCATION_IND,CLI_LOCN_COMMENT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,REVISION_COUNT) VALUES +('00000002','00',NULL,'01384','Government St','Floor 2',NULL,'VICTORIA','BC','V8V2L8','CANADA',NULL,NULL,NULL,NULL,NULL,'N',NULL,'N',NULL,TIMESTAMP'1991-11-20 13:15:01.0','JBAXTER',70,TIMESTAMP'1989-11-26 08:52:09.0','CONV',70,1); + +-- 00000003 Boris and Boris, Doing Business and Location + +INSERT INTO THE.FOREST_CLIENT (CLIENT_NUMBER,CLIENT_NAME,LEGAL_FIRST_NAME,LEGAL_MIDDLE_NAME,CLIENT_STATUS_CODE,CLIENT_TYPE_CODE,BIRTHDATE,CLIENT_ID_TYPE_CODE,CLIENT_IDENTIFICATION,REGISTRY_COMPANY_TYPE_CODE,CORP_REGN_NMBR,CLIENT_ACRONYM,WCB_FIRM_NUMBER,OCG_SUPPLIER_NMBR,CLIENT_COMMENT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,REVISION_COUNT) VALUES +('00000003','BORIS AND BORIS INC.',NULL,NULL,'ACT','C',NULL,'BCDL',NULL,NULL,'00000003',NULL,NULL,NULL,NULL,TIMESTAMP'1989-11-26 08:52:38.0','CONV',70,TIMESTAMP'1989-11-26 08:52:38.0','CLIENT_REWRITE_CONV',70,1); + +INSERT INTO THE.CLIENT_DOING_BUSINESS_AS (CLIENT_DBA_ID,CLIENT_NUMBER,DOING_BUSINESS_AS_NAME,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,REVISION_COUNT) VALUES +(client_dba_seq.NEXTVAL,'00000003','BORIS AND BORIS INC.',TIMESTAMP'2007-04-24 12:21:47.0','IDIR\ITISWATTLES',70,TIMESTAMP'2007-04-24 12:21:47.0','IDIR\ITISWATTLES',70,1); + +INSERT INTO THE.CLIENT_LOCATION (CLIENT_NUMBER,CLIENT_LOCN_CODE,CLIENT_LOCN_NAME,HDBS_COMPANY_CODE,ADDRESS_1,ADDRESS_2,ADDRESS_3,CITY,PROVINCE,POSTAL_CODE,COUNTRY,BUSINESS_PHONE,HOME_PHONE,CELL_PHONE,FAX_NUMBER,EMAIL_ADDRESS,LOCN_EXPIRED_IND,RETURNED_MAIL_DATE,TRUST_LOCATION_IND,CLI_LOCN_COMMENT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,REVISION_COUNT) VALUES +('00000003','00',NULL,'01385','1950 Douglas St',NULL,NULL,'VICTORIA','BC','V8W1Z2','CANADA',NULL,NULL,NULL,NULL,NULL,'N',NULL,'N',NULL,TIMESTAMP'1999-05-04 09:30:11.0','JBAXTER',70,TIMESTAMP'1989-11-26 08:52:09.0','CONV',70,1); + +-- 00000004 Indian Band, Multiple Locations + +INSERT INTO THE.FOREST_CLIENT (CLIENT_NUMBER,CLIENT_NAME,LEGAL_FIRST_NAME,LEGAL_MIDDLE_NAME,CLIENT_STATUS_CODE,CLIENT_TYPE_CODE,BIRTHDATE,CLIENT_ID_TYPE_CODE,CLIENT_IDENTIFICATION,REGISTRY_COMPANY_TYPE_CODE,CORP_REGN_NMBR,CLIENT_ACRONYM,WCB_FIRM_NUMBER,OCG_SUPPLIER_NMBR,CLIENT_COMMENT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,REVISION_COUNT) VALUES +('00000004','SAMPLE INDIAN BAND COUNCIL',NULL,NULL,'ACT','B',NULL,NULL,NULL,'DINA','684','SAMPLIBC',236967,NULL,NULL,TIMESTAMP'1989-11-26 08:52:38.0','CONV',70,TIMESTAMP'1989-11-26 08:52:38.0','IDIR\ITISWATTLES',70,1); + +INSERT INTO THE.CLIENT_LOCATION (CLIENT_NUMBER,CLIENT_LOCN_CODE,CLIENT_LOCN_NAME,HDBS_COMPANY_CODE,ADDRESS_1,ADDRESS_2,ADDRESS_3,CITY,PROVINCE,POSTAL_CODE,COUNTRY,BUSINESS_PHONE,HOME_PHONE,CELL_PHONE,FAX_NUMBER,EMAIL_ADDRESS,LOCN_EXPIRED_IND,RETURNED_MAIL_DATE,TRUST_LOCATION_IND,CLI_LOCN_COMMENT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,REVISION_COUNT) VALUES +('00000004','00',NULL,'26573','PO BOX 999',NULL,NULL,'VICTORIA','BC','V8W1M0','CANADA',NULL,'2502502550',NULL,'2502502550',NULL,'N',NULL,'N',NULL,TIMESTAMP'2002-03-05 10:01:05.0','JBAXTER',70,TIMESTAMP'1989-11-26 12:20:50.0','CONV',70,1); +INSERT INTO THE.CLIENT_LOCATION (CLIENT_NUMBER,CLIENT_LOCN_CODE,CLIENT_LOCN_NAME,HDBS_COMPANY_CODE,ADDRESS_1,ADDRESS_2,ADDRESS_3,CITY,PROVINCE,POSTAL_CODE,COUNTRY,BUSINESS_PHONE,HOME_PHONE,CELL_PHONE,FAX_NUMBER,EMAIL_ADDRESS,LOCN_EXPIRED_IND,RETURNED_MAIL_DATE,TRUST_LOCATION_IND,CLI_LOCN_COMMENT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,REVISION_COUNT) VALUES +('00000004','01','BAND OFFICE','D3475','INDIAN BAND','916-1150 MAINLAND ST',NULL,'VANCOUVER','BC','V6B2T4','CANADA','2505205200',NULL,NULL,'2505205200',NULL,'N',NULL,'N','THIS LOCATION IS ONLY FOR THE AGREEMENT SIGNAGE',TIMESTAMP'2006-04-03 15:01:44.0','itiswattles',70,TIMESTAMP'2001-01-25 14:08:42.0','ITISWATTLES',70,1); +INSERT INTO THE.CLIENT_LOCATION (CLIENT_NUMBER,CLIENT_LOCN_CODE,CLIENT_LOCN_NAME,HDBS_COMPANY_CODE,ADDRESS_1,ADDRESS_2,ADDRESS_3,CITY,PROVINCE,POSTAL_CODE,COUNTRY,BUSINESS_PHONE,HOME_PHONE,CELL_PHONE,FAX_NUMBER,EMAIL_ADDRESS,LOCN_EXPIRED_IND,RETURNED_MAIL_DATE,TRUST_LOCATION_IND,CLI_LOCN_COMMENT,UPDATE_TIMESTAMP,UPDATE_USERID,UPDATE_ORG_UNIT,ADD_TIMESTAMP,ADD_USERID,ADD_ORG_UNIT,REVISION_COUNT) VALUES +('00000004','02','TRUST ACCOUNT -RSI','T1350','PO BOX 588',NULL,NULL,'CHASE','BC','V0E1M0','CANADA',NULL,'2502502550',NULL,'2502502550',NULL,'Y',NULL,'Y','TRUST ACCOUNT - RSI',TIMESTAMP'2005-10-06 15:02:02.0','NEGELY',70,TIMESTAMP'9999-12-31 00:00:00.0','CONVSNT',70,1); + +-- 00000005 Erna Krakowsky + +INSERT INTO THE.FOREST_CLIENT +(CLIENT_NUMBER, CLIENT_NAME, LEGAL_FIRST_NAME, LEGAL_MIDDLE_NAME, CLIENT_STATUS_CODE, CLIENT_TYPE_CODE, BIRTHDATE, CLIENT_ID_TYPE_CODE, CLIENT_IDENTIFICATION, REGISTRY_COMPANY_TYPE_CODE, CORP_REGN_NMBR, CLIENT_ACRONYM, WCB_FIRM_NUMBER, OCG_SUPPLIER_NMBR, CLIENT_COMMENT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, REVISION_COUNT) +VALUES('00000005', 'KRAKOWSKY', 'ERNA', NULL, 'ACT', 'I', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TIMESTAMP '1989-11-26 08:52:38.000000', 'CONV', 70, TIMESTAMP '1989-11-26 08:52:38.000000', 'IDIR\ITISWATTLES', 70, 1); + +-- 00000006 Indian Canada, Doing Business, Multiple Locations, Org Unit, Contact + +INSERT INTO "THE"."FOREST_CLIENT" +(CLIENT_NUMBER, CLIENT_NAME, LEGAL_FIRST_NAME, LEGAL_MIDDLE_NAME, CLIENT_STATUS_CODE, CLIENT_TYPE_CODE, BIRTHDATE, CLIENT_ID_TYPE_CODE, CLIENT_IDENTIFICATION, REGISTRY_COMPANY_TYPE_CODE, CORP_REGN_NMBR, CLIENT_ACRONYM, WCB_FIRM_NUMBER, OCG_SUPPLIER_NMBR, CLIENT_COMMENT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, REVISION_COUNT) +VALUES('00000006', 'INDIAN CANADA', NULL, NULL, 'ACT', 'G', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TIMESTAMP '1989-11-26 08:54:15.000000', 'CONV', 70, TIMESTAMP '2001-09-28 11:04:30.000000', 'IDIR\ITISWATTLES', 70, 1); + +INSERT INTO "THE"."CLIENT_LOCATION" +(CLIENT_NUMBER, CLIENT_LOCN_CODE, CLIENT_LOCN_NAME, HDBS_COMPANY_CODE, ADDRESS_1, ADDRESS_2, ADDRESS_3, CITY, PROVINCE, POSTAL_CODE, COUNTRY, BUSINESS_PHONE, HOME_PHONE, CELL_PHONE, FAX_NUMBER, EMAIL_ADDRESS, LOCN_EXPIRED_IND, RETURNED_MAIL_DATE, TRUST_LOCATION_IND, CLI_LOCN_COMMENT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, REVISION_COUNT) +VALUES('00000006', '00', 'MAILING ADDRESS', '04106', '300 - 1550 ALBERNI STREET', NULL, NULL, 'VANCOUVER', 'BC', 'V6G3C5', 'CANADA', NULL, NULL, NULL, NULL, NULL, 'N', NULL, 'N', NULL, TIMESTAMP '1990-06-20 10:51:17.000000', 'IDIR\ITISWATTLES', 70, TIMESTAMP '1989-11-26 08:54:15.000000', 'IDIR\ITISWATTLES', 70, 1); +INSERT INTO "THE"."CLIENT_LOCATION" +(CLIENT_NUMBER, CLIENT_LOCN_CODE, CLIENT_LOCN_NAME, HDBS_COMPANY_CODE, ADDRESS_1, ADDRESS_2, ADDRESS_3, CITY, PROVINCE, POSTAL_CODE, COUNTRY, BUSINESS_PHONE, HOME_PHONE, CELL_PHONE, FAX_NUMBER, EMAIL_ADDRESS, LOCN_EXPIRED_IND, RETURNED_MAIL_DATE, TRUST_LOCATION_IND, CLI_LOCN_COMMENT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, REVISION_COUNT) +VALUES('00000006', '01', 'TERRACE/LAKALZAP BAND', '05050', '600 1138 MELVILLE ST', NULL, NULL, 'VANCOUVER', 'BC', 'V6E4S3', 'CANADA', '6046666755', NULL, NULL, NULL, NULL, 'N', NULL, 'N', NULL, TIMESTAMP '2001-04-25 13:47:53.000000', 'IDIR\ITISWATTLES', 70, TIMESTAMP '1990-08-27 13:25:25.000000', 'IDIR\ITISWATTLES', 70, 1); +INSERT INTO "THE"."CLIENT_LOCATION" +(CLIENT_NUMBER, CLIENT_LOCN_CODE, CLIENT_LOCN_NAME, HDBS_COMPANY_CODE, ADDRESS_1, ADDRESS_2, ADDRESS_3, CITY, PROVINCE, POSTAL_CODE, COUNTRY, BUSINESS_PHONE, HOME_PHONE, CELL_PHONE, FAX_NUMBER, EMAIL_ADDRESS, LOCN_EXPIRED_IND, RETURNED_MAIL_DATE, TRUST_LOCATION_IND, CLI_LOCN_COMMENT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, REVISION_COUNT) +VALUES('00000006', '02', NULL, '05893', '209 280 VICTORIA STREET', NULL, NULL, 'PRINCE GEORGE', 'BC', 'V2L4X3', 'CANADA', '2505615121', NULL, NULL, NULL, NULL, 'N', NULL, 'N', NULL, TIMESTAMP '1999-03-24 15:00:18.000000', 'IDIR\ITISWATTLES', 70, TIMESTAMP '1990-08-27 13:26:46.000000', 'IDIR\ITISWATTLES', 70, 1); +INSERT INTO "THE"."CLIENT_LOCATION" +(CLIENT_NUMBER, CLIENT_LOCN_CODE, CLIENT_LOCN_NAME, HDBS_COMPANY_CODE, ADDRESS_1, ADDRESS_2, ADDRESS_3, CITY, PROVINCE, POSTAL_CODE, COUNTRY, BUSINESS_PHONE, HOME_PHONE, CELL_PHONE, FAX_NUMBER, EMAIL_ADDRESS, LOCN_EXPIRED_IND, RETURNED_MAIL_DATE, TRUST_LOCATION_IND, CLI_LOCN_COMMENT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, REVISION_COUNT) +VALUES('00000006', '03', 'SHUSWAP BAND OFFICE', '06901', 'SHUSWAP BAND OFFICE', 'PO BOX 790', NULL, 'INVERMERE', 'BC', 'V0A1K0', 'CANADA', NULL, NULL, NULL, NULL, NULL, 'N', NULL, 'N', NULL, TIMESTAMP '1999-03-24 15:00:34.000000', 'IDIR\ITISWATTLES', 70, TIMESTAMP '1990-08-27 13:27:57.000000', 'IDIR\ITISWATTLES', 70, 1); + +INSERT INTO "THE"."CLIENT_CONTACT" +(CLIENT_CONTACT_ID, CLIENT_NUMBER, CLIENT_LOCN_CODE, BUS_CONTACT_CODE, CONTACT_NAME, BUSINESS_PHONE, CELL_PHONE, FAX_NUMBER, EMAIL_ADDRESS, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, REVISION_COUNT) +VALUES(client_dba_seq.NEXTVAL, '00000006', '00', 'BL', 'JASON MOMOA', '6046666755', NULL, NULL, NULL, TIMESTAMP '1993-03-26 17:40:15.000000', 'IDIR\ITISWATTLES', 1, TIMESTAMP '1993-03-26 17:40:15.000000', 'IDIR\ITISWATTLES', 1, 1); +INSERT INTO "THE"."CLIENT_CONTACT" +(CLIENT_CONTACT_ID, CLIENT_NUMBER, CLIENT_LOCN_CODE, BUS_CONTACT_CODE, CONTACT_NAME, BUSINESS_PHONE, CELL_PHONE, FAX_NUMBER, EMAIL_ADDRESS, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, REVISION_COUNT) +VALUES(client_dba_seq.NEXTVAL, '00000006', '00', 'TN', 'NEDAD KONTIC', '6046666755', NULL, NULL, NULL, TIMESTAMP '1993-03-26 17:37:29.000000', 'IDIR\ITISWATTLES', 1, TIMESTAMP '1993-03-26 17:37:29.000000', 'IDIR\ITISWATTLES', 1, 1); + +-- 00000007 James Bond + +INSERT INTO THE.FOREST_CLIENT +(CLIENT_NUMBER, CLIENT_NAME, LEGAL_FIRST_NAME, LEGAL_MIDDLE_NAME, CLIENT_STATUS_CODE, CLIENT_TYPE_CODE, BIRTHDATE, CLIENT_ID_TYPE_CODE, CLIENT_IDENTIFICATION, REGISTRY_COMPANY_TYPE_CODE, CORP_REGN_NMBR, CLIENT_ACRONYM, WCB_FIRM_NUMBER, OCG_SUPPLIER_NMBR, CLIENT_COMMENT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, REVISION_COUNT) +VALUES('00000007', 'bond', 'james', 'bond', 'ACT', 'I', TIMESTAMP '1939-07-04 00:00:00.000000', 'BCDL', 'Wull.', NULL, '00000002', NULL, NULL, NULL, 'C v.', TIMESTAMP '1989-11-26 08:52:38.000000', 'CONV', 70, TIMESTAMP '2000-08-24 15:59:37.000000', 'PLOUSY', 70, 1); + +-- 00000008 James Hunt HUnt + +INSERT INTO THE.FOREST_CLIENT +(CLIENT_NUMBER, CLIENT_NAME, LEGAL_FIRST_NAME, LEGAL_MIDDLE_NAME, CLIENT_STATUS_CODE, CLIENT_TYPE_CODE, BIRTHDATE, CLIENT_ID_TYPE_CODE, CLIENT_IDENTIFICATION, REGISTRY_COMPANY_TYPE_CODE, CORP_REGN_NMBR, CLIENT_ACRONYM, WCB_FIRM_NUMBER, OCG_SUPPLIER_NMBR, CLIENT_COMMENT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, REVISION_COUNT) +VALUES('00000008', 'hunt', 'james', 'hunt', 'ACT', 'I', NULL, NULL, NULL, NULL, NULL, 'jhunt', NULL, NULL, NULL, TIMESTAMP '1989-11-26 08:52:38.000000', 'CONV', 70, TIMESTAMP '1989-11-26 08:52:38.000000', 'IDIR\ITISWATTLES', 70, 1); + +-- 00000009 James Hunt + +INSERT INTO THE.FOREST_CLIENT +(CLIENT_NUMBER, CLIENT_NAME, LEGAL_FIRST_NAME, LEGAL_MIDDLE_NAME, CLIENT_STATUS_CODE, CLIENT_TYPE_CODE, BIRTHDATE, CLIENT_ID_TYPE_CODE, CLIENT_IDENTIFICATION, REGISTRY_COMPANY_TYPE_CODE, CORP_REGN_NMBR, CLIENT_ACRONYM, WCB_FIRM_NUMBER, OCG_SUPPLIER_NMBR, CLIENT_COMMENT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, REVISION_COUNT) +VALUES('00000009', 'james', NULL, 'hunt', 'ACT', 'I', NULL, NULL, NULL, NULL, NULL, 'hunterj', NULL, NULL, NULL, TIMESTAMP '1989-11-26 08:52:38.000000', 'CONV', 70, TIMESTAMP '1989-11-26 08:52:38.000000', 'IDIR\ITISWATTLES', 70, 1); + +-- 00000010 Jjamess Bbondd + +INSERT INTO THE.FOREST_CLIENT +(CLIENT_NUMBER, CLIENT_NAME, LEGAL_FIRST_NAME, LEGAL_MIDDLE_NAME, CLIENT_STATUS_CODE, CLIENT_TYPE_CODE, BIRTHDATE, CLIENT_ID_TYPE_CODE, CLIENT_IDENTIFICATION, REGISTRY_COMPANY_TYPE_CODE, CORP_REGN_NMBR, CLIENT_ACRONYM, WCB_FIRM_NUMBER, OCG_SUPPLIER_NMBR, CLIENT_COMMENT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, REVISION_COUNT) +VALUES('00000010', 'bbondd', 'jjamess', 'bbondd', 'ACT', 'A', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TIMESTAMP '1989-11-26 08:52:38.000000', 'CONV', 70, TIMESTAMP '1989-11-26 08:52:38.000000', 'IDIR\ITISWATTLES', 70, 1); + +-- 00000011 CORP. OF THE CITY OF VICTORIA + +INSERT INTO THE.FOREST_CLIENT +(CLIENT_NUMBER, CLIENT_NAME, LEGAL_FIRST_NAME, LEGAL_MIDDLE_NAME, CLIENT_STATUS_CODE, CLIENT_TYPE_CODE, BIRTHDATE, CLIENT_ID_TYPE_CODE, CLIENT_IDENTIFICATION, REGISTRY_COMPANY_TYPE_CODE, CORP_REGN_NMBR, CLIENT_ACRONYM, WCB_FIRM_NUMBER, OCG_SUPPLIER_NMBR, CLIENT_COMMENT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, REVISION_COUNT) +VALUES('00000011', 'CORP. OF THE CITY OF VICTORIA', NULL, NULL, 'ACT', 'G', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TIMESTAMP '1989-11-26 08:52:38.000000', 'CONV', 70, TIMESTAMP '1989-11-26 08:52:38.000000', 'IDIR\ITISWATTLES', 70, 1); + +-- 00000012 Sampler FOREST PRODUCTS INC + +INSERT INTO THE.FOREST_CLIENT +(CLIENT_NUMBER, CLIENT_NAME, LEGAL_FIRST_NAME, LEGAL_MIDDLE_NAME, CLIENT_STATUS_CODE, CLIENT_TYPE_CODE, BIRTHDATE, CLIENT_ID_TYPE_CODE, CLIENT_IDENTIFICATION, REGISTRY_COMPANY_TYPE_CODE, CORP_REGN_NMBR, CLIENT_ACRONYM, WCB_FIRM_NUMBER, OCG_SUPPLIER_NMBR, CLIENT_COMMENT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, REVISION_COUNT) +VALUES('00000012', 'SAMPLER FOREST PRODUCTS INC.', NULL, NULL, 'ACT', 'U',NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,TIMESTAMP '1989-11-26 08:52:38.000000', 'CONV', 70, TIMESTAMP '1989-11-26 08:52:38.000000', 'IDIR\ITISWATTLES', 70, 1); + +-- 00000013 DOREEN FOREST PRODUCTS LTD + +INSERT INTO THE.FOREST_CLIENT +(CLIENT_NUMBER, CLIENT_NAME, LEGAL_FIRST_NAME, LEGAL_MIDDLE_NAME, CLIENT_STATUS_CODE, CLIENT_TYPE_CODE, BIRTHDATE, CLIENT_ID_TYPE_CODE, CLIENT_IDENTIFICATION, REGISTRY_COMPANY_TYPE_CODE, CORP_REGN_NMBR, CLIENT_ACRONYM, WCB_FIRM_NUMBER, OCG_SUPPLIER_NMBR, CLIENT_COMMENT, ADD_TIMESTAMP, ADD_USERID, ADD_ORG_UNIT, UPDATE_TIMESTAMP, UPDATE_USERID, UPDATE_ORG_UNIT, REVISION_COUNT) +VALUES('00000013', 'DOREEN FOREST PRODUCTS LTD.', NULL, NULL, 'ACT', 'C', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,TIMESTAMP '1989-11-26 08:52:38.000000', 'CONV', 70, TIMESTAMP '1989-11-26 08:52:38.000000', 'IDIR\ITISWATTLES', 70, 1); + +UPDATE max_client_nmbr SET client_number = (SELECT LPAD(TO_NUMBER(NVL(max(CLIENT_NUMBER),'0'))+1,8,'0') FROM FOREST_CLIENT); \ No newline at end of file diff --git a/processor/src/test/resources/init_pg.sql b/processor/src/test/resources/init_pg.sql index 6b1ea11e10..7387cde09b 100644 --- a/processor/src/test/resources/init_pg.sql +++ b/processor/src/test/resources/init_pg.sql @@ -19,6 +19,7 @@ drop table if exists nrfc.province_code; drop table if exists nrfc.country_code; drop table if exists nrfc.contact_type_code; drop table if exists nrfc.business_type_code; +drop table if exists nrfc.email_log; drop sequence if exists nrfc.submission_id_seq; drop sequence if exists nrfc.submission_detail_id_seq; @@ -27,6 +28,7 @@ drop sequence if exists nrfc.submission_location_seq; drop sequence if exists nrfc.submission_location_contact_seq;--Legacy sequence drop sequence if exists nrfc.submission_contact_seq; drop sequence if exists nrfc.submission_submitter_seq; +drop sequence if exists nrfc.email_log_id_seq; --- create schema if not exists nrfc; @@ -322,6 +324,24 @@ comment on table nrfc.submission_location_contact_xref is 'Identifies the multip comment on column nrfc.submission_location_contact_xref.submission_location_id is 'Incremental id generated for a location of a client.'; comment on column nrfc.submission_location_contact_xref.submission_contact_id is 'Incremental id generated for the contact details of a client.'; +create table if not exists nrfc.email_log ( + email_log_id integer not null, + email_id varchar(40) null, + email_sent_ind varchar(1) null, + exception_message text null, + template_name varchar(40) not null, + email_address varchar(100) not null, + email_subject varchar(40) not null, + email_variables JSONB null, + create_timestamp timestamp default current_timestamp not null, + update_timestamp timestamp default current_timestamp, + constraint email_log_id_pk primary key (email_log_id) +); + +comment on table nrfc.email_log is 'TODO'; +comment on column nrfc.email_log.email_log_id is 'Incremental id generated for a submission email log.'; +-- TODO: Complete comments + -- -- SEQUENCES -- @@ -340,6 +360,9 @@ alter table nrfc.submission_location alter column submission_location_id set def create sequence if not exists nrfc.submission_contact_seq start 1; alter table nrfc.submission_contact alter column submission_contact_id set default nextval('nrfc.submission_contact_seq'); + +create sequence if not exists nrfc.email_log_id_seq start 1; +alter table nrfc.email_log alter column email_log_id set default nextval('nrfc.email_log_id_seq'); -- -- INSERT STATIC DATA -- Note: We have created draft scripts for the onboarding flow, but these are subject to change pending feedback from the UX team. Once we receive their confirmation, we can finalize the scripts and move forward with the final version.