Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model Job {
id String @id @default(cuid())
browserSessionId String?
state String @default("NEW")
inputRequest String
customerId String?
modelId String?
partFamily String?
builderName String?
generationPath String?
scadSource String?
parameterSchema String?
parameterValues String?
researchResult String?
intentResult String?
designResult String?
cadIntentJson String?
modelingPlanJson String?
validationTargetsJson String?
stlPath String?
pngPath String?
renderLog String?
reportPath String?
validationResults String?
repairHistory String?
executionLogs String?
retryCount Int @default(0)
maxRetries Int @default(3)
repairRound Int @default(0)
llmCallCount Int @default(0)
latencyMs Int?
qualityScore Float?
visualRepairReportJson String?
validationReportJson String?
notes String?
parentId String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
completedAt DateTime?
parent Job? @relation("JobHierarchy", fields: [parentId], references: [id])
children Job[] @relation("JobHierarchy")
versions JobVersion[]
outcomes JobOutcome[]
artifactVersions JobArtifactVersion[]
@@index([createdAt])
@@index([browserSessionId, createdAt])
@@index([state, createdAt])
@@index([parentId])
}
/// Append-only record of what actually happened to a job, kept strictly separate from
/// pipeline state. `DELIVERED` means artifacts became available; it never meant the user
/// accepted the part. Acceptance, rejection, edits, and exports are events, not states.
model JobOutcome {
id String @id @default(cuid())
jobId String
kind String // "accepted" | "rejected" | "user_edited" | "exported"
source String @default("user") // "user" | "system"
detail String? // bounded free text or JSON describing the event
artifactVersionId String?
createdAt DateTime @default(now())
job Job @relation(fields: [jobId], references: [id], onDelete: Cascade)
artifactVersion JobArtifactVersion? @relation(fields: [artifactVersionId], references: [id], onDelete: SetNull)
@@index([jobId, createdAt])
@@index([kind, createdAt])
@@index([artifactVersionId])
}
model JobArtifactVersion {
id String @id @default(cuid())
jobId String
scadHash String
scadSource String
stlPath String?
pngPath String?
validationResults String?
instructionFingerprint String?
modelExecution String?
createdAt DateTime @default(now())
job Job @relation(fields: [jobId], references: [id], onDelete: Cascade)
outcomes JobOutcome[]
@@index([jobId, createdAt])
}
model JobVersion {
id String @id @default(cuid())
jobId String
field String // which field changed: "parameters", "scadSource", "notes"
oldValue String? // JSON string of previous value
newValue String? // JSON string of new value
changedBy String @default("user") // who made the change
createdAt DateTime @default(now())
job Job @relation(fields: [jobId], references: [id], onDelete: Cascade)
}
e934a3ad8This file is pinned to the selected release. Download the original to open it in your design tool.