131 lines
3.1 KiB
C#
131 lines
3.1 KiB
C#
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; } = [];
|
||
}
|