admin/src/Oms.Application/Dtos/Channels/SalesProductBillingSimulateDtos.cs
zzh c8107cb565 feat: add additional-service billing, conditions, and fee lifecycle hardening
Support optional services and executable billing conditions on sell/buy prices, percent-of-value and percent-of-freight formulas, place-order/inbound payable on chargeable weight, outbound receivable freeze, channel remote areas, billing simulate, and insurance-aware claims.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 18:04:28 +08:00

96 lines
2.4 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace Oms.Application.Dtos.Channels;
/// <summary>
/// 销售产品计费模拟入参(基于当前库内卖价,非必须已发布)。
/// </summary>
public class SalesProductBillingSimulateInput
{
[Required]
public int SalesProductId { get; set; }
[Required]
[StringLength(8)]
public string CountryCode { get; set; } = string.Empty;
[StringLength(64)]
public string? Province { get; set; }
[StringLength(64)]
public string? City { get; set; }
[StringLength(32)]
public string? ZipCode { get; set; }
[Required]
public decimal Length { get; set; }
[Required]
public decimal Width { get; set; }
[Required]
public decimal Height { get; set; }
[Required]
public decimal ActualWeight { get; set; }
[StringLength(32)]
public string? CargoAttribute { get; set; }
public int? WarehouseId { get; set; }
public List<string>? AdditionalServices { get; set; }
public decimal? DeclaredSum { get; set; }
[StringLength(16)]
public string? DeclaredCurrency { get; set; }
/// <summary>
/// 可选覆盖是否偏远;未传时按产品偏远分区命中。
/// </summary>
public bool? IsRemote { get; set; }
[StringLength(64)]
public string? PriceTierKey { get; set; }
}
/// <summary>
/// 销售产品计费模拟出参。
/// </summary>
public class SalesProductBillingSimulateOutput
{
public decimal ChargeableWeight { get; set; }
public List<string> ZoneKeys { get; set; } = [];
public bool IsRemote { get; set; }
public List<SalesProductBillingSimulateFeeOutput> ReceivableFees { get; set; } = [];
public List<SalesProductBillingSimulateFeeOutput> PayableFees { get; set; } = [];
public Dictionary<string, decimal> ReceivableTotal { get; set; } = new(StringComparer.OrdinalIgnoreCase);
public Dictionary<string, decimal> PayableTotal { get; set; } = new(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// 同币种毛利(应收合计 - 应付合计);多币种时为 null。
/// </summary>
public decimal? Margin { get; set; }
public List<string> Warnings { get; set; } = [];
}
public class SalesProductBillingSimulateFeeOutput
{
public string CostItem { get; set; } = string.Empty;
public decimal Amount { get; set; }
public string Currency { get; set; } = string.Empty;
public string? Formula { get; set; }
}