feat: Gestão moves a printing order to another machine with a reason; the new one resumes from the part being ripped (Rodada 5, D4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-30 15:03:02 -03:00
parent 030b66c697
commit c2aa1d4937
7 changed files with 185 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
-- Rodada 5, D4: a card already in Imprimindo changes machine, by Gestão or an
-- administrator with a reason; the part the new machine resumed from is kept
-- for the Revisor to check the tone seam.
CREATE TABLE IF NOT EXISTS dtf_local.machine_transfers (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
order_id uuid NOT NULL REFERENCES dtf_local.orders(id) ON DELETE CASCADE,
from_machine uuid,
to_machine uuid NOT NULL,
from_name text,
to_name text NOT NULL,
reason text NOT NULL,
resumed_from int,
created_by text NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS machine_transfers_order ON dtf_local.machine_transfers(order_id);