Skip to content

feat(web): max-uses & valid-until on pre-approvals#46

Merged
ankitsejwal merged 1 commit into
mainfrom
feat/pre-approval-limits
Jul 2, 2026
Merged

feat(web): max-uses & valid-until on pre-approvals#46
ankitsejwal merged 1 commit into
mainfrom
feat/pre-approval-limits

Conversation

@ankitsejwal

Copy link
Copy Markdown
Member

Exposes the pre-approval maxUses and validUntil fields (backend/schema already supported them) in the admin create form, so multi-use / time-boxed expected visitors are actually creatable — previously the form only ever made effectively-unlimited codes.

  • Number input for Max uses (∞ when blank) and a date input for Valid until (sent as end-of-day ISO).

Verified E2E (Chrome DevTools + live Neon)

  • Created an ALWAYS code with maxUses=2 → row shows Uses 0/2; redeemed via API 2× (201, 201), 3rd → 410 code exhausted. Cap enforced.
  • Created with validUntil 2026-12-31 → round-trips and shows in the Expires column (Jan 1, 2027 local).
  • Console clean; gate + SSR build green.

Follow-up: mirror these fields in the mobile pre-approve form.

The admin pre-approval form now exposes the backend's maxUses and validUntil
fields (a number input and a date), making the SCHEDULED/ALWAYS approval types
actually usable instead of always creating unlimited codes.
@ankitsejwal ankitsejwal merged commit 8ca53bc into main Jul 2, 2026
@ankitsejwal ankitsejwal deleted the feat/pre-approval-limits branch July 2, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant