The canonical data product for the Digital Core domain, copied unchanged from the blog repository's products/canonical-party (generated by /agent-product from data_model/data_products/canonical.md, 65 of 65 checks on the blog's stack on 2026-09-09). The next commit adapts it to the domain platform. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
69 lines
5.3 KiB
SQL
69 lines
5.3 KiB
SQL
-- Canonical Party: sample rows (runs on the postgres service).
|
|
--
|
|
-- Fixed uuids so child rows can reference their parents and so the same rows can be published
|
|
-- to the inbound topics or queried through GraphQL in examples. The second uuid group numbers
|
|
-- the table (0001 party, 0002 address, 0003 party_role, 0004 contact_address, 0005
|
|
-- party_role_contact_address, 0006 party_association); subtype rows reuse their parent's id.
|
|
|
|
INSERT INTO canonical_party.party
|
|
(party_id, party_type, legal_name, also_known_as, party_status)
|
|
VALUES
|
|
('7d1e5a2c-0001-4a7b-9c11-000000000001', 'Person', 'Alice Margaret Ng', 'Alice Ng', 'Active'),
|
|
('7d1e5a2c-0001-4a7b-9c11-000000000002', 'Person', 'Rangi Parata', NULL, 'Active'),
|
|
('7d1e5a2c-0001-4a7b-9c11-000000000003', 'Company', 'Kowhai Trading Limited', 'Kowhai Trading; KTL', 'Active'),
|
|
('7d1e5a2c-0001-4a7b-9c11-000000000004', 'Company', 'Harbour Logistics Pty Ltd', 'Harbour Logistics', 'Prospect');
|
|
|
|
INSERT INTO canonical_party.address
|
|
(address_id, address_type, address_line_1, address_line_2, suburb, city, state_or_region, postcode, country)
|
|
VALUES
|
|
('7d1e5a2c-0002-4a7b-9c11-000000000001', 'Street Address', '1 Queen Street', NULL, 'Auckland Central', 'Auckland', 'Auckland', '1010', 'NZ'),
|
|
('7d1e5a2c-0002-4a7b-9c11-000000000002', 'PO Box', 'PO Box 123', NULL, NULL, 'Wellington', 'Wellington', '6140', 'NZ'),
|
|
('7d1e5a2c-0002-4a7b-9c11-000000000003', 'Registered Office', 'Level 5, 100 Collins Street', NULL, NULL, 'Melbourne', 'VIC', '3000', 'AU');
|
|
|
|
INSERT INTO canonical_party.person
|
|
(person_id, date_of_birth, preferred_name, country_of_residence)
|
|
VALUES
|
|
('7d1e5a2c-0001-4a7b-9c11-000000000001', '1985-03-14', 'Alice', 'NZ'),
|
|
('7d1e5a2c-0001-4a7b-9c11-000000000002', '1990-11-02', 'Rangi', 'NZ');
|
|
|
|
INSERT INTO canonical_party.company
|
|
(company_id, company_registration_number, incorporation_country, incorporation_date, legal_structure, tax_identifier)
|
|
VALUES
|
|
('7d1e5a2c-0001-4a7b-9c11-000000000003', '9429041234567', 'NZ', '2012-07-01', 'Private Company', '123-456-789'),
|
|
('7d1e5a2c-0001-4a7b-9c11-000000000004', '123456789', 'AU', '2005-03-15', 'Private Company', '51 824 753 556');
|
|
|
|
INSERT INTO canonical_party.party_role
|
|
(party_role_id, party_role_type, role_status, role_start_date, role_end_date, party_id)
|
|
VALUES
|
|
('7d1e5a2c-0003-4a7b-9c11-000000000001', 'Customer', 'Active', '2020-01-15', NULL, '7d1e5a2c-0001-4a7b-9c11-000000000001'),
|
|
('7d1e5a2c-0003-4a7b-9c11-000000000002', 'Customer', 'Active', '2018-06-01', NULL, '7d1e5a2c-0001-4a7b-9c11-000000000003'),
|
|
('7d1e5a2c-0003-4a7b-9c11-000000000003', 'Customer', 'Closed', '2021-03-01', '2024-08-31', '7d1e5a2c-0001-4a7b-9c11-000000000002');
|
|
|
|
INSERT INTO canonical_party.customer
|
|
(customer_id, customer_number, onboarding_date, relationship_start_date)
|
|
VALUES
|
|
('7d1e5a2c-0003-4a7b-9c11-000000000001', 'CUST-000001', '2020-01-15', '2020-01-15'),
|
|
('7d1e5a2c-0003-4a7b-9c11-000000000002', 'CUST-000002', '2018-06-01', '2015-06-01'),
|
|
('7d1e5a2c-0003-4a7b-9c11-000000000003', 'CUST-000003', '2021-03-01', '2021-03-01');
|
|
|
|
INSERT INTO canonical_party.contact_address
|
|
(contact_address_id, address_purpose, is_primary, verification_status, verification_date, verification_method, valid_from, valid_to, party_id, address_id)
|
|
VALUES
|
|
('7d1e5a2c-0004-4a7b-9c11-000000000001', 'Home', true, 'Verified', '2024-02-10', 'Documentary', '2019-12-01', NULL, '7d1e5a2c-0001-4a7b-9c11-000000000001', '7d1e5a2c-0002-4a7b-9c11-000000000001'),
|
|
('7d1e5a2c-0004-4a7b-9c11-000000000002', 'Mailing', true, 'Unverified', NULL, NULL, '2022-01-01', NULL, '7d1e5a2c-0001-4a7b-9c11-000000000001', '7d1e5a2c-0002-4a7b-9c11-000000000002'),
|
|
('7d1e5a2c-0004-4a7b-9c11-000000000003', 'Registered Office', true, 'Verified', '2023-05-20', 'Electronic', '2012-07-01', NULL, '7d1e5a2c-0001-4a7b-9c11-000000000003', '7d1e5a2c-0002-4a7b-9c11-000000000003');
|
|
|
|
INSERT INTO canonical_party.party_role_contact_address
|
|
(party_role_contact_address_id, party_role_id, contact_address_id)
|
|
VALUES
|
|
('7d1e5a2c-0005-4a7b-9c11-000000000001', '7d1e5a2c-0003-4a7b-9c11-000000000001', '7d1e5a2c-0004-4a7b-9c11-000000000001'),
|
|
('7d1e5a2c-0005-4a7b-9c11-000000000002', '7d1e5a2c-0003-4a7b-9c11-000000000001', '7d1e5a2c-0004-4a7b-9c11-000000000002'),
|
|
('7d1e5a2c-0005-4a7b-9c11-000000000003', '7d1e5a2c-0003-4a7b-9c11-000000000002', '7d1e5a2c-0004-4a7b-9c11-000000000003');
|
|
|
|
INSERT INTO canonical_party.party_association
|
|
(party_association_id, source_party_id, target_party_id, association_type, association_start_date, association_end_date, verified)
|
|
VALUES
|
|
('7d1e5a2c-0006-4a7b-9c11-000000000001', '7d1e5a2c-0001-4a7b-9c11-000000000001', '7d1e5a2c-0001-4a7b-9c11-000000000003', 'Director', '2015-01-01', NULL, true),
|
|
('7d1e5a2c-0006-4a7b-9c11-000000000002', '7d1e5a2c-0001-4a7b-9c11-000000000001', '7d1e5a2c-0001-4a7b-9c11-000000000003', 'Authorised Signatory', '2015-01-01', NULL, true),
|
|
('7d1e5a2c-0006-4a7b-9c11-000000000003', '7d1e5a2c-0001-4a7b-9c11-000000000002', '7d1e5a2c-0001-4a7b-9c11-000000000001', 'Partner', '2016-06-01', NULL, false);
|