App:新增 operation_logs/quota_packages/tenant_payments/tenant_quota_package_purchases 表 Identity:修正 Avatar 字段类型(varchar(256)->text),保持现有数据不变
73 lines
1.8 KiB
C#
73 lines
1.8 KiB
C#
using MediatR;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace TakeoutSaaS.Application.App.Subscriptions.Commands;
|
|
|
|
/// <summary>
|
|
/// 批量延期订阅命令。
|
|
/// </summary>
|
|
public sealed record BatchExtendSubscriptionsCommand : IRequest<BatchExtendResult>
|
|
{
|
|
/// <summary>
|
|
/// 订阅ID列表。
|
|
/// </summary>
|
|
[Required]
|
|
[MinLength(1, ErrorMessage = "至少需要选择一个订阅")]
|
|
public IReadOnlyList<long> SubscriptionIds { get; init; } = Array.Empty<long>();
|
|
|
|
/// <summary>
|
|
/// 延期时长(天)。
|
|
/// </summary>
|
|
[Range(1, 3650, ErrorMessage = "延期天数必须在1-3650天之间")]
|
|
public int? DurationDays { get; init; }
|
|
|
|
/// <summary>
|
|
/// 延期时长(月)。
|
|
/// </summary>
|
|
[Range(1, 120, ErrorMessage = "延期月数必须在1-120月之间")]
|
|
public int? DurationMonths { get; init; }
|
|
|
|
/// <summary>
|
|
/// 备注信息。
|
|
/// </summary>
|
|
[MaxLength(500)]
|
|
public string? Notes { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 批量延期结果。
|
|
/// </summary>
|
|
public record BatchExtendResult
|
|
{
|
|
/// <summary>
|
|
/// 成功数量。
|
|
/// </summary>
|
|
public int SuccessCount { get; init; }
|
|
|
|
/// <summary>
|
|
/// 失败数量。
|
|
/// </summary>
|
|
public int FailureCount { get; init; }
|
|
|
|
/// <summary>
|
|
/// 失败详情列表。
|
|
/// </summary>
|
|
public IReadOnlyList<BatchFailureItem> Failures { get; init; } = Array.Empty<BatchFailureItem>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 批量操作失败项。
|
|
/// </summary>
|
|
public record BatchFailureItem
|
|
{
|
|
/// <summary>
|
|
/// 订阅ID。
|
|
/// </summary>
|
|
public long SubscriptionId { get; init; }
|
|
|
|
/// <summary>
|
|
/// 失败原因。
|
|
/// </summary>
|
|
public string Reason { get; init; } = string.Empty;
|
|
}
|