Initial commit

This commit is contained in:
2026-04-23 21:38:24 -04:00
commit 63e12a9636
1762 changed files with 1672620 additions and 0 deletions
@@ -0,0 +1,57 @@
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? 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<Job> Jobs { get; set; } = new List<Job>();
public virtual ICollection<Quote> Quotes { get; set; } = new List<Quote>();
public virtual ICollection<CustomerNote> CustomerNotes { get; set; } = new List<CustomerNote>();
// 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; }
/// <summary>Set when the customer replies STOP or is manually opted out. Null means they have never opted out.</summary>
public DateTime? SmsOptedOutAt { get; set; }
public virtual ICollection<NotificationLog> NotificationLogs { get; set; } = new List<NotificationLog>();
public virtual ICollection<Invoice> Invoices { get; set; } = new List<Invoice>();
}