Subsidiary tab on Contacts + rename Client Company → Clients + storable employer file no.
Goal (owner, 2026-06-19) — surfaced while reviewing IR56M¶
Surface the STORED subsidiary info (English/Chinese name, registered address, BR number) under a new "Subsidiary" tab on the Contacts page; rename the "Client Company" tab → "Clients"; and make the IRD employer file number storable (new field). Unblocks T-047 IR56M #2b (render 僱主檔案號碼 from stored info) + #2c (owner then updates the stored address to end ", Hong Kong").
Reference (owner pointed to dead code)¶
Commit 374b8961 "…fetch and render Subsidiary info card (top-right) with fonts" — the old,
since-removed subsidiary-info display (was in components/projects/NewUIProjectShowApp.tsx +
lib/subsidiaries.ts). Use as the visual/structure model.
Data (already exists)¶
Subsidiary metadata lives in each subsidiary DB's _metadata/config: englishName, chineseName,
addressLine1–3, region, email, phone, brNumber — read via fetchSubsidiaryInfoServer /
fetchSubsidiaryMetadataServer (lib/subsidiaries.server.ts). GET /api/subsidiaries/[id] reads it
(GET-only today). ERL is the only real subsidiary; MEL/EPL are stubs ([[project_subsidiary_status]]).
Plan¶
- a) Data + API: add
employerFileSection?+employerFileNumber?toSubsidiaryMetadata/SubsidiaryInfo(thread through the fetch fns); addupdateSubsidiaryMetadataServer(id, patch); add PATCH topages/api/subsidiaries/[id].ts(admin-gated). [#1b] - b) UI: new
components/contacts/SubsidiaryContent.tsx— view + EDIT the stored info (name EN/ZH, address, BR number, employer file section/number), modeled on374b8961. Add the "Subsidiary" tab to ContactsApp; rename "Client Company" → "Clients". [#1a] - c) IR56M wiring (T-047 #2b): the seed's payer block (buildIR56MFilingSeed) maps
employerFileSection/Numberfrom the stored info → the form renders 僱主檔案號碼.
Related¶
T-047 (the IR56M feature this unblocks) · T-062 (Contacts tabs — Individuals + Client Company) · [[project_subsidiary_status]] (ERL only; MEL/EPL stubs).
Log¶
- 2026-06-19 created (owner). Located the dead card (374b8961) + the
_metadata/configdata + the GET-only subsidiary API. Plan: data/API → Subsidiary tab + rename → IR56M employer-file wiring. - 2026-06-19 DONE (nightly e905deeb): employerFile fields on SubsidiaryMetadata/Info + fetch threading; PATCH /api/subsidiaries/[id] (admin-gated); new SubsidiaryContent.tsx tab (view+edit, per-subsidiary selector) + ContactsApp "Subsidiary" tab + "Client Company"→"Clients" rename; IR56M payer block wired (T-047 #2b). tsc 0; suite 345; eslint clean. Owner to populate ERL employer file no. + region "Hong Kong" in Contacts → Subsidiary (then IR56M renders 僱主檔案號碼 + address ends ", Hong Kong"). Owner-verify the tab on the nightly deploy (auth-gated).