feat(api): dynamic forms and form inputs with semantic purposes (#19, part 1) #84
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!84
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/forms"
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?
Part 1 of #19 (does not close it: settings are part 2).
What
Dynamic forms: the questions a product asks per ticket (guest name, email, ID or passport, nationality, vehicle plate).
formsandform_inputs(soft-deleted, because tickets keep their answers), all 18 legacy input types kept, and the foreign keyproducts.form_id -> formsthat migration 0007 deferred.purpose. A field may say what it means (email,name,identity_number,nationality,vehicle_registration), at most one live field per purpose in a form. The legacy code found the customer's email, name, ID and nationality by sniffing the label (Label.Contains("ID"),Label.Equals("Email")), which broke as soon as an administrator renamed a label and could match unrelated labels. The ticket and notification code will look fields up by purpose.internal/forms): public cacheableGET /v1/forms/{id}(active form and fields only, ordered); admin CRUD under/v1/admin/formsand/v1/admin/form-inputsgated byadministration.manage, optimistic locking, versioned soft delete. A form that live products use cannot be removed (409); removing a form removes its fields.rbactestpackage (excluded from coverage likepgtestandauthtest), and catalog, lookups and forms tests use it.Standards review (docs/development-standards.md)
FormStoreandFieldStoreare separate narrow interfaces; the handler takes them separately; shared plumbing reused (rest,pgrest), no copies.make lint0 issues. Security scans run onmainafter merge.Known limits
radio,genderand similar types need option lists is unknown: legacy stores only a default value, so options live in the client. Kept as is.Next (part 2, closes #19)
Settings: a catalog of known keys in code (tax, convenience fee, notification emails) with typed validation, values editable as data, optional per-park override.
🤖 Generated with Claude Code