Contacts — client companies showed blank address/phone/email (incomplete unification migration)
Symptom¶
Client companies on the Contacts page rendered with blank address / phone / email. Owner asked: bad migration, or wrong read path?
Diagnosis — routing is correct; the data was empty¶
- The page reads
aote-system/organizationswith the right field names (org.contact.email,org.contact.phone,org.address.*) — verified incomponents/contacts/ClientCompanyContent.tsx,lib/individuals/crud.server.ts,lib/individuals/types.ts. No stale collection, no renamed field. - But 18 of 19 org docs had
contact: null+address: null. The T-048 P3 contacts unification (2026-06-16,created.by == system:t048-p3) created the unified org docs but never copied contact/address across from the legacy per-subsidiarytebs-<sub>/clientsrecords. The later T-081 UID re-key just re-keyed already-empty docs. - Source data survived in
tebs-epl/clients(20) +tebs-mel/clients(1); each org records its origin inprovenance(e.g.epl-clients/CALLI HORIZON LIMITED).
Fix — data backfill (owner-authorized)¶
scripts/backfill-org-contacts.tsresolves each empty org's source viaprovenance(deterministic), maps legacy→org schema (epl flataddressLine3→district; mel already nested), merges onlycontact+address+updated, never overwrites a populated org.- Dry-run reviewed (one phone-format nit tightened) → executed: 18/18 backfilled; verified 0 orgs with null contact/address. Watch Music Limited (already populated) skipped.
- Rollback:
scripts/migration-backups/backfill-org-contacts-2026-07-02T05-44-56-056Z.json(local). - Owner authorization (2026-07-02, verbatim): "Draft and run the dry run, if works great and then proceed to the real run."
Notes¶
countryleft null (absent in the epl source — not fabricated); phone largely null in the source (only Ksana). Fill in the UI as needed.- Source: EOP Local Assistance (fork) · session edb0abc7-6373-449b-8e31-379fd38d391b