feat: tenant detail 返回实名与套餐详情
This commit is contained in:
@@ -19,4 +19,9 @@ public sealed class TenantDetailDto
|
||||
/// 当前订阅。
|
||||
/// </summary>
|
||||
public TenantSubscriptionDto? Subscription { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前套餐详情。
|
||||
/// </summary>
|
||||
public TenantPackageDto? Package { get; init; }
|
||||
}
|
||||
|
||||
@@ -46,6 +46,21 @@ public sealed class TenantVerificationDto
|
||||
/// </summary>
|
||||
public string? LegalPersonIdNumber { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 法人身份证正面。
|
||||
/// </summary>
|
||||
public string? LegalPersonIdFrontUrl { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 法人身份证反面。
|
||||
/// </summary>
|
||||
public string? LegalPersonIdBackUrl { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 开户名。
|
||||
/// </summary>
|
||||
public string? BankAccountName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 银行账号。
|
||||
/// </summary>
|
||||
@@ -56,6 +71,22 @@ public sealed class TenantVerificationDto
|
||||
/// </summary>
|
||||
public string? BankName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 附加资料(JSON)。
|
||||
/// </summary>
|
||||
public string? AdditionalDataJson { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 提交时间。
|
||||
/// </summary>
|
||||
public DateTime? SubmittedAt { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核人 ID。
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(NullableSnowflakeIdJsonConverter))]
|
||||
public long? ReviewedBy { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核备注。
|
||||
/// </summary>
|
||||
|
||||
@@ -10,7 +10,9 @@ namespace TakeoutSaaS.Application.App.Tenants.Handlers;
|
||||
/// <summary>
|
||||
/// 租户详情查询处理器。
|
||||
/// </summary>
|
||||
public sealed class GetTenantByIdQueryHandler(ITenantRepository tenantRepository)
|
||||
public sealed class GetTenantByIdQueryHandler(
|
||||
ITenantRepository tenantRepository,
|
||||
ITenantPackageRepository tenantPackageRepository)
|
||||
: IRequestHandler<GetTenantByIdQuery, TenantDetailDto>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@@ -24,12 +26,18 @@ public sealed class GetTenantByIdQueryHandler(ITenantRepository tenantRepository
|
||||
var subscription = await tenantRepository.GetActiveSubscriptionAsync(request.TenantId, cancellationToken);
|
||||
var verification = await tenantRepository.GetVerificationProfileAsync(request.TenantId, cancellationToken);
|
||||
|
||||
// 3. 组装返回
|
||||
// 3. (空行后) 查询当前套餐
|
||||
var package = subscription == null
|
||||
? null
|
||||
: await tenantPackageRepository.FindByIdAsync(subscription.TenantPackageId, cancellationToken);
|
||||
|
||||
// 4. (空行后) 组装返回
|
||||
return new TenantDetailDto
|
||||
{
|
||||
Tenant = TenantMapping.ToDto(tenant, subscription, verification),
|
||||
Verification = verification.ToVerificationDto(),
|
||||
Subscription = subscription.ToSubscriptionDto()
|
||||
Subscription = subscription.ToSubscriptionDto(),
|
||||
Package = package?.ToDto()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,15 @@ internal static class TenantMapping
|
||||
BusinessLicenseUrl = profile.BusinessLicenseUrl,
|
||||
LegalPersonName = profile.LegalPersonName,
|
||||
LegalPersonIdNumber = profile.LegalPersonIdNumber,
|
||||
LegalPersonIdFrontUrl = profile.LegalPersonIdFrontUrl,
|
||||
LegalPersonIdBackUrl = profile.LegalPersonIdBackUrl,
|
||||
BankAccountName = profile.BankAccountName,
|
||||
BankAccountNumber = profile.BankAccountNumber,
|
||||
BankName = profile.BankName,
|
||||
AdditionalDataJson = profile.AdditionalDataJson,
|
||||
SubmittedAt = profile.SubmittedAt,
|
||||
ReviewRemarks = profile.ReviewRemarks,
|
||||
ReviewedBy = profile.ReviewedBy,
|
||||
ReviewedByName = profile.ReviewedByName,
|
||||
ReviewedAt = profile.ReviewedAt
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user