Admin UI: manage firm office list (firm-agnostic) #43
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The firm's office list is hard-coded in two places that must stay in sync:
internal/offices/offices.go— the Go-side source of truth (All []Officeslice).paliad.users.office(mig 002) andpaliad.partner_units.office(mig 018, renamed via mig 024 + mig 027).Adding a new office (e.g. Madrid, m's 2026-05-20 ask, mig 106 / commit
e035512) currently means: edit the Go slice + update the test + write a migration to extend both CHECK constraints. Three files, one PR per office. Not sustainable as the firm grows or as Paliad gets re-branded to firms with different office footprints.Goal
Admin area page where a global_admin can add, rename, reorder, or retire an office without touching code or shipping a migration.
Design considerations (not prescriptive)
CHECK (office IN ('...', '...'))to a properpaliad.officestable with FK references fromusers.office_keyandpartner_units.office_key. Drops the CHECK; adds a referential integrity guarantee that's enforceable in the UI.label_de+label_en(the currentOfficestruct shape). Editable in the admin UI.sort_ordercolumn (integer, gaps fine) — admin can drag to reorder.retired_at timestamptz NULL. Retired offices don't appear in the new-user/team-creation dropdowns but stay valid on existing rows.officespackage becomes a service-loaded cache (refresh on admin write), not a compile-time slice. TheIsValid/KeysAPI can stay; implementation reads from DB./api/officesendpoint stays — admin UI just adds CRUD on it. Settings / onboarding / admin-team / admin-partner-units dropdowns pick up new offices automatically (they already read from the API)./api/offices).Out of scope
FIRM_NAMEcovers that).keycolumn should be immutable once any row references it — labels are editable, keys are not).Acceptance
officespackage serves the live DB list (not the hard-coded slice).Role recommendation
inventor — schema shift + migration plan + admin UI flow deserve a design pass before implementation. Then coder shift for the build.