feat: 实现租户管理及套餐流程

This commit is contained in:
2025-12-03 16:37:50 +08:00
parent 151f64d41a
commit a536a554c2
34 changed files with 1732 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
using MediatR;
using System.ComponentModel.DataAnnotations;
using TakeoutSaaS.Application.App.Tenants.Dto;
namespace TakeoutSaaS.Application.App.Tenants.Commands;
/// <summary>
/// 套餐升降配命令。
/// </summary>
public sealed record ChangeTenantSubscriptionPlanCommand(
[property: Required] long TenantId,
[property: Required] long TenantSubscriptionId,
[property: Required] long TargetPackageId,
bool Immediate,
string? Notes) : IRequest<TenantSubscriptionDto>;

View File

@@ -0,0 +1,15 @@
using MediatR;
using System.ComponentModel.DataAnnotations;
using TakeoutSaaS.Application.App.Tenants.Dto;
namespace TakeoutSaaS.Application.App.Tenants.Commands;
/// <summary>
/// 新建或续费订阅。
/// </summary>
public sealed record CreateTenantSubscriptionCommand(
[property: Required] long TenantId,
[property: Required] long TenantPackageId,
int DurationMonths,
bool AutoRenew,
string? Notes) : IRequest<TenantSubscriptionDto>;

View File

@@ -0,0 +1,21 @@
using MediatR;
using System.ComponentModel.DataAnnotations;
using TakeoutSaaS.Application.App.Tenants.Dto;
namespace TakeoutSaaS.Application.App.Tenants.Commands;
/// <summary>
/// 注册租户命令。
/// </summary>
public sealed record RegisterTenantCommand(
[property: Required, StringLength(64)] string Code,
[property: Required, StringLength(128)] string Name,
string? ShortName,
string? Industry,
string? ContactName,
string? ContactPhone,
string? ContactEmail,
[property: Required] long TenantPackageId,
int DurationMonths = 12,
bool AutoRenew = true,
DateTime? EffectiveFrom = null) : IRequest<TenantDto>;

View File

@@ -0,0 +1,13 @@
using MediatR;
using System.ComponentModel.DataAnnotations;
using TakeoutSaaS.Application.App.Tenants.Dto;
namespace TakeoutSaaS.Application.App.Tenants.Commands;
/// <summary>
/// 审核租户命令。
/// </summary>
public sealed record ReviewTenantCommand(
[property: Required] long TenantId,
bool Approve,
string? Reason) : IRequest<TenantDto>;

View File

@@ -0,0 +1,21 @@
using MediatR;
using System.ComponentModel.DataAnnotations;
using TakeoutSaaS.Application.App.Tenants.Dto;
namespace TakeoutSaaS.Application.App.Tenants.Commands;
/// <summary>
/// 提交租户实名认证资料。
/// </summary>
public sealed record SubmitTenantVerificationCommand(
[property: Required] long TenantId,
string? BusinessLicenseNumber,
string? BusinessLicenseUrl,
string? LegalPersonName,
string? LegalPersonIdNumber,
string? LegalPersonIdFrontUrl,
string? LegalPersonIdBackUrl,
string? BankAccountName,
string? BankAccountNumber,
string? BankName,
string? AdditionalDataJson) : IRequest<TenantVerificationDto>;