Add documentation for creating new crud endpoints

This commit is contained in:
Owen
2026-08-10 10:47:18 -04:00
parent dc1923ab1f
commit 591caab45a
2 changed files with 347 additions and 10 deletions
-10
View File
@@ -1,4 +1,3 @@
import { aiBudgetPeriods } from "@server/db/sqlite";
import { randomUUID } from "crypto";
import { InferSelectModel, sql } from "drizzle-orm";
import {
@@ -1747,15 +1746,6 @@ export const aiBudgets = pgTable(
updatedAt: bigint("updatedAt", { mode: "number" }).notNull()
},
(t) => [
check(
"ai_budget_one_scope",
sql`(
(CASE WHEN ${t.providerId} IS NOT NULL THEN 1 ELSE 0 END) +
(CASE WHEN ${t.modelId} IS NOT NULL THEN 1 ELSE 0 END) +
(CASE WHEN ${t.resourceId} IS NOT NULL THEN 1 ELSE 0 END) +
(CASE WHEN ${t.siteResourceId} IS NOT NULL THEN 1 ELSE 0 END)
) = 1`
),
unique("ai_budget_provider_uniq").on(t.providerId),
unique("ai_budget_model_uniq").on(t.modelId),
unique("ai_budget_resource_uniq").on(t.resourceId),