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.
This commit is contained in:
@@ -28,11 +28,21 @@ public sealed class StoreFee : MultiTenantEntityBase
|
||||
/// </summary>
|
||||
public PackagingFeeMode PackagingFeeMode { get; set; } = PackagingFeeMode.Fixed;
|
||||
|
||||
/// <summary>
|
||||
/// 订单打包费规则(按订单收费时生效)。
|
||||
/// </summary>
|
||||
public OrderPackagingFeeMode OrderPackagingFeeMode { get; set; } = OrderPackagingFeeMode.Fixed;
|
||||
|
||||
/// <summary>
|
||||
/// 固定打包费(总计模式有效)。
|
||||
/// </summary>
|
||||
public decimal FixedPackagingFee { get; set; } = 0m;
|
||||
|
||||
/// <summary>
|
||||
/// 阶梯打包费配置(JSON)。
|
||||
/// </summary>
|
||||
public string? PackagingFeeTiersJson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 免配送费门槛。
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace TakeoutSaaS.Domain.Stores.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 订单打包费计算规则。
|
||||
/// </summary>
|
||||
public enum OrderPackagingFeeMode
|
||||
{
|
||||
/// <summary>
|
||||
/// 一口价。
|
||||
/// </summary>
|
||||
Fixed = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 阶梯价。
|
||||
/// </summary>
|
||||
Tiered = 1
|
||||
}
|
||||
Reference in New Issue
Block a user