feat(api): global settings with a typed key catalog (#19, part 2) #85
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!85
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/settings"
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?
Closes #19 (part 2 of 2; part 1 was #84).
What
Global settings: the few values the business tunes.
internal/settings) definestaxandconvenience_fee(percentages 0 to 100, up to 4 decimals) andnotification_emailandnotification_bcc_email(one plain address). A value is validated against its key's type when it is saved. Legacy found settings by display name ("Tax","Convenience Fee","Email","BCC Email") and parsed the text at checkout (decimal.Parse), so one bad value crashed it.settings(one row per key), row-audited with old and new values, so a tax change is traceable to who and when.administration.manage):GET /v1/admin/settings/keys(the catalog, for the admin screen),GET/POST /v1/admin/settings,PUT/DELETE /v1/admin/settings/{id}with optimistic locking. Deleting a value unsets the key. A setting cannot be repointed at another key.Decisions to confirm
GetSettingByNameAsync) ignores the park, so a per-park value never took effect. I did not build per-park overrides; add a park scope when something needs it.capacitykey. The legacy capacity setting is read in the ticket flow but every use is commented out, so capacity limits are not enforced today (also noted as [verify] in the spec).Standards review (docs/development-standards.md)
SettingStore; sharedrest/pgrestplumbing;rbactestguard reused. The catalog is the only place that knows the keys.make lint0 issues. Security scans run onmainafter merge.🤖 Generated with Claude Code