Skip to content

QA: Team Coupon Redemption Notifications #295

Description

@ebuwen88

Source PRD: docs/prds/team-coupon-redemption-notifications.md (no GitHub PRD issue exists for this one)

Note: This feature is already implemented (couponRedemptionNotifications table,
notificationService.ts coupon-redemption functions, teamService.getTeamAdmins,
redeemCoupon routed through enrollUser + multi-admin notify, /team unread badge
and per-row "New" indicator) despite its plan doc
(docs/plans/team-coupon-redemption-notifications.md) still saying
"Status: Proposed." teamService.test.ts (16), couponService.test.ts (16), and
notificationService.test.ts (24) all pass. This issue is for a fresh,
independent manual QA sign-off against the PRD's requirements — not
implementation tracking.

Instructor Notification Parity (PRD Functional #1)

  • Redeeming a coupon enrolls the student via the same path as a direct purchase (enrollUser)
  • A team-coupon redemption produces an instructor notification, same as a direct-purchase enrollment
  • A failed redemption (bad code, already consumed, already enrolled, country mismatch) produces no instructor notification

Team Admin Notification Creation (PRD Functional #2, #7)

  • Redeeming a coupon creates a notification for that coupon's team admin
  • On a team with multiple admins, redeeming a coupon notifies every admin, not just one
  • A failed redemption produces no coupon-redemption notification

/team Unread Count (PRD Functional #3)

  • /team shows an unread-notification count for the signed-in team admin
  • Count reflects only unread redemption notifications

Per-Coupon "New" Indicator (PRD Functional #4)

  • A redeemed coupon row shows a "New" badge distinct from the existing "Claimed by ..." text, when unread
  • The "New" badge disappears after the admin has viewed /team once

Read State on Page Load (PRD Functional #5)

  • Loading /team marks that admin's redemption notifications as read
  • Notifications still render as "New" in the same response that marks them read (not read before the admin sees them)

Access Control (PRD Functional #6)

  • A team admin only ever sees redemption notifications for their own team
  • A team admin cannot see another team's redemption notifications

Non-Functional

  • No new PII beyond what's already visible on /team (redeemer email, course, coupon code)
  • Reading /team's notification data is a single query per admin, not a per-coupon loop (verify via code inspection if not observable in UI)
  • couponRedemptionNotifications table follows schema conventions: autoincrement integer id, ISO string timestamps, nullable read_at text column (not boolean)

Open Questions needing retroactive confirmation (PRD Open Questions — flagged as needed before implementation, but implementation already shipped)

  • Confirm a new purpose-built couponRedemptionNotifications table (vs. generalizing the existing notifications table) is acceptable
  • Confirm no retention/cleanup policy for old redemption notifications is acceptable for v1
  • Confirm enrollUser's duplicate-enrollment check being a harmless no-op behind redeemCoupon's own earlier check is acceptable (no double-guard issue)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions