All checks were successful
Build and Deploy / deploy (push) Successful in 3m50s
Co-authored-by: Cursor <cursoragent@cursor.com>
483 lines
5.8 KiB
C#
483 lines
5.8 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
using Oms.Domain.MarketingAggregate.Enums;
|
|
|
|
|
|
|
|
namespace Oms.Application.Dtos.Marketing;
|
|
|
|
|
|
|
|
public class CouponTemplateListInput
|
|
|
|
{
|
|
|
|
public string? Keyword { get; set; }
|
|
|
|
|
|
|
|
public CouponTemplateStatus? Status { get; set; }
|
|
|
|
|
|
|
|
public int Page { get; set; }
|
|
|
|
|
|
|
|
public int PageSize { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CouponTemplateSaveInput
|
|
|
|
{
|
|
|
|
public int? Id { get; set; }
|
|
|
|
|
|
|
|
[Required]
|
|
|
|
public string TemplateCode { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
[Required]
|
|
|
|
public string TemplateName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
[Required]
|
|
|
|
public string CouponType { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public decimal? FaceValue { get; set; }
|
|
|
|
|
|
|
|
public decimal? DiscountRate { get; set; }
|
|
|
|
|
|
|
|
public decimal? MaxDiscountAmount { get; set; }
|
|
|
|
|
|
|
|
public decimal MinOrderAmount { get; set; }
|
|
|
|
|
|
|
|
public int TotalQuantity { get; set; }
|
|
|
|
|
|
|
|
public int PerCustomerLimit { get; set; } = 1;
|
|
|
|
|
|
|
|
public CouponValidType ValidType { get; set; } = CouponValidType.FixedDate;
|
|
|
|
|
|
|
|
public DateTime? ValidStartTime { get; set; }
|
|
|
|
|
|
|
|
public DateTime? ValidEndTime { get; set; }
|
|
|
|
|
|
|
|
public int? ValidDaysAfterReceive { get; set; }
|
|
|
|
|
|
|
|
public string? ApplyScopeJson { get; set; }
|
|
|
|
|
|
|
|
public string GrantChannel { get; set; } = "manual";
|
|
|
|
|
|
|
|
public string? Remark { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CouponTemplateOutput
|
|
|
|
{
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
public string TemplateCode { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public string TemplateName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public string CouponType { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public string CouponTypeName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public decimal? FaceValue { get; set; }
|
|
|
|
|
|
|
|
public decimal? DiscountRate { get; set; }
|
|
|
|
|
|
|
|
public decimal? MaxDiscountAmount { get; set; }
|
|
|
|
|
|
|
|
public decimal MinOrderAmount { get; set; }
|
|
|
|
|
|
|
|
public int TotalQuantity { get; set; }
|
|
|
|
|
|
|
|
public int IssuedQuantity { get; set; }
|
|
|
|
|
|
|
|
public int PerCustomerLimit { get; set; }
|
|
|
|
|
|
|
|
public CouponValidType ValidType { get; set; }
|
|
|
|
|
|
|
|
public DateTime? ValidStartTime { get; set; }
|
|
|
|
|
|
|
|
public DateTime? ValidEndTime { get; set; }
|
|
|
|
|
|
|
|
public int? ValidDaysAfterReceive { get; set; }
|
|
|
|
|
|
|
|
public string? ApplyScopeJson { get; set; }
|
|
|
|
|
|
|
|
public string GrantChannel { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public string GrantChannelName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public CouponTemplateStatus Status { get; set; }
|
|
|
|
|
|
|
|
public string StatusName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public string? Remark { get; set; }
|
|
|
|
|
|
|
|
public DateTime CreateTime { get; set; }
|
|
|
|
|
|
|
|
public DateTime? UpdateTime { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CouponGrantInput
|
|
|
|
{
|
|
|
|
[Required]
|
|
|
|
public int TemplateId { get; set; }
|
|
|
|
|
|
|
|
[Required]
|
|
|
|
[MinLength(1)]
|
|
|
|
public List<string> CustomerCodes { get; set; } = [];
|
|
|
|
|
|
|
|
public int QuantityPerCustomer { get; set; } = 1;
|
|
|
|
|
|
|
|
public string? Remark { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CouponGrantPreviewOutput
|
|
|
|
{
|
|
|
|
public int CustomerCount { get; set; }
|
|
|
|
|
|
|
|
public int TotalCoupons { get; set; }
|
|
|
|
|
|
|
|
public decimal EstimatedMaxDiscount { get; set; }
|
|
|
|
|
|
|
|
public string TemplateName { get; set; } = string.Empty;
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CouponInstanceListInput
|
|
|
|
{
|
|
|
|
public int? TemplateId { get; set; }
|
|
|
|
|
|
|
|
public int? CustomerId { get; set; }
|
|
|
|
|
|
|
|
/// <summary>客户编号(优先解析为主客户 Id 再筛选)。</summary>
|
|
public string? CustomerCode { get; set; }
|
|
|
|
|
|
|
|
public CouponInstanceStatus? Status { get; set; }
|
|
|
|
|
|
|
|
public string? Keyword { get; set; }
|
|
|
|
|
|
|
|
public int Page { get; set; }
|
|
|
|
|
|
|
|
public int PageSize { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CouponInstanceOutput
|
|
|
|
{
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
public int TemplateId { get; set; }
|
|
|
|
|
|
|
|
public string? TemplateName { get; set; }
|
|
|
|
|
|
|
|
public string? CouponType { get; set; }
|
|
|
|
|
|
|
|
public string? CouponTypeName { get; set; }
|
|
|
|
|
|
|
|
public string? GrantChannel { get; set; }
|
|
|
|
|
|
|
|
public string? GrantChannelName { get; set; }
|
|
|
|
|
|
|
|
public decimal? FaceValue { get; set; }
|
|
|
|
|
|
|
|
public decimal? DiscountRate { get; set; }
|
|
|
|
|
|
|
|
public decimal? MaxDiscountAmount { get; set; }
|
|
|
|
|
|
|
|
public decimal MinOrderAmount { get; set; }
|
|
|
|
|
|
|
|
public int CustomerId { get; set; }
|
|
|
|
|
|
|
|
public string? CustomerCode { get; set; }
|
|
|
|
|
|
|
|
public string CouponCode { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public CouponInstanceStatus Status { get; set; }
|
|
|
|
|
|
|
|
public string StatusName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public DateTime ReceiveTime { get; set; }
|
|
|
|
|
|
|
|
public DateTime ValidStartTime { get; set; }
|
|
|
|
|
|
|
|
public DateTime ValidEndTime { get; set; }
|
|
|
|
|
|
|
|
public DateTime? UseTime { get; set; }
|
|
|
|
|
|
|
|
public int? OrderId { get; set; }
|
|
|
|
|
|
|
|
public DateTime? LockExpireTime { get; set; }
|
|
|
|
public string? TemplateCode { get; set; }
|
|
|
|
public string? UnlockHint { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CouponMyListInput
|
|
|
|
{
|
|
|
|
public CouponInstanceStatus? Status { get; set; }
|
|
|
|
|
|
|
|
public int Page { get; set; }
|
|
|
|
|
|
|
|
public int PageSize { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CouponAvailableInput
|
|
|
|
{
|
|
|
|
public decimal? AmountAfterLevel { get; set; }
|
|
|
|
public decimal? BaseFreightAmount { get; set; }
|
|
|
|
public string? DestinationCountry { get; set; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class CouponAvailableOutput
|
|
|
|
{
|
|
|
|
public int CouponInstanceId { get; set; }
|
|
|
|
|
|
|
|
public string CouponCode { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public string TemplateName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public string CouponType { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
public decimal MinOrderAmount { get; set; }
|
|
|
|
|
|
|
|
public decimal? FaceValue { get; set; }
|
|
|
|
|
|
|
|
public decimal? DiscountRate { get; set; }
|
|
|
|
|
|
|
|
public decimal? MaxDiscountAmount { get; set; }
|
|
|
|
|
|
|
|
public DateTime ValidEndTime { get; set; }
|
|
|
|
|
|
|
|
public bool CanUse { get; set; }
|
|
|
|
|
|
|
|
public string? UnavailableReason { get; set; }
|
|
|
|
|
|
|
|
public decimal? EstimatedDiscount { get; set; }
|
|
|
|
}
|
|
|
|
|