admin/src/Oms.Application/Dtos/Orders/ProductBillingSnapshotDtos.cs
zzh 35156eedf4
All checks were successful
Build and Deploy / deploy (push) Successful in 1m1s
feat: 渠道买价/规则发布钉 KPI 分区包,排货应付按渠道价区解析
各渠道异构价区与偏远不再复用产品卖价 zoneKeys;发布只存包引用,计费 hydrate 后硬失败。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-07 17:19:39 +08:00

189 lines
5.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Text.Json.Serialization;
using Oms.Application.Dtos.Channels;
namespace Oms.Application.Dtos.Orders;
/// <summary>
/// 销售产品价格发布快照。
/// </summary>
public class SalesProductPricePublishSnapshotDto
{
/// <summary>
/// 销售产品主键。
/// </summary>
public int SalesProductId { get; set; }
/// <summary>
/// 价格分区 ID(单表时冗余展示;以 PriceAreaRefs 为准)。
/// </summary>
public int? PriceAreaId { get; set; }
/// <summary>
/// 价格分区名称。
/// </summary>
public string? PriceAreaName { get; set; }
/// <summary>
/// 价格分区包引用(发布时钉包;明细在 t_kpi_area_publish_record)。
/// </summary>
public List<KpiAreaPackRefDto> PriceAreaRefs { get; set; } = [];
/// <summary>
/// 运行时 hydrate / LIVE 用分区明细,不落发布 JSON。
/// </summary>
[JsonIgnore]
public List<KpiAreaSnapshotRuleDto> PriceAreaInfos { get; set; } = [];
/// <summary>
/// 价格项列表(不含创建/更新时间)。
/// </summary>
public List<SalesProductPriceSnapshotItemDto> Prices { get; set; } = [];
}
/// <summary>
/// 销售产品规则发布快照。
/// </summary>
public class SalesProductRulesPublishSnapshotDto
{
/// <summary>
/// 产品基础信息。
/// </summary>
public SalesProductSaveInput? Product { get; set; }
/// <summary>
/// 分配的服务商列表(发布快照,不含创建/更新时间)。
/// </summary>
public List<SalesProductAllocationProviderSnapshotDto> Providers { get; set; } = [];
/// <summary>
/// 黑名单分区 ID。
/// </summary>
public int? BlacklistAreaId { get; set; }
/// <summary>
/// 黑名单分区名称。
/// </summary>
public string? BlacklistAreaName { get; set; }
/// <summary>
/// 黑名单分区包引用。
/// </summary>
public KpiAreaPackRefDto? BlacklistAreaRef { get; set; }
/// <summary>
/// 运行时 hydrate / LIVE 用,不落发布 JSON。
/// </summary>
[JsonIgnore]
public List<KpiAreaSnapshotRuleDto> BlacklistAreaInfos { get; set; } = [];
/// <summary>
/// 偏远分区 ID。
/// </summary>
public int? RemoteAreaId { get; set; }
/// <summary>
/// 偏远分区名称。
/// </summary>
public string? RemoteAreaName { get; set; }
/// <summary>
/// 偏远分区包引用。
/// </summary>
public KpiAreaPackRefDto? RemoteAreaRef { get; set; }
/// <summary>
/// 运行时 hydrate / LIVE 用,不落发布 JSON。
/// </summary>
[JsonIgnore]
public List<KpiAreaSnapshotRuleDto> RemoteAreaInfos { get; set; } = [];
/// <summary>
/// 计重规则 ID(发布时固化)。
/// </summary>
public int? WeightRuleId { get; set; }
/// <summary>
/// 计重规则名称。
/// </summary>
public string? WeightRuleName { get; set; }
/// <summary>
/// 计重规则明细,发布时从 t_weight_rule_info 固化。
/// </summary>
public List<WeightRuleSnapshotRuleDto> WeightRuleInfos { get; set; } = [];
/// <summary>
/// 计重进位 ID(发布时固化)。
/// </summary>
public int? WeightRoundingId { get; set; }
/// <summary>
/// 计重进位名称。
/// </summary>
public string? WeightRoundingName { get; set; }
/// <summary>
/// 计重进位区间,发布时从 t_weight_rounding_info 固化。
/// </summary>
public List<WeightRoundingSnapshotRangeDto> WeightRoundingInfos { get; set; } = [];
}
/// <summary>
/// 服务渠道买价发布快照(渠道自有价区,与产品卖价分区独立)。
/// </summary>
public class ServiceChannelPricePublishSnapshotDto
{
public int ServiceChannelId { get; set; }
/// <summary>价格分区 ID(单表时冗余展示;以 PriceAreaRefs 为准)。</summary>
public int? PriceAreaId { get; set; }
/// <summary>价格分区名称。</summary>
public string? PriceAreaName { get; set; }
/// <summary>渠道价区包引用(买价发布时钉包)。</summary>
public List<KpiAreaPackRefDto> PriceAreaRefs { get; set; } = [];
/// <summary>运行时 hydrate / LIVE 用,不落发布 JSON。</summary>
[JsonIgnore]
public List<KpiAreaSnapshotRuleDto> PriceAreaInfos { get; set; } = [];
public List<ServiceChannelPriceSnapshotItemDto> Prices { get; set; } = [];
}
/// <summary>
/// 绑定到订单的快照版本信息。
/// </summary>
public class ProductSnapshotBinding
{
/// <summary>
/// 规则快照版本号。
/// </summary>
public string RulesVersion { get; set; } = string.Empty;
/// <summary>
/// 价格快照版本号。
/// </summary>
public string PriceVersion { get; set; } = string.Empty;
/// <summary>
/// 规则快照生效时间。
/// </summary>
public DateTime RulesEffectiveTime { get; set; }
/// <summary>
/// 价格快照生效时间。
/// </summary>
public DateTime PriceEffectiveTime { get; set; }
/// <summary>
/// 规则快照内容。
/// </summary>
public SalesProductRulesPublishSnapshotDto Rules { get; set; } = new();
/// <summary>
/// 价格快照内容。
/// </summary>
public SalesProductPricePublishSnapshotDto Price { get; set; } = new();
}