feat: complete SaaS commercial delivery workflows
This commit is contained in:
@@ -21,6 +21,35 @@ public sealed class TenantBillingProfile : IHasTimestamps, ITenantOwned
|
||||
public DateTimeOffset UpdatedAt { get; set; } = DateTimeOffset.UtcNow;
|
||||
}
|
||||
|
||||
public sealed class TenantBillingPolicy : IHasTimestamps, ITenantOwned
|
||||
{
|
||||
public Guid TenantId { get; set; }
|
||||
public TenantBillingCollectionMode CollectionMode { get; set; } = TenantBillingCollectionMode.Online;
|
||||
public string DefaultPaymentProvider { get; set; } = "manual";
|
||||
public bool AutoGenerateRenewal { get; set; } = true;
|
||||
public int RenewalLeadDays { get; set; } = 14;
|
||||
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
|
||||
public DateTimeOffset UpdatedAt { get; set; } = DateTimeOffset.UtcNow;
|
||||
}
|
||||
|
||||
public sealed class TenantOwnerActivationGrant : AuditableTenantEntity
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public Guid CreatedBy { get; set; }
|
||||
public string TokenHash { get; set; } = string.Empty;
|
||||
public DateTimeOffset ExpiresAt { get; set; }
|
||||
public DateTimeOffset? ConsumedAt { get; set; }
|
||||
}
|
||||
|
||||
public sealed class PlatformOperationIdempotency : AuditableEntity
|
||||
{
|
||||
public Guid ActorUserId { get; set; }
|
||||
public string Scope { get; set; } = string.Empty;
|
||||
public string IdempotencyKey { get; set; } = string.Empty;
|
||||
public string RequestHash { get; set; } = string.Empty;
|
||||
public Guid ResourceId { get; set; }
|
||||
}
|
||||
|
||||
public sealed class PlatformBillingInvoiceReminder : AuditableTenantEntity
|
||||
{
|
||||
public Guid InvoiceId { get; set; }
|
||||
@@ -142,6 +171,7 @@ public enum PlatformBillingInvoiceReminderStatus { Pending, Sent, Acknowledged,
|
||||
public enum PlatformAlertSeverity { Low, Medium, High, Critical }
|
||||
public enum PlatformAuditAlertStatus { Open, Acknowledged, Resolved, Ignored }
|
||||
public enum PlatformBillingDunningProvider { Generic, Dingtalk, Feishu, Wecom }
|
||||
public enum PlatformBillingDunningNotificationStatus { Pending, Processing, Sent, Retrying, Failed, Discarded }
|
||||
public enum PlatformBillingDunningNotificationStatus { Pending, Processing, Sent, Retrying, Failed, Discarded, Acknowledged, Ignored }
|
||||
public enum PlatformPaymentAppStatus { Active, Disabled, Testing }
|
||||
public enum PlatformPaymentChannelStatus { Active, Disabled, Testing }
|
||||
public enum TenantBillingCollectionMode { Online, Manual }
|
||||
|
||||
@@ -211,6 +211,13 @@ public sealed class PlatformBillingRefund : AuditableTenantEntity
|
||||
public string Reason { get; set; } = string.Empty;
|
||||
public string? ProviderRefundNo { get; set; }
|
||||
public DateTimeOffset? CompletedAt { get; set; }
|
||||
public string IdempotencyKey { get; set; } = string.Empty;
|
||||
public PlatformBillingRefundSubscriptionEffect SubscriptionEffect { get; set; } = PlatformBillingRefundSubscriptionEffect.KeepService;
|
||||
public Guid? RequestedBy { get; set; }
|
||||
public Guid? ReviewedBy { get; set; }
|
||||
public DateTimeOffset? ReviewedAt { get; set; }
|
||||
public string? ReviewReason { get; set; }
|
||||
public string? LastError { get; set; }
|
||||
}
|
||||
|
||||
public sealed class PlatformBillingInvoice : AuditableTenantEntity
|
||||
@@ -242,3 +249,4 @@ public enum PlatformBillingItemType { BasePlan, AddOn }
|
||||
public enum PlatformBillingPaymentStatus { Pending, Succeeded, Failed, Refunded }
|
||||
public enum PlatformBillingRefundStatus { Requested, Processing, Succeeded, Failed, Cancelled }
|
||||
public enum PlatformBillingInvoiceStatus { Draft, Issued, Paid, Void, Overdue }
|
||||
public enum PlatformBillingRefundSubscriptionEffect { KeepService, CancelAtPeriodEnd, TerminateImmediately }
|
||||
|
||||
@@ -36,5 +36,6 @@ public enum BillingStatus
|
||||
Trial,
|
||||
Active,
|
||||
PastDue,
|
||||
Suspended,
|
||||
Cancelled
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user