feat: tenant detail 返回实名与套餐详情
This commit is contained in:
@@ -19,4 +19,9 @@ public sealed class TenantDetailDto
|
|||||||
/// 当前订阅。
|
/// 当前订阅。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TenantSubscriptionDto? Subscription { get; init; }
|
public TenantSubscriptionDto? Subscription { get; init; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前套餐详情。
|
||||||
|
/// </summary>
|
||||||
|
public TenantPackageDto? Package { get; init; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,21 @@ public sealed class TenantVerificationDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? LegalPersonIdNumber { get; init; }
|
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>
|
||||||
/// 银行账号。
|
/// 银行账号。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -56,6 +71,22 @@ public sealed class TenantVerificationDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? BankName { get; init; }
|
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>
|
||||||
/// 审核备注。
|
/// 审核备注。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -10,7 +10,9 @@ namespace TakeoutSaaS.Application.App.Tenants.Handlers;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 租户详情查询处理器。
|
/// 租户详情查询处理器。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class GetTenantByIdQueryHandler(ITenantRepository tenantRepository)
|
public sealed class GetTenantByIdQueryHandler(
|
||||||
|
ITenantRepository tenantRepository,
|
||||||
|
ITenantPackageRepository tenantPackageRepository)
|
||||||
: IRequestHandler<GetTenantByIdQuery, TenantDetailDto>
|
: IRequestHandler<GetTenantByIdQuery, TenantDetailDto>
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -24,12 +26,18 @@ public sealed class GetTenantByIdQueryHandler(ITenantRepository tenantRepository
|
|||||||
var subscription = await tenantRepository.GetActiveSubscriptionAsync(request.TenantId, cancellationToken);
|
var subscription = await tenantRepository.GetActiveSubscriptionAsync(request.TenantId, cancellationToken);
|
||||||
var verification = await tenantRepository.GetVerificationProfileAsync(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
|
return new TenantDetailDto
|
||||||
{
|
{
|
||||||
Tenant = TenantMapping.ToDto(tenant, subscription, verification),
|
Tenant = TenantMapping.ToDto(tenant, subscription, verification),
|
||||||
Verification = verification.ToVerificationDto(),
|
Verification = verification.ToVerificationDto(),
|
||||||
Subscription = subscription.ToSubscriptionDto()
|
Subscription = subscription.ToSubscriptionDto(),
|
||||||
|
Package = package?.ToDto()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,9 +50,15 @@ internal static class TenantMapping
|
|||||||
BusinessLicenseUrl = profile.BusinessLicenseUrl,
|
BusinessLicenseUrl = profile.BusinessLicenseUrl,
|
||||||
LegalPersonName = profile.LegalPersonName,
|
LegalPersonName = profile.LegalPersonName,
|
||||||
LegalPersonIdNumber = profile.LegalPersonIdNumber,
|
LegalPersonIdNumber = profile.LegalPersonIdNumber,
|
||||||
|
LegalPersonIdFrontUrl = profile.LegalPersonIdFrontUrl,
|
||||||
|
LegalPersonIdBackUrl = profile.LegalPersonIdBackUrl,
|
||||||
|
BankAccountName = profile.BankAccountName,
|
||||||
BankAccountNumber = profile.BankAccountNumber,
|
BankAccountNumber = profile.BankAccountNumber,
|
||||||
BankName = profile.BankName,
|
BankName = profile.BankName,
|
||||||
|
AdditionalDataJson = profile.AdditionalDataJson,
|
||||||
|
SubmittedAt = profile.SubmittedAt,
|
||||||
ReviewRemarks = profile.ReviewRemarks,
|
ReviewRemarks = profile.ReviewRemarks,
|
||||||
|
ReviewedBy = profile.ReviewedBy,
|
||||||
ReviewedByName = profile.ReviewedByName,
|
ReviewedByName = profile.ReviewedByName,
|
||||||
ReviewedAt = profile.ReviewedAt
|
ReviewedAt = profile.ReviewedAt
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user