Files
TakeoutSaaS.TenantApi/src/Application/TakeoutSaaS.Application/App/Stores/Commands/UpdateStoreFeeCommand.cs
MSuMshk 725f89ae24 feat: Add tiered packaging fee support for stores
Introduces tiered packaging fee configuration for stores by adding OrderPackagingFeeMode and PackagingFeeTiers fields to StoreFee. Updates DTOs, validators, handlers, and mapping logic to support both fixed and tiered packaging fee modes. Adds StoreFeeTierHelper for tier normalization and serialization, and includes a database migration to persist the new fields.
2026-01-26 09:26:49 +08:00

52 lines
1.3 KiB
C#

using MediatR;
using TakeoutSaaS.Application.App.Stores.Dto;
using TakeoutSaaS.Domain.Stores.Enums;
namespace TakeoutSaaS.Application.App.Stores.Commands;
/// <summary>
/// 更新门店费用配置命令。
/// </summary>
public sealed record UpdateStoreFeeCommand : IRequest<StoreFeeDto>
{
/// <summary>
/// 门店 ID。
/// </summary>
public long StoreId { get; init; }
/// <summary>
/// 起送费。
/// </summary>
public decimal MinimumOrderAmount { get; init; }
/// <summary>
/// 配送费。
/// </summary>
public decimal DeliveryFee { get; init; }
/// <summary>
/// 打包费模式。
/// </summary>
public PackagingFeeMode PackagingFeeMode { get; init; }
/// <summary>
/// 订单打包费规则。
/// </summary>
public OrderPackagingFeeMode OrderPackagingFeeMode { get; init; } = OrderPackagingFeeMode.Fixed;
/// <summary>
/// 固定打包费。
/// </summary>
public decimal? FixedPackagingFee { get; init; }
/// <summary>
/// 阶梯打包费配置。
/// </summary>
public IReadOnlyList<StoreFeeTierDto> PackagingFeeTiers { get; init; } = [];
/// <summary>
/// 免配送费门槛。
/// </summary>
public decimal? FreeDeliveryThreshold { get; init; }
}