refactor: 删除审核接口的 renewMonths 字段

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
MSuMshk
2026-02-02 21:14:46 +08:00
parent 2c90aa6f5c
commit a995d3c64d
2 changed files with 4 additions and 19 deletions

View File

@@ -23,11 +23,6 @@ public sealed record ReviewTenantCommand : IRequest
/// </summary>
public string? Reason { get; init; }
/// <summary>
/// 续费时长(月)(仅当 Approve=true 时有效)。
/// </summary>
public int? RenewMonths { get; init; }
/// <summary>
/// 经营模式(仅当 Approve=true 时有效)。
/// </summary>

View File

@@ -109,33 +109,23 @@ public sealed class ReviewTenantCommandHandler(
tenant.OperatingMode = request.OperatingMode.Value;
}
// 3. 更新订阅有效期(如果指定了续费时长)
if (request.RenewMonths.HasValue && request.RenewMonths.Value > 0)
{
var now = DateTime.UtcNow;
var effectiveFrom = tenant.EffectiveFrom ?? now;
var effectiveTo = effectiveFrom.AddMonths(request.RenewMonths.Value);
tenant.EffectiveFrom = effectiveFrom;
tenant.EffectiveTo = effectiveTo;
}
// 4. 更新认证资料状态
// 3. 更新认证资料状态
verification.Status = TenantVerificationStatus.Approved;
verification.ReviewedAt = DateTime.UtcNow;
verification.ReviewedBy = currentUserAccessor.UserId;
verification.ReviewedByName = actorName;
// 5. 释放领取
// 4. 释放领取
claim.ReleasedAt = DateTime.UtcNow;
// 6. 添加审核日志
// 5. 添加审核日志
await tenantRepository.AddAuditLogAsync(new TenantAuditLog
{
Id = idGenerator.NextId(),
TenantId = tenant.Id,
Action = TenantAuditAction.Approved,
Title = "审核通过",
Description = $"审核人:{actorName},续费时长:{request.RenewMonths ?? 0}个月",
Description = $"审核人:{actorName}",
OperatorId = currentUserAccessor.UserId,
OperatorName = actorName,
PreviousStatus = TenantStatus.PendingReview,