Skip to content

Tombstone Pipeline - Update Active Officers #30242

Closed

Description

@doug-lovett

PROD existing migrated COLIN corps update the active officers.

  • Match on the corp numbers in the colin_extract.corp_processing table.
  • Track officer updates in a new table named mig_corp_processing_history with the officer_migrated and officer_migrated_ts columns.
  • From Thor only the active officers need to migrate for the summary report.
  • Delete existing officer records that use the offices_held table.
  • Create officer records where party_roles.party_class_type = 'OFFICER'. and party_roles.role is the offices_held.officer_typ_cd.

DEV corp numbers updated:
BC0701238
BC0754828
BC0803588
BC0934777
BC0934782
BC1105588
BC1196188
BC1201211
BC1246637
BC1249698
BC1395304

TEST corp numbers updated:

Activity

  1. self-assigned this
    on Aug 18, 2025
  2. added
    Entities - Data Migration
    on Aug 18, 2025
  3. vishnup0422 commented on Aug 19, 2025

    @vishnup0422
    Collaborator

    Hello @doug-lovett,
    Can you please provide the Testing Instructions (Steps , Env details or other details related to verifications )

    Thanks

  4. doug-lovett commented on Aug 19, 2025

    @doug-lovett
    CollaboratorAuthor

    Hello @vishnup0422
    There are 2 options here:

    1. Compare database values between the GCP DEV business database and the PROD colin database for one of the above corp numbers. Active officer data is stored in the business party_roles, parties, and addresses data. Active means currently active - has not been removed. The corresponding colin tables are corp_party, offices_held, and address table where the corp_party.end_event_id is null.
    2. Wait for the GCP DEV update to the corp summary report to include officers and compare the GCP DEV report with PROD colin summary report for one of the above corp numbers.
  5. vishnup0422 commented on Aug 20, 2025

    @vishnup0422
    Collaborator

    QA Validations : Comparing Colin DB and GCP DEV

    Compare the active officer data between the two databases:

    GCP DEV (database) → check the tables:
    party_roles
    parties
    addresses

    PROD (colin database) → check the tables:
    corp_party
    offices_held
    address

    For the comparison, only include active officers:
    In business DB: “active” means the officer record is currently active (not removed).
    In colin DB: “active” means records where corp_party.end_event_id IS NULL.

    Querying COLIN DB

    SELECT 
        cp.corp_num,
        cp.first_name,
        cp.middle_name,
        cp.last_name,
        cp.business_name,
        oh.officer_typ_cd,
        cp.email_address,
        cp.phone,
        a.addr_line_1,
        a.addr_line_2,
        a.city,
        a.province,
        a.postal_cd,
        a.country_typ_cd
    FROM corp_party cp
    JOIN offices_held oh ON cp.corp_party_id = oh.corp_party_id
    LEFT JOIN address a 
           ON cp.mailing_addr_id = a.addr_id 
           OR cp.delivery_addr_id = a.addr_id
    WHERE cp.corp_num = 'BC1249698'
      AND cp.end_event_id IS NULL;
    

    image.png

    Now GCP DEV

    -- Active officers for one corp in the GCP DEV "business" database
    SELECT
      b.identifier                           AS corp_num,            -- e.g., 'BC0934777'
      pr.role                                AS officer_typ_cd,      -- officer role
      p.first_name,
      p.middle_initial AS middle_name,
      p.last_name,
      p.organization_name                    AS business_name,
      p.email,
    
      -- Mailing address (from parties.mailing_address_id)
      ma.street                              AS mailing_street,
      ma.street_additional                   AS mailing_street_additional,
      ma.city                                AS mailing_city,
      ma.region                              AS mailing_region,
      ma.postal_code                         AS mailing_postal_code,
      ma.country                             AS mailing_country,
    
      -- Delivery address (from parties.delivery_address_id)
      da.street                              AS delivery_street,
      da.street_additional                   AS delivery_street_additional,
      da.city                                AS delivery_city,
      da.region                              AS delivery_region,
      da.postal_code                         AS delivery_postal_code,
      da.country                             AS delivery_country
    
    FROM party_roles  pr
    JOIN parties      p  ON pr.party_id = p.id
    JOIN businesses   b  ON pr.business_id = b.id         -- holds the corp identifier
    LEFT JOIN addresses ma ON p.mailing_address_id  = ma.id
    LEFT JOIN addresses da ON p.delivery_address_id = da.id
    WHERE b.identifier = 'BC1249698'                      -- or 'BC0934782'
      AND pr.cessation_date IS NULL;                      -- ACTIVE in business DB
     
    

    image.png

    image.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Entities - Data Migration

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions