Preskoči na sadržaj

E2-F9: Match Closure with Attendance Import

Epic: E2: Match & Stadium Management

Size: M (Medium)

Problem / Outcome

Close match and import attendance data for loyalty points.

Scope

In-Scope:

  • Close match action
  • Attendance file upload (Excel format)
  • Atomic update of ticket statuses and match closure
  • Option to close without attendance data

Out-of-Scope:

  • Manual attendance entry

Acceptance Criteria

  • AC1: Given attendance file, when admin imports, then matched tickets marked as "ATTENDED"
  • AC2: Given no attendance data, admin can close with reason and all tickets marked "ATTENDED"
  • AC3: Match closure and attendance import are atomic (both or neither)

Data Model Impact

Match table:
- status (ENUM includes: completed)
- closed_at (TIMESTAMP)
- closed_by (UUID, FK)

Ticket table:
- status (ENUM includes: attended)
- attended_at (TIMESTAMP)

MatchAttendance table:
- id (UUID, PK)
- match_id (UUID, FK)
- import_file_name (VARCHAR)
- total_scanned (INTEGER)
- matched_count (INTEGER)
- unmatched_count (INTEGER)
- imported_at (TIMESTAMP)

Permissions/Roles

  • Admin (Match Manager)

How to Verify

npm test -- --grep "match closure"

Expected: Atomic operation works, loyalty calculation triggers.

Dependencies

Implementation Tasks

See E2: Match ## Doc References Stadium Tasks

Doc References


Last Updated: January 2026