E14-F1: Sales Reports¶
Epic: E14: Reporting & Analytics
Size: M (Medium)
Problem / Outcome¶
Generate sales reports with various filters.
Scope¶
In-Scope:
- Filter by match, date range, ticket type, sector
- Columns: buyer, quantity, amount
- CSV export
- Preview first 50 rows
Out-of-Scope:
- Pivot tables
Acceptance Criteria¶
- AC1: Report filters apply correctly
- AC2: Preview shows first 50 rows
- AC3: Full CSV export available asynchronously
Data Model Impact¶
No new tables required (read queries).
Report parameters:
- match_id (UUID, nullable)
- date_from (DATE)
- date_to (DATE)
- ticket_type (ENUM: regular, quota, petrol)
- sector_ids (UUID[])
- status (ENUM: sold, refunded, cancelled)
Report columns:
- order_number
- order_date
- buyer_name
- buyer_email
- match_name
- sector
- quantity
- ticket_amount
- fee_amount
- total_amount
- payment_method
- status
ReportExportJob table:
- id (UUID, PK)
- report_type (ENUM: sales)
- parameters_json (JSONB)
- status (ENUM: pending, processing, completed, failed)
- file_url (VARCHAR, nullable)
- requested_by (UUID, FK)
- created_at (TIMESTAMP)
- completed_at (TIMESTAMP)
Permissions/Roles¶
- Admin (Reporting)
How to Verify¶
npm test -- --grep "sales report"
Expected: Filters work, export generates.
Dependencies¶
Implementation Tasks¶
See E14: Reporting ## Doc References Analytics Tasks
Doc References¶
Last Updated: January 2026