feat: discard an unpaid quote, delete a test order, cancel a paid one
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 2m44s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 54s

Cotações (now subtitled "pedidos ainda não pagos") can discard a quote: it
leaves every list and the search, and a payment for it is refused like an
expired one. A test order can be deleted with its history; its quote is unpaid
again. A paid order is cancelled with a required reason: it leaves the board
for a "Cancelados" chip, keeps its payment and history, can no longer move,
and the customer's account shows it as cancelled. Refunds stay at Mercado
Pago and Tiny is not told; the cancel form says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-02 16:20:27 -03:00
parent 7877489563
commit 05da6d78ad
12 changed files with 213 additions and 21 deletions

View File

@@ -213,3 +213,12 @@ CREATE TABLE IF NOT EXISTS dtf_local.upload_thumbnails (
upload_id uuid PRIMARY KEY REFERENCES dtf_local.uploads(id),
mime text NOT NULL, data bytea NOT NULL, created_at timestamptz NOT NULL DEFAULT now()
);
-- An operator may discard an unpaid quote (it leaves the Kanban and can no
-- longer be paid) and cancel a paid order (it leaves the board but keeps its
-- payment and history; a refund is made at the provider).
ALTER TABLE dtf_local.quotes ADD COLUMN IF NOT EXISTS discarded_at timestamptz;
ALTER TABLE dtf_local.quotes ADD COLUMN IF NOT EXISTS discarded_by text;
ALTER TABLE dtf_local.orders ADD COLUMN IF NOT EXISTS cancelled_at timestamptz;
ALTER TABLE dtf_local.orders ADD COLUMN IF NOT EXISTS cancelled_by text;
ALTER TABLE dtf_local.orders ADD COLUMN IF NOT EXISTS cancel_reason text;