Downtime catalog

This commit is contained in:
Marcelo
2026-05-06 00:36:48 +00:00
parent 0491237bad
commit bfc1673d89
42 changed files with 8035 additions and 1093 deletions

View File

@@ -33,6 +33,8 @@ model Org {
shifts OrgShift[]
productCostOverrides ProductCostOverride[]
settingsAudits SettingsAudit[]
reasonCatalogCategories ReasonCatalogCategory[]
reasonCatalogItems ReasonCatalogItem[]
}
model User {
@@ -290,6 +292,42 @@ model IngestLog {
@@index([machineId, seq])
}
model ReasonCatalogCategory {
id String @id @default(uuid())
orgId String @map("org_id")
kind String
name String
codePrefix String @map("code_prefix")
sortOrder Int @default(0) @map("sort_order")
active Boolean @default(true)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
org Org @relation(fields: [orgId], references: [id], onDelete: Cascade)
items ReasonCatalogItem[]
@@index([orgId, kind, active])
@@map("reason_catalog_category")
}
model ReasonCatalogItem {
id String @id @default(uuid())
orgId String @map("org_id")
categoryId String @map("category_id")
name String
codeSuffix String @map("code_suffix")
reasonCode String @map("reason_code")
sortOrder Int @default(0) @map("sort_order")
active Boolean @default(true)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
org Org @relation(fields: [orgId], references: [id], onDelete: Cascade)
category ReasonCatalogCategory @relation(fields: [categoryId], references: [id], onDelete: Cascade)
@@unique([orgId, reasonCode])
@@index([orgId, categoryId])
@@map("reason_catalog_item")
}
model OrgSettings {
orgId String @id @map("org_id")
timezone String @default("UTC")