forked from xiongyuxing/tiku-backend.net
feat(saas): implement marketplace and tenant onboarding
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
namespace Tiku.Application.Security;
|
||||
|
||||
public sealed record ReconcileFeatureUsageRequest(
|
||||
Guid TenantId,
|
||||
SystemScopeCallerType CallerType,
|
||||
string Caller,
|
||||
string Reason,
|
||||
string CorrelationId);
|
||||
|
||||
public sealed record ReconciledFeatureUsage(
|
||||
string MetricCode,
|
||||
long ActualValue,
|
||||
long LimitValue,
|
||||
bool Warning,
|
||||
bool Exceeded);
|
||||
|
||||
public interface IFeatureUsageReconciliationService
|
||||
{
|
||||
Task<IReadOnlyCollection<ReconciledFeatureUsage>> ReconcileTenantAsync(
|
||||
ReconcileFeatureUsageRequest request,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<int> ProcessDueAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
public sealed class FeatureUsageReconciliationOptions
|
||||
{
|
||||
public bool Enabled { get; set; } = true;
|
||||
public int BatchSize { get; set; } = 100;
|
||||
public int IntervalMinutes { get; set; } = 60;
|
||||
}
|
||||
Reference in New Issue
Block a user