This commit is contained in:
+19
-1
@@ -209,11 +209,28 @@ export const UpdatePartSchema = z
|
||||
// Behaves like "pending" for claim purposes (any operator can resume it) but
|
||||
// visually distinct so admins can see work-in-flight that isn't actively
|
||||
// being run right now.
|
||||
export const OperationStatuses = ["pending", "in_progress", "partial", "completed"] as const;
|
||||
// "qc_failed" = operator submitted a failing QC record on close. The step is
|
||||
// blocked until an admin clears the failure via the qc-reset route (which
|
||||
// rolls the step back to pending or partial depending on how much work was
|
||||
// already logged against it).
|
||||
export const OperationStatuses = [
|
||||
"pending",
|
||||
"in_progress",
|
||||
"partial",
|
||||
"completed",
|
||||
"qc_failed",
|
||||
] as const;
|
||||
|
||||
// "work" (default) = normal production step; may optionally require QC on close.
|
||||
// "qc" = dedicated inspection step — the whole point of the op is the QC
|
||||
// record, so close always requires the inline qc payload and we don't care
|
||||
// about unit counts or machine assignment.
|
||||
export const OperationKinds = ["work", "qc"] as const;
|
||||
|
||||
export const CreateOperationSchema = z.object({
|
||||
templateId: z.string().min(1).nullable().optional(),
|
||||
name: NonEmpty,
|
||||
kind: z.enum(OperationKinds).default("work").optional(),
|
||||
machineId: z.string().min(1).nullable().optional(),
|
||||
settings: JsonString,
|
||||
materialNotes: OptionalText,
|
||||
@@ -228,6 +245,7 @@ export const UpdateOperationSchema = z
|
||||
.object({
|
||||
templateId: z.string().min(1).nullable().optional(),
|
||||
name: NonEmpty.optional(),
|
||||
kind: z.enum(OperationKinds).optional(),
|
||||
machineId: z.string().min(1).nullable().optional(),
|
||||
settings: JsonString,
|
||||
materialNotes: OptionalText,
|
||||
|
||||
Reference in New Issue
Block a user