package domain import ( "errors" "time" "github.com/google/uuid" ) // CheckIn records that a guest walked in. One row per guest (the UNIQUE // constraint prevents double check-in); arrival_count captures how many // people were actually in the party — guest + plus-ones who showed. // walk_in tags door-adds that weren't on the original guest list. // Tier 2 Block H. type CheckIn struct { ID uuid.UUID `json:"id"` GuestID uuid.UUID `json:"guest_id"` CheckedInAt time.Time `json:"checked_in_at"` CheckedInBy *uuid.UUID `json:"checked_in_by,omitempty"` ArrivalCount int `json:"arrival_count"` Notes *string `json:"notes,omitempty"` WalkIn bool `json:"walk_in"` } // CheckInSummary is the dashboard widget's data: total arrivals so far, // and the original headcount goal (sum of attending + plus_ones). type CheckInSummary struct { ArrivedHeadcount int `json:"arrived_headcount"` ExpectedHeadcount int `json:"expected_headcount"` GuestsCheckedIn int `json:"guests_checked_in"` } var ( ErrAlreadyCheckedIn = errors.New("guest is already checked in") ErrCheckInBadQR = errors.New("invalid QR payload") ErrCheckInExpired = errors.New("QR has expired") ErrCheckInMismatch = errors.New("QR belongs to a different event") )