Skip to content

feat: revoke a pre-approval#45

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

feat: revoke a pre-approval#45
ankitsejwal merged 1 commit into
mainfrom
feat/pre-approval-revoke

Conversation

@ankitsejwal

Copy link
Copy Markdown
Member

Completes the pre-approval lifecycle: an admin can cancel an expected visitor before the code is used.

  • API: admin-only POST /visitors/pre-approvals/:id/revoke → sets isActive=false. The shared preApprovalRedeemError helper already rejects inactive codes, so a revoked code stops working immediately.
  • Web: a Revoke action on active rows of the admin pre-approvals page.

Verified E2E (Chrome DevTools + live Neon)

  • UI: clicked Revoke → row flipped Active → Inactive, button removed.
  • API: created a fresh unused code → revoked (200) → redeem → 404 invalid or inactive (proves revoke blocks redemption, not just exhaustion); revoke nonexistent → 404; revoke as RESIDENT → 403 (admin-only).
  • Full gate green.

Admin-only POST /visitors/pre-approvals/:id/revoke sets isActive=false so the
code can no longer be redeemed (the shared redeem helper already rejects
inactive codes). Adds a Revoke action on active rows of the web admin
pre-approvals page.
@ankitsejwal ankitsejwal merged commit 31a2c13 into main Jul 2, 2026
@ankitsejwal ankitsejwal deleted the feat/pre-approval-revoke branch July 2, 2026 21:43
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