feat: Minhas folhas on the server and in Minha conta: saved sheets per account with their uploads, 30 days, 50 per account; order again, edit, delete (Rodada 5, B9)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-30 16:09:52 -03:00
parent 21858b5764
commit 5671235681
9 changed files with 453 additions and 8 deletions

View File

@@ -0,0 +1,15 @@
-- Rodada 5, B9: a customer with an account keeps a built sheet (a cart item)
-- in Minhas folhas and asks for it again, edits it or deletes it later.
CREATE TABLE IF NOT EXISTS dtf_local.saved_sheets (
id uuid PRIMARY KEY,
account uuid NOT NULL REFERENCES dtf_local.accounts(id) ON DELETE CASCADE,
name text NOT NULL,
mode text NOT NULL CHECK (mode IN ('file','avulsa','uvfile','uv','premium')),
metres numeric NOT NULL,
item jsonb NOT NULL,
uploads uuid[] NOT NULL,
picture text,
created_at timestamptz NOT NULL DEFAULT now(),
used_at timestamptz
);
CREATE INDEX IF NOT EXISTS saved_sheets_account ON dtf_local.saved_sheets(account);