feat: 完善库存锁定幂等与批次扣减策略
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using TakeoutSaaS.Shared.Abstractions.Serialization;
|
||||
|
||||
namespace TakeoutSaaS.Application.App.Inventory.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 库存项 DTO。
|
||||
/// </summary>
|
||||
public sealed record InventoryItemDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 库存记录 ID。
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||||
public long Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 租户 ID。
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||||
public long TenantId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 门店 ID。
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||||
public long StoreId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// SKU ID。
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
|
||||
public long ProductSkuId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次号。
|
||||
/// </summary>
|
||||
public string? BatchNumber { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 可用库存。
|
||||
/// </summary>
|
||||
public int QuantityOnHand { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 已锁定库存。
|
||||
/// </summary>
|
||||
public int QuantityReserved { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 安全库存。
|
||||
/// </summary>
|
||||
public int? SafetyStock { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 储位。
|
||||
/// </summary>
|
||||
public string? Location { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 过期日期。
|
||||
/// </summary>
|
||||
public DateTime? ExpireDate { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否预售。
|
||||
/// </summary>
|
||||
public bool IsPresale { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 预售开始时间。
|
||||
/// </summary>
|
||||
public DateTime? PresaleStartTime { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 预售结束时间。
|
||||
/// </summary>
|
||||
public DateTime? PresaleEndTime { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 预售上限。
|
||||
/// </summary>
|
||||
public int? PresaleCapacity { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 已锁定预售量。
|
||||
/// </summary>
|
||||
public int PresaleLocked { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 限购数量。
|
||||
/// </summary>
|
||||
public int? MaxQuantityPerOrder { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否售罄。
|
||||
/// </summary>
|
||||
public bool IsSoldOut { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user