package natspub import ( "time" "github.com/google/uuid" ) type AccessAttempted struct { EventID uuid.UUID `json:"event_id"` GuestID uuid.UUID `json:"guest_id"` TokenID uuid.UUID `json:"token_id"` AccessLogID uuid.UUID `json:"access_log_id"` Fingerprint map[string]any `json:"fingerprint,omitempty"` IPAddress string `json:"ip_address,omitempty"` UserAgent string `json:"user_agent,omitempty"` Referrer string `json:"referrer,omitempty"` OccurredAt time.Time `json:"occurred_at"` } type FraudScored struct { EventID uuid.UUID `json:"event_id"` GuestID uuid.UUID `json:"guest_id"` TokenID uuid.UUID `json:"token_id"` AccessLogID uuid.UUID `json:"access_log_id"` Score int `json:"score"` Risk string `json:"risk"` Reasons []string `json:"reasons"` ScoredAt time.Time `json:"scored_at"` // Tier 2 Block G — geolocation enrichment. All optional because // private IPs and lookup failures leave them unset. The API // consumer copies these onto access_logs.geo_* so the host UI can // render "opened from Lagos, Nigeria" without having to do the // lookup itself. GeoCountry *string `json:"geo_country,omitempty"` GeoCity *string `json:"geo_city,omitempty"` GeoLat *float64 `json:"geo_lat,omitempty"` GeoLon *float64 `json:"geo_lon,omitempty"` } type RSVPConfirmed struct { EventID uuid.UUID `json:"event_id"` GuestID uuid.UUID `json:"guest_id"` RSVPID uuid.UUID `json:"rsvp_id"` Response string `json:"response"` PlusOnes int `json:"plus_ones"` RiskScore *int `json:"risk_score,omitempty"` SubmittedAt time.Time `json:"submitted_at"` // AccessLink is the full URL the guest can return to in order to // view (or edit) their confirmation — the same magic invitation URL // they used to submit the RSVP. Populated by the API at submit time // so the notifier can include it in the confirmation email (and // fallback link beneath the inline QR). Empty on legacy events. AccessLink string `json:"access_link,omitempty"` } // InvitationSend asks the notifier to dispatch a guest invitation email. // Carries everything the email template needs so the worker doesn't have // to re-fetch event/guest details from Postgres on every send. type InvitationSend struct { EventID uuid.UUID `json:"event_id"` GuestID uuid.UUID `json:"guest_id"` TokenID uuid.UUID `json:"token_id"` GuestName string `json:"guest_name"` GuestEmail string `json:"guest_email"` HostName string `json:"host_name"` EventName string `json:"event_name"` Venue string `json:"venue,omitempty"` EventDate time.Time `json:"event_date"` Link string `json:"link"` IssuedAt time.Time `json:"issued_at"` }