Generated
Executes constructor.
The db value.
The function result.
Generated
Returns the result of getTenantCreditsUsed.
The function result.
Objective: In module packages/db/src/repositories/ai-usage-ledger.repository.ts, retrieve data through getTenantCreditsUsed.
Behavior: Async; accepts tenantId and periodStart and periodEnd; returns a value; invokes this.db .select({ total: sql<number>COALESCE(SUM(${aiUsageL. @param tenantId The tenantIdvalue. @param periodStart TheperiodStartvalue. @param periodEnd TheperiodEnd` value.
Generated
Returns the result of getUserCreditsUsed.
The function result.
Objective: In module packages/db/src/repositories/ai-usage-ledger.repository.ts, retrieve data through getUserCreditsUsed.
Behavior: Async; accepts tenantId and userId and periodStart and periodEnd; returns a value; invokes this.db .select({ total: sql<number>COALESCE(SUM(${aiUsageL. @param tenantId The tenantIdvalue. @param userId TheuserIdvalue. @param periodStart TheperiodStartvalue. @param periodEnd TheperiodEnd` value.
Generated
Executes record.
The entry value.
The function result.
Persistent UsageLedger backed by ai_usage_ledger table. Idempotent on requestId+tenantId (unique constraint).