E13-F2: Post-Match Attendance Import¶
Epic: E13: Access Control Integration
Size: S (Small)
Problem / Outcome¶
Import attendance data after match for loyalty points.
Scope¶
In-Scope:
- Excel upload (scanned barcodes)
- Barcode to ticket matching
- A preview before anything is saved: the import run as a dry run, showing matched and unmatched barcodes; "Potvrdi uvoz" then saves it
- Ticket status update to ATTENDED
- Open from kick-off until the match is closed, on a published match only: the close imports the last file and awards the loyalty points, so a ticket marked attended after it would earn none
Out-of-Scope:
- Real-time attendance tracking
Acceptance Criteria¶
- AC1: Imported barcodes matched to tickets
- AC2: Matched tickets marked as ATTENDED with timestamp
- AC3: Unmatched barcodes reported for review
- AC4: The preview shows the counts and unmatched barcodes the import will give, and saves nothing
- AC5: Before kick-off, and on a draft, closed or cancelled match, the import (the preview too) is refused (409) and the match's export tab says when attendance can be imported
Data Model Impact¶
Ticket table:
- status = ATTENDED
- attended_at (TIMESTAMP)
AttendanceImport table:
- id (UUID, PK)
- match_id (UUID, FK)
- file_name (VARCHAR)
- total_scanned (INTEGER)
- matched_count (INTEGER)
- unmatched_count (INTEGER)
- imported_by (UUID, FK)
- imported_at (TIMESTAMP)
AttendanceUnmatched table:
- id (UUID, PK)
- import_id (UUID, FK)
- barcode (VARCHAR)
- scan_timestamp (TIMESTAMP, nullable)
- reason (ENUM: not_found, already_cancelled, invalid_format)
Import file format:
- barcode (required)
- scan_timestamp (optional)
- gate_id (optional)
Permissions/Roles¶
- Admin (Match Manager)
How to Verify¶
npm test -- --grep "attendance import"
Expected: Tickets updated correctly.
Dependencies¶
Implementation Tasks¶
Doc References¶
Last Updated: January 2026