Vouchers
Dashboard: every screen, state and flow in Vouchers.
16 screens and overlays, 95 states, 2 flows. Frames show a real screenshot where one was captured and a wireframe card where the state needs data or conditions a device run cannot produce.
Flows
Issue a voucher by hand (writes to Shopify)
Branches and edge cases
Issue voucher
Template not active
Template is not active or Voucher template not found
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Issue voucher
Writes off still says issued
With writes off the voucher exists but no Shopify code; toast says Issued
Not reachable on a device: Needs a server error, crash, race or code change
Voucher detail
Extend reactivates expired
Extending an expired voucher re-activates it; Convex only
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Voucher detail
Reissued
Toast Reissued as <code>
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Voucher detail
Reissue refused
Only active or expired vouchers can be reissued
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Revoke voucher(s)?
Revoke refused
Cannot revoke voucher with status: X
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Flow diagram
Voucher template lifecycle
Voucher Templates
Bulk result messages
2/3 templates activated; N skipped (vouchers already issued)
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Branches and edge cases
Create Voucher Template
Discount value required
Discount value is required for the selected discount type
Not captured yet
Create Voucher Template
Server discount refusals
discountPercentage must be > 0 and <= 100; discountValue > 0
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Voucher Templates
Delete refused
Cannot delete template: vouchers have already been issued. Deactivate it instead.
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Voucher template detail
No Shopify campaign node yet
Sync refused when the template has no node
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Voucher template detail
Shopify sync queued
Toast shows the server message
Needs data: Needs specific backend rows, a role, or a submitted write on a disposable record
Flow diagram
Screens and states
Vouchers Overview
/dashboard/vouchersVouchers Overview
KPIs and Shopify sync health.
src/app/dashboard/vouchers/page.tsxEntry
- Sidebar Vouchers
Exits
- Refresh → re-query
States · 4
src/app/dashboard/vouchers/loading.tsxsrc/features/vouchers/overview/overview-view.tsx:157src/features/vouchers/overview/overview-view.tsxsrc/features/vouchers/overview/overview-view.tsxVoucher Templates
/dashboard/vouchers/templatesVoucher Templates
Create and manage reusable voucher templates.
src/app/dashboard/vouchers/templates/page.tsxEntry
- Sidebar Vouchers > Templates
- Legacy loyalty redirect
Exits
- New Template (admin) → /templates/new
- Sync All with Shopify → bumps updatedAt only
- View, Edit, Duplicate → template routes
- Issue voucher → Issue sheet
- Raya campaigns → /raya-campaign?template=
- Bulk Activate, Duplicate, Export, Delete
States · 9
src/features/loyalty/components/views/voucher-template-management-view.tsxsrc/features/loyalty/components/views/voucher-template-management-view.tsxsrc/features/loyalty/components/voucher-templates/voucher-template-table.tsxpackages/backend/convex/gamificationLoyalty/mutations.ts:1625src/features/loyalty/components/voucher-templates/voucher-template-bulk-actions.tsxsrc/features/loyalty/components/voucher-templates/voucher-template-table.tsx:245src/features/loyalty/components/voucher-templates/voucher-template-table.tsx:118src/features/loyalty/components/voucher-templates/voucher-template-filters.tsxpackages/backend/convex/gamificationLoyalty/mutations.ts:2193Create Voucher Template
/dashboard/vouchers/templates/newCreate Voucher Template
Define discount, targeting, eligibility and channels.
src/app/dashboard/vouchers/templates/new/page.tsxEntry
- New Template
- Duplicate with ?duplicate=
Exits
- Back → unsaved dialog
- Submit → /vouchers/templates
States · 9
src/features/loyalty/components/voucher-templates/voucher-template-form.tsxsrc/features/loyalty/components/voucher-templates/shopify-preview.tsxsrc/features/loyalty/components/voucher-templates/utils/voucher-template-validation.tspackages/backend/convex/gamificationLoyalty/mutations.ts:1297packages/backend/convex/gamificationLoyalty/mutations.ts:1297packages/backend/convex/gamificationLoyalty/mutations.ts:1297src/features/loyalty/components/voucher-templates/voucher-template-form.tsxsrc/features/loyalty/components/voucher-templates/voucher-template-form.tsxsrc/features/loyalty/components/voucher-templates/voucher-template-form.tsxVoucher template detail
/dashboard/vouchers/templates/[id]Voucher template detail
Template detail with admin actions.
src/app/dashboard/vouchers/templates/[id]/page.tsxEntry
- Row View
Exits
- Edit, Duplicate
- Activate or Deactivate
- Delete → confirm → list
- Raya campaigns link
- Sync to Shopify
- Use in Campaign → loyalty form
States · 8
src/features/loyalty/components/voucher-templates/voucher-template-details.tsxsrc/features/loyalty/components/voucher-templates/voucher-template-details.tsxpackages/backend/convex/gamificationLoyalty/mutations.ts:771packages/backend/convex/gamificationLoyalty/mutations.ts:771src/features/loyalty/components/voucher-templates/voucher-template-details.tsxsrc/features/loyalty/components/voucher-templates/voucher-template-details.tsx:452src/features/loyalty/components/voucher-templates/voucher-template-details.tsxsrc/features/loyalty/components/voucher-templates/voucher-template-details.tsxEdit Voucher Template
/dashboard/vouchers/templates/[id]/editEdit Voucher Template
Update template configuration.
src/app/dashboard/vouchers/templates/[id]/edit/page.tsxEntry
- Row Edit
- Detail Edit
Exits
- Back → unsaved dialog
- Submit → /vouchers/templates
States · 5
src/features/loyalty/components/voucher-templates/voucher-template-form.tsxsrc/features/loyalty/components/voucher-templates/voucher-template-form.tsxpackages/backend/convex/gamificationLoyalty/mutations.ts:1403src/features/loyalty/components/voucher-templates/voucher-template-form.tsxsrc/features/loyalty/components/voucher-templates/voucher-template-form.tsxIssued Vouchers
/dashboard/vouchers/issuedIssued Vouchers
All voucher instances with issue, revoke, extend and reissue.
src/app/dashboard/vouchers/issued/page.tsxEntry
- Sidebar
- Dashboard link
- /vouchers/issue redirect
Exits
- Issue → Issue sheet
- Export (admin) → Export dialog
- Code or View → detail sheet
- Revoke → confirm
- Reissue → new code
- Bulk revoke → confirm
States · 5
src/features/vouchers/issued/issued-vouchers-view.tsxsrc/features/vouchers/issued/issued-vouchers-view.tsx:491src/features/vouchers/issued/issued-vouchers-view.tsx:443src/features/vouchers/issued/issued-vouchers-view.tsx:189src/features/vouchers/issued/issued-vouchers-view.tsxIssue voucher
IssueVoucherSheetIssue voucher
Issue a voucher to one user or in bulk.
src/features/vouchers/issue/issue-voucher-sheet.tsxEntry
- Issued page header Issue
- Templates row Issue voucher
Exits
- Submit → closes, toast Issued voucher code
- Close → cancels
States · 9
packages/backend/convex/dashboard/mutations.ts:150packages/backend/convex/dashboard/mutations.ts:162src/features/vouchers/issue/issue-voucher-sheet.tsxpackages/backend/convex/dashboard/mutations.tspackages/backend/convex/dashboard/mutations.tssrc/features/vouchers/issue/issue-vouchers-view.tsxpackages/backend/convex/dashboard/mutations.tssrc/features/vouchers/issue/issue-voucher-sheet.tsxsrc/features/vouchers/issue/issue-vouchers-view.tsxVoucher detail
VoucherDetailSheetVoucher detail
Voucher fields with extend, revoke and reissue.
src/features/vouchers/issued/issued-vouchers-view.tsxEntry
- Row code click or View
Exits
- Extend expiry → date picker
- Revoke → confirm dialog
- Reissue with new code
States · 7
src/features/vouchers/issued/issued-vouchers-view.tsx:514packages/backend/convex/dashboard/mutations.ts:420packages/backend/convex/dashboard/mutations.ts:461packages/backend/convex/dashboard/mutations.ts:461src/features/vouchers/issued/issued-vouchers-view.tsxpackages/backend/convex/dashboard/mutations.tssrc/features/vouchers/issued/issued-vouchers-view.tsxRevoke voucher(s)?
VoucherRevokeDialogsRevoke voucher(s)?
Confirm revoking one or many vouchers.
src/features/vouchers/issued/issued-vouchers-view.tsxEntry
- Row Revoke
- Bulk bar Revoke selected
Exits
- Revoke → toast
- Cancel → closes
States · 5
packages/backend/convex/dashboard/mutations.tspackages/backend/convex/dashboard/mutations.tssrc/features/vouchers/issued/issued-vouchers-view.tsxsrc/features/vouchers/issued/issued-vouchers-view.tsxsrc/features/vouchers/issued/issued-vouchers-view.tsxVoucher Audit
/dashboard/vouchers/auditVoucher Audit
Voucher-related admin actions.
src/app/dashboard/vouchers/audit/page.tsxEntry
- Sidebar Vouchers > Audit
Exits
- Copy ids → clipboard toast
- Load more → next batch
States · 5
src/features/vouchers/audit/voucher-audit-view.tsxsrc/features/vouchers/audit/voucher-audit-view.tsxsrc/features/vouchers/audit/voucher-audit-view.tsxsrc/features/vouchers/audit/voucher-audit-view.tsx:28src/features/vouchers/audit/voucher-audit-view.tsx:150Issue voucher redirect
/dashboard/vouchers/issueIssue voucher redirect
Redirect kept for one release cycle.
src/app/dashboard/vouchers/issue/page.tsxEntry
- Old bookmarks
Exits
- Redirect → /vouchers/issued
States · 1
src/app/dashboard/vouchers/issue/page.tsxCode Pools
/dashboard/vouchers/poolsCode Pools
Pre-generated claim-code batches.
src/app/dashboard/vouchers/pools/page.tsxEntry
- Sidebar
- Loyalty dashboard link
- Raya list View as Pools
Exits
- New Pool → /pools/new
- Code Campaigns (Raya) → /raya-campaign
- Open detail → /pools/[id]
- Copy slug
States · 3
src/features/vouchers/pools/pools-list-view.tsxsrc/features/vouchers/pools/pools-list-view.tsxsrc/features/vouchers/pools/pools-list-view.tsxCreate Pool
/dashboard/vouchers/pools/newCreate Pool
Generate a batch of claim codes against a template.
src/app/dashboard/vouchers/pools/new/page.tsxEntry
- New Pool
Exits
- Back or Cancel → list
- Create pool & generate codes → /pools/[id]
States · 8
src/features/vouchers/pools/pool-create-form.tsx:164packages/backend/convex/duitRaya/mutations.ts:469src/features/vouchers/pools/pool-create-form.tsxsrc/features/vouchers/pools/pool-create-form.tsxsrc/features/vouchers/pools/pool-create-form.tsxsrc/features/vouchers/pools/pool-create-form.tsxpackages/backend/convex/duitRaya/mutations.tssrc/features/vouchers/pools/pool-create-form.tsx:329Pool Detail
/dashboard/vouchers/pools/[id]Pool Detail
Pool detail, codes and provisioning.
src/app/dashboard/vouchers/pools/[id]/page.tsxEntry
- Pools list
- Create redirect
- Raya pool links
Exits
- Back to Pools
- Export CSV
- More menu → edit, analytics, delete
- Generate remaining (paused)
- Code menu → copy, reset
States · 11
src/features/vouchers/pools/pool-detail-view.tsx:264src/features/vouchers/pools/pool-detail-view.tsxsrc/features/vouchers/pools/pool-detail-view.tsxsrc/features/vouchers/pools/pool-detail-view.tsxsrc/features/vouchers/pools/pool-detail-view.tsx:465packages/backend/convex/duitRaya/mutations.ts:546src/features/vouchers/pools/pool-detail-view.tsxsrc/features/vouchers/pools/pool-detail-view.tsxsrc/features/vouchers/pools/pool-detail-view.tsxsrc/features/vouchers/pools/pool-detail-view.tsxpackages/backend/convex/duitRaya/mutations.tsEdit pool
PoolEditSheetEdit pool
Update pool name, description, dates and active flag.
src/features/vouchers/pools/pool-detail-view.tsxEntry
- More menu Edit pool
Exits
- Save → toast Pool updated
- Close
States · 3
src/features/vouchers/pools/pool-detail-view.tsx:560src/features/vouchers/pools/pool-detail-view.tsx:560src/features/vouchers/pools/pool-detail-view.tsx:560Delete pool?
PoolDeleteAlertDelete pool?
Deactivate or hard delete a pool.
src/features/vouchers/pools/pool-detail-view.tsxEntry
- More menu Delete pool
Exits
- Delete → /vouchers/pools
- Cancel → closes
States · 3
packages/backend/convex/duitRaya/mutations.ts:1440src/features/vouchers/pools/pool-detail-view.tsx:645packages/backend/convex/duitRaya/mutations.ts

























