This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
-- Adds Operation.kind ("work" | "qc") for dedicated inspection steps.
|
||||
-- The `qc_failed` status value is application-level only (status is TEXT),
|
||||
-- so no schema change is needed for that — migration is just the column add.
|
||||
ALTER TABLE "Operation" ADD COLUMN "kind" TEXT NOT NULL DEFAULT 'work';
|
||||
@@ -167,11 +167,18 @@ model Operation {
|
||||
templateId String?
|
||||
name String
|
||||
machineId String?
|
||||
/// "work" (default) = regular production step, "qc" = dedicated inspection
|
||||
/// step whose entire purpose is pass/fail. QC ops always require a QC record
|
||||
/// on close and don't care about machines/units.
|
||||
kind String @default("work") // work | qc
|
||||
settings String? // JSON
|
||||
materialNotes String?
|
||||
instructions String?
|
||||
qcRequired Boolean @default(false)
|
||||
status String @default("pending") // pending | in_progress | partial | completed
|
||||
/// pending | in_progress | partial | completed | qc_failed
|
||||
/// qc_failed: operator submitted QC fail on close — step is blocked until
|
||||
/// an admin resets it via /api/v1/operations/:id/qc-reset.
|
||||
status String @default("pending")
|
||||
qrToken String @unique
|
||||
claimedByUserId String?
|
||||
claimedAt DateTime?
|
||||
|
||||
Reference in New Issue
Block a user