using MediatR;
using System.ComponentModel.DataAnnotations;
namespace TakeoutSaaS.Application.App.Subscriptions.Commands;
///
/// 批量延期订阅命令。
///
public sealed record BatchExtendSubscriptionsCommand : IRequest
{
///
/// 订阅ID列表。
///
[Required]
[MinLength(1, ErrorMessage = "至少需要选择一个订阅")]
public IReadOnlyList SubscriptionIds { get; init; } = Array.Empty();
///
/// 延期时长(天)。
///
[Range(1, 3650, ErrorMessage = "延期天数必须在1-3650天之间")]
public int? DurationDays { get; init; }
///
/// 延期时长(月)。
///
[Range(1, 120, ErrorMessage = "延期月数必须在1-120月之间")]
public int? DurationMonths { get; init; }
///
/// 备注信息。
///
[MaxLength(500)]
public string? Notes { get; init; }
}
///
/// 批量延期结果。
///
public record BatchExtendResult
{
///
/// 成功数量。
///
public int SuccessCount { get; init; }
///
/// 失败数量。
///
public int FailureCount { get; init; }
///
/// 失败详情列表。
///
public IReadOnlyList Failures { get; init; } = Array.Empty();
}
///
/// 批量操作失败项。
///
public record BatchFailureItem
{
///
/// 订阅ID。
///
public long SubscriptionId { get; init; }
///
/// 失败原因。
///
public string Reason { get; init; } = string.Empty;
}