forked from xiongyuxing/tiku-backend.net
32 lines
877 B
C#
32 lines
877 B
C#
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;
|
|
}
|