feat: Expedição profile, stamp sizes and the Montar folha screen (front 7a.1)

The new Expedição profile and the seller may assemble sheets (capability
assemble). Gestão edits the size table (letter and width). The Montar tab
reads Estampas/<code>-<size>.png or <code>.png from the orders folder,
checks the resolution with the Site's 96/200 DPI ruler, merges repeated
lines and estimates the metres. Montar itself is slice 2.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-09 13:34:43 -03:00
parent 4219db8215
commit e9db9dec06
14 changed files with 482 additions and 23 deletions

View File

@@ -284,11 +284,11 @@ CREATE TABLE IF NOT EXISTS dtf_local.cnpj_names (
-- from the console); administrators manage users and machines; gestão runs
-- the business; designers approve artwork; operadores print; revisores check
-- the printed sheet and are the only ones to release it to Finalizado;
-- vendedores only read.
-- vendedores only read; expedição assembles sheets in the Kanban's montador.
ALTER TABLE dtf_local.operators ADD COLUMN IF NOT EXISTS role text NOT NULL DEFAULT 'admin';
ALTER TABLE dtf_local.operators DROP CONSTRAINT IF EXISTS operators_role;
ALTER TABLE dtf_local.operators ADD CONSTRAINT operators_role
CHECK (role IN ('superadmin','admin','gestao','designer','operador','revisor','vendedor','financeiro'));
CHECK (role IN ('superadmin','admin','gestao','designer','operador','revisor','vendedor','financeiro','expedicao'));
-- Print machines and which products each prints. An order gets its machine
-- when someone pulls it into Imprimindo; no machine is assigned at payment.
-- limit_metres remains the load shown for a machine.
@@ -581,3 +581,13 @@ CREATE TABLE IF NOT EXISTS dtf_local.machine_snoozes (
snoozed_by text NOT NULL, snoozed_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY(machine_id, alert, cycle_from)
);
-- Front 7a: the stamp sizes of the Kanban's montador; Gestão edits them.
CREATE TABLE IF NOT EXISTS dtf_local.stamp_sizes (
letter text PRIMARY KEY CHECK (letter ~ '^[A-Z]{1,2}$'),
width_cm numeric(5,2) NOT NULL CHECK (width_cm > 0 AND width_cm <= 56),
updated_by text NOT NULL DEFAULT 'sistema',
updated_at timestamptz NOT NULL DEFAULT now()
);
INSERT INTO dtf_local.stamp_sizes(letter,width_cm) VALUES ('A',20),('B',24),('C',27),('D',30)
ON CONFLICT (letter) DO NOTHING;