Files
TakeoutSaaS.TenantApi/src/Domain/TakeoutSaaS.Domain/Stores/Entities/StoreFee.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

51 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using TakeoutSaaS.Domain.Stores.Enums;
using TakeoutSaaS.Shared.Abstractions.Entities;
namespace TakeoutSaaS.Domain.Stores.Entities;
/// <summary>
/// 门店费用配置。
/// </summary>
public sealed class StoreFee : MultiTenantEntityBase
{
/// <summary>
/// 门店标识。
/// </summary>
public long StoreId { get; set; }
/// <summary>
/// 起送费(元)。
/// </summary>
public decimal MinimumOrderAmount { get; set; } = 0m;
/// <summary>
/// 基础配送费(元)。
/// </summary>
public decimal BaseDeliveryFee { get; set; } = 0m;
/// <summary>
/// 打包费模式。
/// </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>
public decimal? FreeDeliveryThreshold { get; set; }
}