• Mahmoud Aglan's avatar
    feat(codes): org invites and platform promo codes on redeem_codes · 59a746e4
    Mahmoud Aglan authored
    org-invites used org_invite_links: 8 lowercase hex characters, no link or
    QR, hard deletes, roles the org model does not have, and nothing ever
    redeemed one. It is rebuilt on redeem_codes, and a new global module,
    /redeem-codes, does the same for platform promo codes. Both share
    core/RedeemService.php and modules/org-invites/CodesBase.php:
    
    - per-org (or platform) list with uses/max, reserved, link opens, previews
      and status (active, scheduled, expired, full, revoked), status and
      campaign filters;
    - create through redeem_create with every grant type: org membership with
      a role, tournament entry (fee waiver), group join, coins and gems (from
      the org treasury or, for platform staff, minted), frame, shop item and
      badge; generated, numeric or vanity; window, max uses, approval,
      eligibility and welcome messages. The database's hard limits (staff
      codes, value codes, vanity codes) come back as Arabic messages; an
      org-scoped account creates as its org's owner;
    - bulk: N single-use generated or numeric codes for a campaign through
      redeem_create_batch, and CSV export of a campaign's live codes for
      printed cards;
    - usage page: link, QR, the funnel (redeem_code_funnel), every redemption
      with its source and new-signup flag, and reverse through redeem_reverse;
    - soft revoke with a reason, logged in org_activity_log as invite.revoke;
    - printable A4 poster (org, scan and join, QR at error level Q, the code,
      expiry);
    - /redeem-codes/campaigns: every campaign across orgs and the platform
      with its funnel (redeem_campaign_stats).
    
    Links are https://el3ab-player.caprover.al-arcade.com/r/<code>.
    Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
    59a746e4
routes.php 34 KB