feat: add core persistence model

This commit is contained in:
xiong
2026-07-26 04:52:56 +08:00
parent f5109de879
commit 5dfb68d8cc
33 changed files with 6989 additions and 31 deletions

View File

@@ -0,0 +1,40 @@
using System.Text.Json;
using Tiku.Domain.Common;
namespace Tiku.Domain.Tenancy;
public sealed class Tenant : AuditableEntity
{
public string Slug { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string? LegalName { get; set; }
public TenantStatus Status { get; set; } = TenantStatus.Active;
public TenantMode Mode { get; set; } = TenantMode.Saas;
public BillingStatus BillingStatus { get; set; } = BillingStatus.Trial;
public Guid? OwnerUserId { get; set; }
public string? LegacyId { get; set; }
public JsonElement Metadata { get; set; } = JsonDefaults.Object();
}
public enum TenantStatus
{
Draft,
Active,
Suspended,
Archived
}
public enum TenantMode
{
PlatformOwned,
Saas,
Dedicated
}
public enum BillingStatus
{
Trial,
Active,
PastDue,
Cancelled
}