mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 19:00:38 +09:00
Fix budget auth and monthly spend rollups
This commit is contained in:
parent
5f2c2ee0e2
commit
728d9729ed
7 changed files with 315 additions and 17 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { and, desc, eq, gte, inArray, lt, sql } from "drizzle-orm";
|
||||
import { and, desc, eq, gte, inArray, lt, ne, sql } from "drizzle-orm";
|
||||
import type { Db } from "@paperclipai/db";
|
||||
import {
|
||||
agents,
|
||||
|
|
@ -360,6 +360,7 @@ export function budgetService(db: Db, hooks: BudgetServiceHooks = {}) {
|
|||
eq(budgetIncidents.policyId, policy.id),
|
||||
eq(budgetIncidents.windowStart, start),
|
||||
eq(budgetIncidents.thresholdType, thresholdType),
|
||||
ne(budgetIncidents.status, "dismissed"),
|
||||
),
|
||||
)
|
||||
.then((rows) => rows[0] ?? null);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue