Configuration¶
Configuration lives in src/ConnectSoft.Saas.Metering.Application/appsettings*.json; cross-cutting sections come from the Base Template. Metering-relevant sections:
Multitenancy¶
Shared-DB row isolation by default via SaasTenantFilter on TenantId; same Multitenancy structure as the other SaaS contexts.
Persistence¶
Connection string ConnectSoft.Saas.Metering; shipped dialect MsSql2012Dialect. Single table UsageMeters with UQ_UsageMeters_Tenant_Dimension.
Quota thresholds¶
ThresholdWarningPercent defaults to 80 on the aggregate; meters emit threshold-crossed and exceeded events once each (tracked by ThresholdCrossedEmitted/QuotaExceededEmitted). Quotas are updated from entitlements via ApplyUsageQuotaAsync.
Inbound topics¶
Sagas consume tenants.domain.v1.tenant-activated, billing.subscriptions.v1.subscription-created, and entitlements.v1.effective-entitlements-updated (UsageMetersConstants.InboundEventTopics). The UsageReportedForQuotaInboundEvent topic is not wired (see features). Configure the MassTransit transport so inbound events are delivered.