using PowderCoating.Core.Enums; namespace PowderCoating.Core.Entities; /// /// Represents one customer self-service intake session — either completed on the front-desk tablet /// (InPerson) or via an emailed link the customer fills out on their own device (Remote). /// Sessions are tenant-scoped and soft-deletable. Load anonymous sessions with ignoreQueryFilters:true. /// public class KioskSession : BaseEntity { /// URL-safe GUID used in all kiosk routes; unique across the table. public Guid SessionToken { get; set; } = Guid.NewGuid(); public KioskSessionType SessionType { get; set; } public KioskSessionStatus Status { get; set; } = KioskSessionStatus.Active; // ── Step 1 — Contact ───────────────────────────────────────────────────── public string CustomerFirstName { get; set; } = string.Empty; public string CustomerLastName { get; set; } = string.Empty; public string CustomerPhone { get; set; } = string.Empty; public string CustomerEmail { get; set; } = string.Empty; public bool IsReturningCustomer { get; set; } // ── Step 2 — Job Description ────────────────────────────────────────────── public string JobDescription { get; set; } = string.Empty; public string? HowDidYouHearAboutUs { get; set; } // ── Step 3 — Terms & Consent ────────────────────────────────────────────── public bool AgreedToTerms { get; set; } public DateTime? AgreedToTermsAt { get; set; } /// Customer opted in to SMS order updates; sets Customer.NotifyBySms on submission. public bool SmsOptIn { get; set; } /// Base-64 PNG from signature_pad; null for Remote sessions (no drawn signature required). public string? SignatureDataBase64 { get; set; } // ── Outcome ─────────────────────────────────────────────────────────────── public int? LinkedCustomerId { get; set; } /// Set when KioskIntakeOutput = "Job". Null when a Quote was created instead. public int? LinkedJobId { get; set; } /// Set when KioskIntakeOutput = "Quote". Null when a Job was created instead. public int? LinkedQuoteId { get; set; } public DateTime? SubmittedAt { get; set; } /// Sessions auto-expire 2 h after creation (InPerson) or 48 h (Remote). ExpiresAt is set at creation. public DateTime ExpiresAt { get; set; } // ── Remote-only ─────────────────────────────────────────────────────────── public string? RemoteLinkEmail { get; set; } public DateTime? RemoteLinkSentAt { get; set; } // ── Navigation ──────────────────────────────────────────────────────────── public virtual Customer? LinkedCustomer { get; set; } public virtual Job? LinkedJob { get; set; } }