Files
TakeoutSaaS.TenantApi/src/Application/TakeoutSaaS.Application/App/Coupons/PunchCard/Commands/SavePunchCardTemplateCommand.cs

131 lines
3.1 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 MediatR;
using TakeoutSaaS.Application.App.Coupons.PunchCard.Dto;
namespace TakeoutSaaS.Application.App.Coupons.PunchCard.Commands;
/// <summary>
/// 保存次卡模板命令。
/// </summary>
public sealed class SavePunchCardTemplateCommand : IRequest<PunchCardDetailDto>
{
/// <summary>
/// 操作门店 ID。
/// </summary>
public long StoreId { get; init; }
/// <summary>
/// 次卡模板 ID编辑时传
/// </summary>
public long? TemplateId { get; init; }
/// <summary>
/// 次卡名称。
/// </summary>
public string Name { get; init; } = string.Empty;
/// <summary>
/// 封面图。
/// </summary>
public string? CoverImageUrl { get; init; }
/// <summary>
/// 售价。
/// </summary>
public decimal SalePrice { get; init; }
/// <summary>
/// 原价。
/// </summary>
public decimal? OriginalPrice { get; init; }
/// <summary>
/// 总次数。
/// </summary>
public int TotalTimes { get; init; }
/// <summary>
/// 有效期类型days/range
/// </summary>
public string ValidityType { get; init; } = "days";
/// <summary>
/// 固定天数。
/// </summary>
public int? ValidityDays { get; init; }
/// <summary>
/// 固定开始日期。
/// </summary>
public DateTime? ValidFrom { get; init; }
/// <summary>
/// 固定结束日期。
/// </summary>
public DateTime? ValidTo { get; init; }
/// <summary>
/// 范围类型all/category/tag/product
/// </summary>
public string ScopeType { get; init; } = "all";
/// <summary>
/// 指定分类 ID。
/// </summary>
public IReadOnlyCollection<long> ScopeCategoryIds { get; init; } = [];
/// <summary>
/// 指定标签 ID。
/// </summary>
public IReadOnlyCollection<long> ScopeTagIds { get; init; } = [];
/// <summary>
/// 指定商品 ID。
/// </summary>
public IReadOnlyCollection<long> ScopeProductIds { get; init; } = [];
/// <summary>
/// 使用模式free/cap
/// </summary>
public string UsageMode { get; init; } = "free";
/// <summary>
/// 单次上限金额。
/// </summary>
public decimal? UsageCapAmount { get; init; }
/// <summary>
/// 每日限用次数。
/// </summary>
public int? DailyLimit { get; init; }
/// <summary>
/// 每单限用次数。
/// </summary>
public int? PerOrderLimit { get; init; }
/// <summary>
/// 每人限购张数。
/// </summary>
public int? PerUserPurchaseLimit { get; init; }
/// <summary>
/// 是否允许转赠。
/// </summary>
public bool AllowTransfer { get; init; }
/// <summary>
/// 过期策略invalidate/refund
/// </summary>
public string ExpireStrategy { get; init; } = "invalidate";
/// <summary>
/// 次卡说明。
/// </summary>
public string? Description { get; init; }
/// <summary>
/// 通知渠道in_app/sms
/// </summary>
public IReadOnlyCollection<string> NotifyChannels { get; init; } = [];
}