feat(contacts): company-industries settings lookup (PMS-601) #412
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-601-company-industries-lookup"
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?
PMS-601 (backend half)
Promotes the company Industry suggestion list from a hardcoded frontend constant to a tenant-scoped, admin-editable lookup, following the 048_project_types_lookup pattern. Industry stays free text on
companies(PMS-582); this lookup only feeds the combobox's suggestions and does NOT convert the column to a foreign key.Commits (small, logical)
086:company_industriestable + tenant index + case-insensitive unique(tenant_id, lower(name))+ RLS policy + updated_at trigger + per-tenant seed of the canonical defaults for every existing tenant.copy_default_config: replicate the lookup to newly provisioned tenants (copied from the seed tenant).CompanyIndustryResponse+UpsertCompanyIndustryRequestin mokosh-types.ContactService(tenant-scoped; duplicate name -> 409 via the existing sqlx unique-violation mapping; create audited).GET/POST /contacts/company-industries,PUT/DELETE /contacts/company-industries/{id}(list open to any authed user for the combobox; writesRequireAdmin).Verified
Dev server restarted on this branch: migration
086ran clean, server listening, andcompany_industriesseeded 58 rows across 2 tenants (29 each).Companion
Frontend PR in mokosh-apps: the Settings admin page + sourcing the combobox suggestions from this endpoint (and removing the constant).
🤖 Generated with Claude Code
GET/POST /contacts/company-industries and PUT/DELETE /contacts/company-industries/{id}. List is open to any authed user (the company form's combobox fetches it); create/update/delete require RequireAdmin, matching the asset-types lookup admin pattern. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>