L2 Aufträge & Backoffice: Service-Schicht Aufträge + Tests
Statusmaschine (transitionWorkOrder inkl. eventData), Zuweisung, Completion-Guards, Materialvorgabe, Checklisten/Pflichtfotos, Liste/Dashboard-Presets, Suche, Sync-Konflikte, Einstellungen (Auftragsarten, Vorlagen, Nummernkreise). Tests: Übergangsmatrix je Rolle, Kernlogik, Scope/Mandantentrennung, Nummernkreis-Parallelität. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { CompletionBlocker } from "@/lib/work-orders/status";
|
||||
|
||||
/** Result of a work order server action (client-safe; rendered by components/work-orders/action-form.tsx). */
|
||||
export type ActionState =
|
||||
| { status: "idle" }
|
||||
| { status: "ok"; at: number }
|
||||
| {
|
||||
status: "error";
|
||||
/** ServiceError code: not_found | forbidden | invalid | conflict | blocked | internal */
|
||||
code: string;
|
||||
/** message key below `errors.` (falls back to the code) */
|
||||
message: string;
|
||||
blockers?: CompletionBlocker[];
|
||||
at: number;
|
||||
};
|
||||
|
||||
export const IDLE_STATE: ActionState = { status: "idle" };
|
||||
Reference in New Issue
Block a user