namespace PowderCoating.Core.Entities; public class Customer : BaseEntity { public string? CompanyName { get; set; } public string? ContactFirstName { get; set; } public string? ContactLastName { get; set; } public string? Email { get; set; } public string? BillingEmail { get; set; } // Accounting/invoicing email for commercial customers public string? Phone { get; set; } public string? MobilePhone { get; set; } public string? Address { get; set; } public string? City { get; set; } public string? State { get; set; } public string? ZipCode { get; set; } public string? Country { get; set; } = "USA"; // Business Information public bool IsCommercial { get; set; } public string? TaxId { get; set; } public decimal CreditLimit { get; set; } public decimal CurrentBalance { get; set; } public decimal CreditBalance { get; set; } // Available store credit (credit memos) public string? PaymentTerms { get; set; } public int? PricingTierId { get; set; } // Tax Exemption public bool IsTaxExempt { get; set; } public byte[]? TaxExemptCertificateData { get; set; } public string? TaxExemptCertificateContentType { get; set; } public string? TaxExemptCertificateFileName { get; set; } // Relationships public virtual PricingTier? PricingTier { get; set; } public virtual ICollection Jobs { get; set; } = new List(); public virtual ICollection Quotes { get; set; } = new List(); public virtual ICollection CustomerNotes { get; set; } = new List(); // Additional fields public string? GeneralNotes { get; set; } public bool IsActive { get; set; } = true; public DateTime? LastContactDate { get; set; } // Notification preferences public bool NotifyByEmail { get; set; } = true; // NotifyBySms is only set to true after explicit staff-recorded consent (TCPA compliance) public bool NotifyBySms { get; set; } = false; // Unique token used in email unsubscribe links (no auth required) public string UnsubscribeToken { get; set; } = Guid.NewGuid().ToString("N"); // SMS consent tracking (TCPA compliance) public DateTime? SmsConsentedAt { get; set; } public string? SmsConsentMethod { get; set; } /// Set when the customer replies STOP or is manually opted out. Null means they have never opted out. public DateTime? SmsOptedOutAt { get; set; } public virtual ICollection NotificationLogs { get; set; } = new List(); public virtual ICollection Invoices { get; set; } = new List(); }