3f8bc58ca9
Phase 1 — Core API (Go): - Events, guests, tokens, RSVPs CRUD on PostgreSQL via pgx/v5 - HMAC-signed per-guest tokens with format validation - Health endpoint with DB ping, slog JSON logging, graceful shutdown Phase 2 — NATS + Fraud Engine: - NATS JetStream pub/sub with explicit-ack consumers - Python/FastAPI fraud engine with heuristic risk scoring (fingerprint mismatch, IP change, missing signals, repeated access) - gRPC sync scoring with 250ms fail-open timeout - Per-guest baseline tracking; risk bands low/medium/high/block Phase 3 — Notifications + Frontend: - Notification worker scaffolding (Twilio/SES stubs, retry/backoff) - Nuxt 3 frontend with Tailwind dark theme + brand green - Live monitor via WebSocket with auto-reconnect - Activity history endpoint backfills monitor with RSVPs + scored access checks (including blocked attempts) UX polish: - Marketing-friendly landing page (hero mockup, how-it-works, features, use cases, testimonials, FAQ, final CTA) - Animated layered card mockups on landing + new-event page - Plus-ones stepper, RSVP status badges, filter buttons - Friendly access-check labels (Verified/Review/Suspicious/Blocked) - Dashboard hydration fix via ClientOnly wrapper Infrastructure: - docker-compose for full local dev (postgres, nats, api, fraud-engine, notifier, frontend) - Multi-stage Dockerfiles, non-root UID 1000 - Integration tests with testcontainers-go Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
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"`
|
|
}
|
|
|
|
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"`
|
|
}
|