Skip to content

E7-F1: Quota Creation API

Epic: E7: Quota Management

Size: M (Medium)

Problem / Outcome

Admins create quotas for partners/sponsors.

Scope

In-Scope:

  • POST /admin/quotas endpoint
  • Fields: email, sectors, quantity, discount, algorithm, expiration, flags
  • Automatic seat allocation using selected algorithm
  • Email invitation with deeplink

Out-of-Scope:

  • CSV import (separate feature)

Acceptance Criteria

  • AC1: Given valid quota data, when created, then seats allocated using selected algorithm (NM/REDOM)
  • AC2: Allocated seats reserved from public sale immediately
  • AC3: Email invitation sent with deeplink to claim

Data Model Impact

Quota table:
- id (UUID, PK)
- match_id (UUID, FK)
- recipient_email (VARCHAR)
- recipient_name (VARCHAR)
- total_quantity (INTEGER)
- sector_ids (UUID[])
- discount_percent (DECIMAL)
- allocation_algorithm (ENUM: NM, REDOM)
- expiration_date (DATE)
- can_create_subquotas (BOOLEAN)
- status (ENUM: pending, active, expired, cancelled)
- created_by (UUID, FK)
- created_at (TIMESTAMP)

QuotaSeat table:
- id (UUID, PK)
- quota_id (UUID, FK)
- seat_id (UUID, FK)
- status (ENUM: allocated, reserved, sold)

Permissions/Roles

  • Admin (Quota Manager)

How to Verify

npm test -- --grep "quota creation"

Expected: Quota created, seats allocated, email sent.

Dependencies

Implementation Tasks

See E7: Quota Management Tasks

Doc References


Last Updated: January 2026