namespace TakeoutSaaS.Application.App.Customers.Dto; /// /// 客户分析增长趋势点 DTO。 /// public sealed class CustomerAnalysisTrendPointDto { /// /// 维度标签。 /// public string Label { get; init; } = string.Empty; /// /// 数量值。 /// public int Value { get; init; } } /// /// 客户分析新老客构成项 DTO。 /// public sealed class CustomerAnalysisCompositionItemDto { /// /// 分群编码。 /// public string SegmentCode { get; init; } = string.Empty; /// /// 分群名称。 /// public string Label { get; init; } = string.Empty; /// /// 分群人数。 /// public int Count { get; init; } /// /// 分群占比(百分比)。 /// public decimal Percent { get; init; } /// /// 色调(blue/green/orange/gray)。 /// public string Tone { get; init; } = "blue"; } /// /// 客单价分布项 DTO。 /// public sealed class CustomerAnalysisAmountDistributionItemDto { /// /// 分群编码。 /// public string SegmentCode { get; init; } = string.Empty; /// /// 区间标签。 /// public string Label { get; init; } = string.Empty; /// /// 人数。 /// public int Count { get; init; } /// /// 占比(百分比)。 /// public decimal Percent { get; init; } } /// /// RFM 分层单元 DTO。 /// public sealed class CustomerAnalysisRfmCellDto { /// /// 分群编码。 /// public string SegmentCode { get; init; } = string.Empty; /// /// 分层标签。 /// public string Label { get; init; } = string.Empty; /// /// 人数。 /// public int Count { get; init; } /// /// 温度(hot/warm/cool/cold)。 /// public string Tone { get; init; } = "cold"; } /// /// RFM 分层行 DTO。 /// public sealed class CustomerAnalysisRfmRowDto { /// /// 行标签。 /// public string Label { get; init; } = string.Empty; /// /// 单元格集合。 /// public IReadOnlyList Cells { get; init; } = []; } /// /// 高价值客户 DTO。 /// public sealed class CustomerAnalysisTopCustomerDto { /// /// 排名。 /// public int Rank { get; init; } /// /// 客户标识。 /// public string CustomerKey { get; init; } = string.Empty; /// /// 客户名称。 /// public string Name { get; init; } = string.Empty; /// /// 手机号(脱敏)。 /// public string PhoneMasked { get; init; } = string.Empty; /// /// 累计消费。 /// public decimal TotalAmount { get; init; } /// /// 下单次数。 /// public int OrderCount { get; init; } /// /// 客单价。 /// public decimal AverageAmount { get; init; } /// /// 最近下单时间。 /// public DateTime LastOrderAt { get; init; } /// /// 客户标签。 /// public IReadOnlyList Tags { get; init; } = []; } /// /// 客户分析总览 DTO。 /// public sealed class CustomerAnalysisOverviewDto { /// /// 统计周期编码。 /// public string PeriodCode { get; init; } = "30d"; /// /// 统计周期天数。 /// public int PeriodDays { get; init; } = 30; /// /// 客户总数。 /// public int TotalCustomers { get; init; } /// /// 周期新增客户数。 /// public int NewCustomers { get; init; } /// /// 新增较上一周期增长百分比。 /// public decimal GrowthRatePercent { get; init; } /// /// 周期内日均新增客户。 /// public decimal NewCustomersDailyAverage { get; init; } /// /// 活跃客户数。 /// public int ActiveCustomers { get; init; } /// /// 活跃率(百分比)。 /// public decimal ActiveRatePercent { get; init; } /// /// 平均客户价值(累计消费均值)。 /// public decimal AverageLifetimeValue { get; init; } /// /// 客户增长趋势。 /// public IReadOnlyList GrowthTrend { get; init; } = []; /// /// 新老客占比。 /// public IReadOnlyList Composition { get; init; } = []; /// /// 客单价分布。 /// public IReadOnlyList AmountDistribution { get; init; } = []; /// /// RFM 分层。 /// public IReadOnlyList RfmRows { get; init; } = []; /// /// 高价值客户 Top10。 /// public IReadOnlyList TopCustomers { get; init; } = []; } /// /// 客群明细行 DTO。 /// public sealed class CustomerAnalysisSegmentListItemDto { /// /// 客户标识。 /// public string CustomerKey { get; init; } = string.Empty; /// /// 客户名称。 /// public string Name { get; init; } = string.Empty; /// /// 手机号(脱敏)。 /// public string PhoneMasked { get; init; } = string.Empty; /// /// 头像文案。 /// public string AvatarText { get; init; } = string.Empty; /// /// 头像颜色。 /// public string AvatarColor { get; init; } = string.Empty; /// /// 客户标签。 /// public IReadOnlyList Tags { get; init; } = []; /// /// 是否会员。 /// public bool IsMember { get; init; } /// /// 会员等级。 /// public string MemberTierName { get; init; } = string.Empty; /// /// 累计消费。 /// public decimal TotalAmount { get; init; } /// /// 下单次数。 /// public int OrderCount { get; init; } /// /// 客单价。 /// public decimal AverageAmount { get; init; } /// /// 注册时间。 /// public DateTime RegisteredAt { get; init; } /// /// 最近下单时间。 /// public DateTime LastOrderAt { get; init; } /// /// 是否弱化显示。 /// public bool IsDimmed { get; init; } } /// /// 客群明细结果 DTO。 /// public sealed class CustomerAnalysisSegmentListResultDto { /// /// 分群编码。 /// public string SegmentCode { get; init; } = string.Empty; /// /// 分群标题。 /// public string SegmentTitle { get; init; } = string.Empty; /// /// 分群说明。 /// public string SegmentDescription { get; init; } = string.Empty; /// /// 列表项。 /// public IReadOnlyList Items { get; init; } = []; /// /// 当前页。 /// public int Page { get; init; } /// /// 每页条数。 /// public int PageSize { get; init; } /// /// 总记录数。 /// public int TotalCount { get; init; } } /// /// 会员详情 DTO。 /// public sealed class CustomerMemberDetailDto { /// /// 客户标识。 /// public string CustomerKey { get; init; } = string.Empty; /// /// 客户名称。 /// public string Name { get; init; } = string.Empty; /// /// 手机号(脱敏)。 /// public string PhoneMasked { get; init; } = string.Empty; /// /// 来源。 /// public string Source { get; init; } = string.Empty; /// /// 注册时间。 /// public DateTime RegisteredAt { get; init; } /// /// 最近下单时间。 /// public DateTime LastOrderAt { get; init; } /// /// 会员摘要。 /// public CustomerMemberSummaryDto Member { get; init; } = new(); /// /// 客户标签。 /// public IReadOnlyList Tags { get; init; } = []; /// /// 累计下单次数。 /// public int TotalOrders { get; init; } /// /// 累计消费。 /// public decimal TotalAmount { get; init; } /// /// 客单价。 /// public decimal AverageAmount { get; init; } /// /// 复购率。 /// public decimal RepurchaseRatePercent { get; init; } /// /// 最近订单。 /// public IReadOnlyList RecentOrders { get; init; } = []; }