Skip to content

Coupon - #13

Merged
rex-9 merged 6 commits into
devfrom
coupon
Sep 18, 2026
Merged

rex-9 merged 6 commits into
devfrom
coupon

Conversation

@rex-9

@rex-9 rex-9 commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

In brief, this PR implements the frontend interface for the new Promotional & Referral Coupon system and consolidates the Admin sidebar navigation by moving User Notifications and User Versions into intuitive tabs on their respective parent admin pages.

Why

This change is needed to support commercial coupon creation, batch generation, and checkout redemption backed by the core API in rex-9/rexone-core#97. It also resolves sidebar bloat by decluttering standalone navigation items into organized tabbed views, while eliminating raw string literals across routes and navigation state.

Changes

  • Added:
    • Admin Coupons management pages: Active Coupons table, Recycle Bin, search, type/currency filters, sorting, and pagination.
    • Create/Edit Coupon modal with role, user, and product targeting controls.
    • Bulk Coupon Generation modal (prefix + count).
    • Coupon Detail view and dedicated Redemption Ledger audit table.
    • User Notifications tab embedded directly into AdminNotificationsPage (/admin/notifications?tab=user_notifications).
    • User Versions tab embedded directly into AdminVersionsPage (/admin/versions?tab=user_versions).
    • Checkout session coupon input with dynamic validation feedback, discount preview, and 30-second lockout timer.
  • Changed:
    • AdminSidebarNav.tsx: Removed redundant top-level UserNotifications and UserVersions sidebar links.
    • RouteManager.tsx: Added seamless <Navigate> redirects from legacy standalone URLs (/admin/user-notifications, /admin/user-versions) to their parent tab URLs.
    • Replaced hardcoded route and tab strings with centralized constants (ADMIN_VERSION_TABS, NOTIFICATION_ADMIN_TABS).
  • Removed:
    • Standalone duplicate headers and raw string literals in admin navigation and version controllers.

Testing

This change was verified by:

  • Unit tests (npm test — 32 test files, 290 tests passed cleanly)
  • Integration tests (sh scripts/test.sh — 20 Playwright E2E tests in e2e/specs/auth/ passed with 0 database cleanup remnants)
  • Manual testing (verified tab switching, URL synchronization, coupon CRUD, bulk generation, checkout discount application, and 30s rate-limit cooldown)
  • Existing test suite passes

Related Issues

Screenshots / Videos

  • Described in Core PR

Notes

  • Requires rexone-core deployed with migration 20260916173000_create_coupons.rb and 20260916173001_create_user_coupons.rb (rexone-core#97).
  • Legacy bookmarked URLs for /admin/user-notifications and /admin/user-versions automatically redirect to the appropriate tabs without breaking deep links.

Checklist

  • Code follows the project's conventions
  • Tests were added/updated where appropriate
  • Documentation was updated where appropriate (README.md, ECOSYSTEM.md)
  • No unrelated changes are included

@vercel

vercel Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
rexone Ready Ready Preview Sep 18, 2026 7:58am UTC

@rex-9
rex-9 merged commit d0bafb4 into dev Sep 18, 2026
3 checks passed
@rex-9
rex-9 deleted the coupon branch September 30, 2026 00:44

This branch was successfully deployed

1 active deployment
Preview — 8378b6b6 Deployed Sep 18, 2026 by vercel[bot]
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