namespace TakeoutSaaS.TenantApi.Contracts.Store;

/// <summary>
/// 阶梯包装费。
/// </summary>
public sealed class PackagingFeeTierDto
{
    /// <summary>
    /// Id。
    /// </summary>
    public string Id { get; set; } = string.Empty;
    /// <summary>
    /// MinAmount。
    /// </summary>
    public decimal MinAmount { get; set; }
    /// <summary>
    /// MaxAmount。
    /// </summary>
    public decimal? MaxAmount { get; set; }
    /// <summary>
    /// Fee。
    /// </summary>
    public decimal Fee { get; set; }
    /// <summary>
    /// Sort。
    /// </summary>
    public int Sort { get; set; }
}

/// <summary>
/// 附加费用项。
/// </summary>
public sealed class AdditionalFeeItemDto
{
    /// <summary>
    /// Enabled。
    /// </summary>
    public bool Enabled { get; set; }
    /// <summary>
    /// Amount。
    /// </summary>
    public decimal Amount { get; set; }
}

/// <summary>
/// 其他费用。
/// </summary>
public sealed class StoreOtherFeesDto
{
    /// <summary>
    /// Cutlery。
    /// </summary>
    public AdditionalFeeItemDto Cutlery { get; set; } = new();
    /// <summary>
    /// Rush。
    /// </summary>
    public AdditionalFeeItemDto Rush { get; set; } = new();
}

/// <summary>
/// 门店费用设置。
/// </summary>
public sealed class StoreFeesSettingsDto
{
    /// <summary>
    /// StoreId。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;
    /// <summary>
    /// IsConfigured。
    /// </summary>
    public bool IsConfigured { get; set; }
    /// <summary>
    /// MinimumOrderAmount。
    /// </summary>
    public decimal MinimumOrderAmount { get; set; }
    /// <summary>
    /// BaseDeliveryFee。
    /// </summary>
    public decimal BaseDeliveryFee { get; set; }
    /// <summary>
    /// PlatformServiceRate。
    /// </summary>
    public decimal PlatformServiceRate { get; set; }
    /// <summary>
    /// FreeDeliveryThreshold。
    /// </summary>
    public decimal? FreeDeliveryThreshold { get; set; }
    /// <summary>
    /// PackagingFeeMode。
    /// </summary>
    public string PackagingFeeMode { get; set; } = "order";
    /// <summary>
    /// OrderPackagingFeeMode。
    /// </summary>
    public string OrderPackagingFeeMode { get; set; } = "fixed";
    /// <summary>
    /// FixedPackagingFee。
    /// </summary>
    public decimal FixedPackagingFee { get; set; }
    /// <summary>
    /// PackagingFeeTiers。
    /// </summary>
    public List<PackagingFeeTierDto> PackagingFeeTiers { get; set; } = [];
    /// <summary>
    /// OtherFees。
    /// </summary>
    public StoreOtherFeesDto OtherFees { get; set; } = new();
}

/// <summary>
/// 保存包装费模式请求。
/// </summary>
public sealed class SaveStoreFeesModeRequest
{
    /// <summary>
    /// StoreId。
    /// </summary>
    public string StoreId { get; set; } = string.Empty;
    /// <summary>
    /// PackagingFeeMode。
    /// </summary>
    public string PackagingFeeMode { get; set; } = "order";
}

/// <summary>
/// 复制费用请求。
/// </summary>
public sealed class CopyStoreFeesSettingsRequest
{
    /// <summary>
    /// SourceStoreId。
    /// </summary>
    public string SourceStoreId { get; set; } = string.Empty;
    /// <summary>
    /// TargetStoreIds。
    /// </summary>
    public List<string> TargetStoreIds { get; set; } = [];
}

/// <summary>
/// 复制结果。
/// </summary>
public sealed class CopyStoreFeesSettingsResult
{
    /// <summary>
    /// CopiedCount。
    /// </summary>
    public int CopiedCount { get; set; }
}
