namespace IntelligenceApi.Models; // ════════════════════════════════════════════════ // Request: Gateway → IntelligenceApi // Gateway sends raw census data fetched from DB, // plus the ZCTA for context. // ════════════════════════════════════════════════ public sealed class DemographicAnalysisRequest { /// 5-digit ZIP code / ZCTA public string Zcta { get; set; } = string.Empty; /// /// Raw census row from spDemographics. /// All numeric fields; nulls treated as zero. /// public CensusData Census { get; set; } = new(); } public sealed class CensusData { public int TotalPopulation { get; set; } public int TotalHouseholds { get; set; } public int MedianIncome { get; set; } public int MedianHomeValue { get; set; } public decimal Pct18to24 { get; set; } public decimal Pct25to34 { get; set; } public decimal Pct35to44 { get; set; } public decimal Pct45to54 { get; set; } public decimal Pct55to64 { get; set; } public decimal Pct65plus { get; set; } public decimal PctBachelorPlus { get; set; } public decimal PctOwnerOccupied { get; set; } public decimal PctRenterOccupied { get; set; } public decimal PctFamilyHouseholds { get; set; } public decimal PctLivingAlone { get; set; } public decimal PctHispanic { get; set; } public decimal PctAsian { get; set; } public decimal PctBlack { get; set; } public decimal PctRemoteWork { get; set; } public decimal PctPublicTransit { get; set; } public decimal UnemploymentRate { get; set; } public decimal PctIncomeUnder30k { get; set; } public decimal PctIncome30kTo75k { get; set; } public decimal PctIncome75kTo150k { get; set; } public decimal PctIncome150kPlus { get; set; } } // ════════════════════════════════════════════════ // Response: IntelligenceApi → Gateway → Client // ════════════════════════════════════════════════ public sealed class DemographicAnalysisResponse { public bool Ok { get; set; } = true; public string Zcta { get; set; } = string.Empty; /// Raw census metrics passed through for display public CensusData Census { get; set; } = new(); /// Derived recommendations for wizard chip auto-population public AudienceRecommendations Recommendations { get; set; } = new(); /// Human-readable summary strings for the insight bar public List Insights { get; set; } = new(); } public sealed class AudienceRecommendations { public List AgeRanges { get; set; } = new(); public List Incomes { get; set; } = new(); public string AgeSkew { get; set; } = "balanced"; public string MarketScope { get; set; } = "local"; }