feat: add public tenant packages listing and sort order

This commit is contained in:
2025-12-11 23:57:04 +08:00
parent cf9927c078
commit c7df64f2e1
28 changed files with 731 additions and 5 deletions

View File

@@ -0,0 +1,47 @@
using System.Text.Json.Serialization;
using TakeoutSaaS.Domain.Tenants.Enums;
using TakeoutSaaS.Shared.Abstractions.Serialization;
namespace TakeoutSaaS.Application.App.Tenants.Dto;
/// <summary>
/// 自助注册结果 DTO。
/// </summary>
public sealed class SelfRegisterResultDto
{
/// <summary>
/// 租户 ID。
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long TenantId { get; init; }
/// <summary>
/// 租户编码。
/// </summary>
public string Code { get; init; } = string.Empty;
/// <summary>
/// 初始状态。
/// </summary>
public TenantStatus Status { get; init; } = TenantStatus.PendingReview;
/// <summary>
/// 当前实名状态。
/// </summary>
public TenantVerificationStatus VerificationStatus { get; init; } = TenantVerificationStatus.Draft;
/// <summary>
/// 订阅开始时间。
/// </summary>
public DateTime? EffectiveFrom { get; init; }
/// <summary>
/// 订阅到期时间。
/// </summary>
public DateTime? EffectiveTo { get; init; }
/// <summary>
/// 初始管理员账号。
/// </summary>
public string AdminAccount { get; init; } = string.Empty;
}

View File

@@ -74,4 +74,9 @@ public sealed class TenantPackageDto
/// 是否可售。
/// </summary>
public bool IsActive { get; init; }
/// <summary>
/// 展示排序,数值越小越靠前。
/// </summary>
public int SortOrder { get; init; }
}

View File

@@ -0,0 +1,42 @@
using System.Text.Json.Serialization;
using TakeoutSaaS.Domain.Tenants.Enums;
using TakeoutSaaS.Shared.Abstractions.Serialization;
namespace TakeoutSaaS.Application.App.Tenants.Dto;
/// <summary>
/// 租户入住进度 DTO。
/// </summary>
public sealed class TenantProgressDto
{
/// <summary>
/// 租户 ID。
/// </summary>
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long TenantId { get; init; }
/// <summary>
/// 租户编码。
/// </summary>
public string Code { get; init; } = string.Empty;
/// <summary>
/// 当前租户状态。
/// </summary>
public TenantStatus Status { get; init; }
/// <summary>
/// 实名审核状态。
/// </summary>
public TenantVerificationStatus VerificationStatus { get; init; }
/// <summary>
/// 当前订阅开始时间。
/// </summary>
public DateTime? EffectiveFrom { get; init; }
/// <summary>
/// 当前订阅到期时间。
/// </summary>
public DateTime? EffectiveTo { get; init; }
}