fix: strip audit fields from channel price publish snapshots

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-07-23 11:55:21 +08:00
parent ecfaad3824
commit e2dca20966
5 changed files with 50 additions and 5 deletions

View File

@ -116,7 +116,7 @@ public class ServiceChannelPricePublishSnapshotDto
{
public int ServiceChannelId { get; set; }
public List<ServiceChannelPriceListOutput> Prices { get; set; } = [];
public List<ServiceChannelPriceSnapshotItemDto> Prices { get; set; } = [];
}
/// <summary>

View File

@ -90,3 +90,31 @@ public class SalesProductPriceSnapshotItemDto
public List<ChannelPriceDetailOutput> Details { get; set; } = [];
}
/// <summary>
/// 服务渠道卖价项快照(不含创建/更新时间)。
/// </summary>
public class ServiceChannelPriceSnapshotItemDto
{
public int Id { get; set; }
public int ServiceChannelId { get; set; }
public int SerialNumber { get; set; }
public byte Status { get; set; }
public string PriceName { get; set; } = string.Empty;
public string CostItem { get; set; } = string.Empty;
public string CostUnit { get; set; } = string.Empty;
public string Currency { get; set; } = string.Empty;
public string? ChargingCondition { get; set; }
public List<ChannelPriceFactorOutput> Factors { get; set; } = [];
public List<ChannelPriceDetailOutput> Details { get; set; } = [];
}

View File

@ -1,4 +1,5 @@
using Oms.Application.Dtos.Channels;
using Oms.Application.Dtos.Orders;
using Oms.Application.Dtos.Shared;
using Oms.Application.Shared;
using Oms.Domain.ChannelsAggregate.Entities;
@ -479,7 +480,7 @@ public partial class ServiceChannelService
}
}
private static ServiceChannelPriceSaveInput MapPriceSaveInput(ServiceChannelPriceListOutput output)
private static ServiceChannelPriceSaveInput MapPriceSaveInput(ServiceChannelPriceSnapshotItemDto output)
{
return new ServiceChannelPriceSaveInput
{
@ -525,7 +526,7 @@ public partial class ServiceChannelService
{
public int ServiceChannelId { get; set; }
public List<ServiceChannelPriceListOutput> Prices { get; set; } = [];
public List<ServiceChannelPriceSnapshotItemDto> Prices { get; set; } = [];
}
private sealed class ServiceChannelRulesPublishSnapshot

View File

@ -807,7 +807,7 @@ public partial class OrderService
{
return new ChannelPriceBinding
{
Prices = snapshot.Prices,
Prices = snapshot.Prices.Select(PublishSnapshotSlimmer.ToChannelPriceListOutput).ToList(),
PriceVersion = priceRecord.Version,
PriceEffectiveTime = priceRecord.PublishTime
};

View File

@ -24,7 +24,23 @@ public static class PublishSnapshotSlimmer
Details = price.Details
};
public static ServiceChannelPriceListOutput SlimChannelPrice(ServiceChannelPriceListOutput price) =>
public static ServiceChannelPriceSnapshotItemDto SlimChannelPrice(ServiceChannelPriceListOutput price) =>
new()
{
Id = price.Id,
ServiceChannelId = price.ServiceChannelId,
SerialNumber = price.SerialNumber,
Status = price.Status,
PriceName = price.PriceName,
CostItem = price.CostItem,
CostUnit = price.CostUnit,
Currency = price.Currency,
ChargingCondition = price.ChargingCondition,
Factors = price.Factors,
Details = price.Details
};
public static ServiceChannelPriceListOutput ToChannelPriceListOutput(ServiceChannelPriceSnapshotItemDto price) =>
new()
{
Id = price.Id,