feat: 完善库存锁定幂等与批次扣减策略
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using MediatR;
|
||||
using TakeoutSaaS.Application.App.Inventory.Dto;
|
||||
|
||||
namespace TakeoutSaaS.Application.App.Inventory.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 锁定库存命令。
|
||||
/// </summary>
|
||||
public sealed record LockInventoryCommand : IRequest<InventoryItemDto>
|
||||
{
|
||||
/// <summary>
|
||||
/// 门店 ID。
|
||||
/// </summary>
|
||||
public long StoreId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// SKU ID。
|
||||
/// </summary>
|
||||
public long ProductSkuId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 锁定数量。
|
||||
/// </summary>
|
||||
public int Quantity { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否按预售逻辑锁定。
|
||||
/// </summary>
|
||||
public bool IsPresaleOrder { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 锁定过期时间(UTC),超时可释放。
|
||||
/// </summary>
|
||||
public DateTime? ExpiresAt { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 幂等键(同一键重复调用返回同一结果)。
|
||||
/// </summary>
|
||||
public string IdempotencyKey { get; init; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user