Commit Graph

192 Commits

Author SHA1 Message Date
Cauê Faleiros
44458aea3e fix: Tiny uses Dropstar's SKUs and finds the pickup method without settings
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 3m40s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m4s
"Testar conexão" in production said every product and the pickup forma de
envio were "sem id": the SKUs and the pickup id only existed as stack
settings nobody had set. They are Dropstar's fixed catalogue, checked against
its Tiny export: Têxtil as DTFIMP.TX.100CM plus DTFIMP.TX.0010CM to 0090CM,
UV as DTFIMP.UV.1MT plus DTFIMP.UV.010CM, for the ready sheet and loose
artwork alike. These are now the defaults, and the pickup forma de envio is
the one named like "retirar" in Tiny; the test says so when there is none,
or more than one. The settings still override both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 11:17:24 -03:00
Cauê Faleiros
3c9f05041e fix: Tiny's connection test no longer times out listing orders
All checks were successful
Build and deploy / Validate source (push) Successful in 1m38s
Build and deploy / Integration suite on a real stack (push) Successful in 4m33s
Build and deploy / Secret scan and release gate (push) Successful in 11s
Build and deploy / Publish images (push) Successful in 1m51s
"Testar conexão" asked Tiny for one order with no filter, and on the
client's account Tiny answered 400 "Sua consulta levou muito tempo". It now
asks for orders since yesterday, which proves the same permission.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:54:19 -03:00
Cauê Faleiros
914c55c329 docs: card installments are 3x with interest paid by the customer
Wagner confirmed it. Mercado Pago's card form already shows the rates and the
order checks the price, not the total with interest, so nothing changes in the
code; the Mercado Pago account must keep "parcelamento sem juros" off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:49:11 -03:00
Cauê Faleiros
8387d7ef3a feat: the "Arte tratada" stage is now "Arte conferida"
All checks were successful
Build and deploy / Validate source (push) Successful in 10s
Build and deploy / Integration suite on a real stack (push) Successful in 4m29s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m13s
With "Aguardando contato" as a mark on the card, the stage only means the
team has checked the file, and its name now says so. The Kanban and the
customer's Minha conta both take stage names from the server, so this one
name changes both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:18:16 -03:00
Cauê Faleiros
cf12566e86 feat: an order can be marked "Aguardando contato" until the customer is reached
All checks were successful
Build and deploy / Validate source (push) Successful in 16s
Build and deploy / Integration suite on a real stack (push) Successful in 4m8s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m7s
The 7 October meeting asked for a way to flag orders whose file needs a word
with the customer before printing: rename Arte tratada, or tag the card. A tag
keeps the stage meaning "file checked" and the order where it is in the
queue. In the order panel, "☎ Aguardando contato" asks what has to be agreed;
the card then shows the mark, the board has an "Aguardando contato" filter,
and the panel shows the note, who marked it and when, the customer's WhatsApp
and "Contato feito", which clears it. The customer is not told. Sellers see
the mark but cannot set it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:41:59 -03:00
Cauê Faleiros
bcce64fff8 docs: the operator guide covers users, the automatic folder and e-mail
All checks were successful
Build and deploy / Validate source (push) Successful in 1m40s
Build and deploy / Integration suite on a real stack (push) Successful in 3m38s
Build and deploy / Secret scan and release gate (push) Successful in 11s
Build and deploy / Publish images (push) Successful in 1m34s
The meeting asked for the operator guide to be sent to the team, and it did
not cover what was built since 5 October. New pages: the print queue's
automatic folder (setting it up in Chrome or Edge, releasing it after a
browser restart, Brave and Firefox) and Usuários (profiles, machines, alerts).
Integrações is described as the new list with "Detalhes", the CDR charge is
mentioned where hand preparation is, and the FAQ answers the "!" on
Integrações and forgotten passwords. Screenshots use fictional people.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 11:48:24 -03:00
Cauê Faleiros
3664fe827e feat: password recovery by e-mail, team alerts, and a price for files opened by hand
Pilot customers had no way to reset a forgotten password, and the 7 October
meeting asked for two things that only needed the client's inputs to go live.

Password recovery: "Esqueci minha senha" in Minha conta sends a link that
works once, for an hour (/conta/redefinir#token, in the fragment so it never
reaches a server or a Referer). Only the token's hash is stored, the e-mail's
text is erased once sent, the answer never says whether an account exists,
and a reset signs out every other session. Limited per address and source.

Team alerts: Kanban users who tick "Receber alertas por e-mail" in Usuários
get one when an order is paid, a cart waits for review, or a payment needs
attention. Messages are queued in the transaction that caused them and sent
by the worker with retries (app/mail.py). Integrações shows an E-mail row
with "Enviar teste".

E-mail is off in production (MAIL_ADAPTER=off; recovery keeps offering
WhatsApp) until the client's SMTP account exists; then it is only settings
(docs/PORTAINER.md). The local stack keeps messages in the database and log.

Files opened by hand: a finished sheet in CDR, AI, PSD or TIFF (or with a
length the customer typed) pays the full price plus MANUAL_FILE_EXTRA_CENTS
per metre, to steer customers to PNG as the meeting asked. It is 0 until
Marcus gives the amount. The Site shows it before checkout, the server
charges it, Tiny gets it in the unit price, and the Kanban says it.

Tested: new tests/mail_test (reset flow, SMTP delivery against a local SMTP
server, retry, who gets alerts), pricing unit tests, and the browser test now
checks the Site total equals the server's, run with the charge at 0 and at
R$ 5,00. The full CI suite passes in a CI-style stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 11:48:24 -03:00
Cauê Faleiros
86507ed7b5 fix: Integrações is a tidy list, with the long text under "Detalhes"
All checks were successful
Build and deploy / Validate source (push) Successful in 8s
Build and deploy / Integration suite on a real stack (push) Successful in 2m43s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m2s
The page was a grid of cards stuffed with paragraphs (Tiny's dates, the
freight's box and cubage, the Firefox how-to), so the cards had uneven
heights and left gaps. Each integration is now one row: name, state, one
line of summary and its main button. Everything else (dates, numbers,
how-tos, secondary buttons like Reconectar or Trocar pasta) opens under
"Detalhes", below its own row, without moving the others around; what is
open stays open through the automatic refresh. Mercado Pago's "Verificar
conta" now shows its result there instead of a 60-second message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:44:52 -03:00
Cauê Faleiros
58ce0a4166 feat: the print queue's automatic folder is switched on in Integrações
All checks were successful
Build and deploy / Validate source (push) Successful in 1m8s
Build and deploy / Integration suite on a real stack (push) Successful in 3m20s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m2s
The folder was a small icon beside "Baixar" in Fila de impressão, easy to
miss, and in Brave it silently fell back to downloads that Brave blocks.
It is now a card in Integrações, which operators also see (only that card):
choose the folder FlexiPRINT reads, or the internal server's share, and
every order that enters the queue has its final files saved there.

- Brave hides the folder API behind a flag; the card says so, shows the
  flag's address with a copy button, and points to Chrome or Edge.
- After a browser restart, a "!" on the Integrações tab and a "Liberar
  pasta" button ask for the one click the browser requires.
- The folder checks the queue every 30 s on its own, so an order moved on
  another computer is saved even with the board's auto-refresh off.
- A browser that cannot rename the finished file copies it instead of
  leaving it as .baixando; errors stay on the card until the next success.

Tested in Brave (flag off: the card explains; flag on: 12 queued files
saved, and an order moved by another session saved 23 s later), and the
browser test now checks that an order entering the queue lands in the folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 11:15:59 -03:00
Cauê Faleiros
87cd7d77fb feat: in Firefox, the print queue's files download by themselves
All checks were successful
Build and deploy / Validate source (push) Successful in 10s
Build and deploy / Integration suite on a real stack (push) Successful in 3m31s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m27s
Firefox cannot write into a folder a site chose, so the folder button was
hidden there. It now appears in every browser: in Firefox it switches on
automatic downloads, each file that enters Fila de impressão downloaded
once, named after its order, into Firefox's download folder, which the
dialog explains how to point at FlexiPRINT's. Firefox writes .part and
renames when whole, so FlexiPRINT never reads half a file either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 14:26:11 -03:00
Cauê Faleiros
1216998914 feat: the Kanban saves the print queue's files into a folder the operator chose
All checks were successful
Build and deploy / Validate source (push) Successful in 1m26s
Build and deploy / Integration suite on a real stack (push) Successful in 3m31s
Build and deploy / Secret scan and release gate (push) Successful in 11s
Build and deploy / Publish images (push) Successful in 1m27s
The meeting asked that files moved to Fila de impressão land in the print
room's folder by themselves, instead of each one being downloaded from the
cloud. Beside "Baixar" in that column, a folder button lets the operator
pick a folder (FlexiPRINT's, or the internal server's share). While the
Kanban is open in Chrome or Edge, every final file that enters the queue is
saved there, named after its order, written under a temporary name and
renamed only when whole so FlexiPRINT never reads half a file. A file
already saved is not fetched again, even after FlexiPRINT moves it away.
The folder is remembered; after the browser restarts the button turns
orange and one click releases it. A machine's operator gets only that
machine's queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:42:02 -03:00
Cauê Faleiros
2a2a783ff7 feat: deleting an order frees its files from storage
A deleted order's files stayed in R2 until they expired on their own, up
to 30 days. Deleting now expires its finals, the customer's corrections
and the generated PDFs at once, and its originals too unless it was a
test order, whose quote can still be paid. A file another order or an
open quote still uses is kept. The worker removes them within a minute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:25:18 -03:00
Cauê Faleiros
3db528a373 feat: UV goes to Tiny as whole metres of DTFIMP.UV.1MT, then DTFIMP.UV.010CM
All checks were successful
Build and deploy / Validate source (push) Successful in 1m22s
Build and deploy / Integration suite on a real stack (push) Successful in 3m12s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 58s
The client registered UV as a metre SKU and a 10 cm SKU. With
TINY_SKU_METRO_<MODE> beside TINY_SKU10_<MODE>, 2,30 m goes as 2 × the
metre SKU and 3 × the 10 cm one, at the price the customer paid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 15:00:00 -03:00
Cauê Faleiros
44cb6ccc16 feat: credit card payments in up to 3 installments
Dropstar sells in up to 3 installments. The card form offers no more, and
the server refuses a payment asking for more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 15:00:00 -03:00
Cauê Faleiros
c75c40ff28 feat: Kanban profiles, a Usuários page, and machines that route orders
Every operator could do everything, and accounts were made from the
console. Each account now has a profile, checked by the server on every
action: Administrador (everything, plus users and machines), Gestão
(everything but users), Operador (moves cards and handles artwork) and
Vendedor (reads orders, quotes and Números, changes nothing). The
superadmin is the system's own account, set from the console and kept by
the account OPERATOR_EMAIL seeds; administrators cannot change it, and
nobody can delete, disable or demote themselves.

The Usuários tab creates, edits, disables and deletes users with a first
password (there is no e-mail yet), and registers machines with the
products each prints. An order goes to the first active machine that
prints its product, or to the one chosen in its panel; an operator tied
to machines sees and downloads only their orders. Everyone changes their
own password in the account menu, which now holds the name and Sair too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 15:00:00 -03:00
Cauê Faleiros
6c2dcc77b0 docs: the Site guide for today's Site, with its source in the repository
The 24/09 guide said files go up to 128 MB (5 GB now), that the team
reviews every quote before payment (the Site approves it), that payment
is PIX or card (credit card or PIX, on a page of its own), that WhatsApp
notices go out at four moments (two do; the team sends the correction
notice), and showed the order number customers no longer see. It lacked
Minha conta, freight by CEP, choosing which cart items to pay and the
refusal messages, and its status page was from week 2. Rebuilt in the
operator guide's format, source in docs/guias/site, new screenshots from
the local stack with fictional customers; imprimir.sh prints both guides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 10:42:29 -03:00
Cauê Faleiros
5063c152c2 fix: the Site no longer promises a review before payment, notices at every step, or boleto
The home page's steps said "Conferimos a metragem e liberamos o pagamento"
and "Aviso no WhatsApp a cada etapa": carts are now approved by the Site
and paid at once, and WhatsApp notices go out when the payment is approved
and when the order is ready. They read "Pague na hora: cartão de crédito ou
PIX" and "Acompanhe em Minha conta, com aviso no WhatsApp quando ficar
pronto". The footer listed boleto, which the Site does not take.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 10:42:28 -03:00
Cauê Faleiros
959ed37b15 feat: a refused payment says what happened and what to do, in plain Portuguese
All checks were successful
Build and deploy / Validate source (push) Successful in 1m22s
Build and deploy / Integration suite on a real stack (push) Successful in 4m10s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m11s
A refused card showed Mercado Pago's code ("Pagamento recusado pelo Mercado
Pago (cc_rejected_insufficient_amount)"), a request it refused showed its
cause list, and some errors were in English ("Quote is already paid",
"Payment provider unavailable; try again"). Each now becomes one sentence:
"O cartão não tem limite suficiente para este valor. Use outro cartão ou
pague com PIX." The codes still go to the log and, on the Kanban's "Cartão
recusado" badge, beside the same sentence. A form check the customer cannot
read is replaced by a general one, and every error a customer or operator
can meet in the quote, upload, account and artwork routes is in Portuguese.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 15:54:14 -03:00
Cauê Faleiros
172544b173 feat: a Tiny order can sell UV as the client's one SKU per 10 cm
All checks were successful
Build and deploy / Validate source (push) Successful in 15s
Build and deploy / Integration suite on a real stack (push) Successful in 3m26s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m7s
Dropstar sells UV only as DTFIMP.UV.010CM, per 10 cm. TINY_SKU10_<MODE>
names such a SKU: 2,30 m goes to Tiny as 23 of it at the price the customer
paid, with a rest that does not divide on a line of its own so the order
adds up to the cent. "Testar conexão" and tiny_probe conferir check it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 15:27:45 -03:00
Cauê Faleiros
43d9a3c637 feat: the Site takes credit card and PIX only, no debit
Dropstar does not take debit cards, and Mercado Pago never enabled debit on
the account, so a customer who chose "Cartão de débito" met an error. The
payment page offers credit card and PIX, the card form accepts only credit
cards, and the server refuses a debit method sent around the page. The
adapter still knows how to pay by debit, should it be offered again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 15:27:45 -03:00
Cauê Faleiros
ac1d8743b1 docs: the operator guide for today's Kanban
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 3m14s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m3s
Rewritten for what changed since 25/09: quotes are approved by the Site and
only those over 50 m or with a grade that does not match reach the team;
the order panel's next-step box approves the final file, a customer's
correction or the generated PDF in one click; cards show the company name
and what is missing; columns are queues with "Baixar" for the print queue;
a correction is announced with a WhatsApp message ready to send; orders are
cancelled and deleted from the "⋯" menu; the new Números tab; and the board
refreshes by itself. New screenshots from a throwaway stack with four
fictional companies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 13:09:09 -03:00
Cauê Faleiros
545a8c0f2d fix: card pictures load reliably, and the queue button fits its column
A picture had no size until it loaded, and a lazy image with no size may
never be loaded, so some cards showed the layout drawing instead. Pictures
now take their whole box from the start (object-fit keeps the look). A
picture dropped by a re-render while loading no longer counts as missing,
which removed it from every later render until a reload.

"Baixar todos" spilled out of the Fila de impressão header at 1440 px; it
is "Baixar" now, with the full description in its tooltip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 13:09:09 -03:00
Cauê Faleiros
8997e22f5e fix: CNPJ name lookups run on their own thread, so a slow registry never delays orders
All checks were successful
Build and deploy / Validate source (push) Successful in 13s
Build and deploy / Integration suite on a real stack (push) Successful in 3m36s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m10s
The worker looked names up inside its main loop, which also sends orders to
Tiny and asks Mercado Pago about payments. Without internet, or with the
registry slow, five lookups could hold that loop for most of a minute.
They now run on a thread of their own, one batch at a time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 12:31:25 -03:00
Cauê Faleiros
b3c5f63553 feat: customers show by their company's name, taken from the CNPJ registry
The Site asks for e-mail, CNPJ and WhatsApp only, so the Kanban showed an
e-mail where a name belongs and a new Tiny contact was named after it. The
worker now looks up each customer's CNPJ in the public registry (BrasilAPI,
no key) a few at a time, never while a customer waits, and keeps the razão
social and trade name in dtf_local.cnpj_names; a failed lookup is retried a
day later. Cards, the order panel, quotes and the search results show the
trade name (else the razão social) above the e-mail, the search finds
orders and quotes by either name, and a new Tiny contact gets the razão
social as its name and the trade name as fantasia.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 12:19:35 -03:00
Cauê Faleiros
581fbe6be4 feat: a one-off job makes the artwork pictures for orders from before them
The customer's browser makes each upload's picture, so older orders show
"sem prévia" on the Kanban. ops.backfill_thumbnails, run once from the
worker's console, reads each PNG, JPEG or WebP an order or live quote still
refers to and stores a WebP the Site's size. PDFs and CorelDRAW files need
a renderer the server does not have and keep the layout drawing; images
over 100 million pixels are skipped so the worker's memory stays bounded.
Running it again only looks at uploads that still have no picture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 12:11:02 -03:00
Cauê Faleiros
b1fbaad2bd feat: a launch cleanup that clears the test orders, run once by hand
ops.launch_reset counts the orders, quotes, payment attempts and
notifications, and with --confirmar APAGAR removes them, with their moves,
files and notices. The artwork files are marked expired so the worker
deletes them from storage. Operators, the Tiny connection and the backups
stay; --contas also removes customer accounts. It refuses if any payment
was made with real money. Order numbers restart at #1 with the database
administrator's rights, so the script prints the psql line for the db
container when the worker's role cannot do it.

The test runs last in CI, since it empties the order tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 12:07:24 -03:00
Cauê Faleiros
1b445f0459 feat: a Números tab with the production numbers the board already records
Every paid order and every move is recorded, but nobody could see the
totals. The new tab shows, for the last 7, 30 or 90 days: paid orders,
metres sold, money received, the average ticket, how many orders needed a
correction, and the median time from payment to Finalizado. A column per
day charts the metres sold (with a table under it), and a table gives each
stage's median time and what waits in it now, with the oldest order.
Test and cancelled orders stay out.

The header now has five tabs: the search box narrows first, the refresh
picker keeps its width, and the operator's e-mail moves to Sair's tooltip
on narrower screens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 12:01:03 -03:00
Cauê Faleiros
f567e6da89 feat: "Baixar todos" downloads every final file in the print queue, named after its order
To import a day's work into FlexiPRINT the operator opened each order in
Fila de impressão and downloaded its final. The column now has "Baixar
todos": the approved finals of every order in the queue, in queue order,
each named pedido-<n>-item-<i>-<original>. They download one by one from
storage with short-lived links; a zip of multi-GB sheets would go through
the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 11:48:57 -03:00
Cauê Faleiros
c5b1bd37a6 feat: an order in correction offers the customer's WhatsApp with the message written
Customers are not told automatically that their artwork needs a fix: Tiny
has no situação for it. An order in Correção now opens with the reason and
"Avisar no WhatsApp", which opens the customer's chat with the message
ready: the order code, the reason and the link to send the new file in
Minha conta. "Copiar mensagem" covers orders without a WhatsApp number.
The board carries each corrected order's last reason and the Site's address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 11:42:49 -03:00
Cauê Faleiros
e81b2b1681 feat: a Tiny order can be the client's own SKUs per length, 1 metro plus the rest
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 2m31s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 59s
Dropstar's catalogue sells film as SKUs per length, and an order is a sum of
them: 1,30 m is one "1 metro" (DTFIMP.TX.100CM) and one "30 cm"
(DTFIMP.TX.0030CM). The adapter sent one product with the metres as the
quantity. TINY_SKU_<MODE> names a mode's SKU prefix; the order then carries
N times the metre SKU and one 10 cm SKU for the rest, at the price the
customer paid, the last line taking what is left of the item so the order
adds up to the cent. Each code is looked up once by its exact SKU among the
active products. "Testar conexão" and tiny_probe conferir check all ten, and
tiny_probe pedido takes --metros to show a split test order.

Modes without the setting keep their product id: UV and artes avulsas stay
that way until their SKUs are confirmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 10:46:07 -03:00
Cauê Faleiros
a5c1ca53c0 feat: approving the final file is the Kanban's next step, at the top of the order
All checks were successful
Build and deploy / Validate source (push) Successful in 1m11s
Build and deploy / Integration suite on a real stack (push) Successful in 3m7s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m24s
An order in Arte tratada without an approved final showed "Mover para Fila
de impressão" as its main button, which the server refused, while the
approval sat folded at the bottom of the panel. Now the top of the panel
says what comes next: approve the final, with the file that would be
printed and a link to download it. A customer's correction or the
generated PDF is approved with one click; otherwise the upload form opens
in place. Once approved, the main button becomes the move to the queue.

A customer's correction can be approved as the final itself, without
downloading and sending it back. The board carries each order's approved
items and corrections, so cards say "Falta aprovar o final", "Correção
recebida" or "Final aprovado", and the item card shows the correction
instead of the stale reason the generated file could not be made.

Going back a stage is a small link, and cancelling or deleting a test
order moved into a "⋯" menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 10:06:03 -03:00
Cauê Faleiros
4b804a2c85 feat: the Kanban refreshes by itself, every 10 s to 15 min, and says what is new
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 2m37s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 52s
Beside "Atualizar", a picker sets how often the Kanban reloads by itself (off,
10 s, 30 s, 1, 5 or 15 min; 30 s by default, remembered by each browser). It
waits while the operator types, drags or has an order open, and with the tab
hidden it still looks at most once a minute. A new order in "Arte recebida"
or a new quote to review shows a notice, and the count goes into the tab's
title until the operator looks at it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 18:03:21 -03:00
Cauê Faleiros
c3c56a7f21 fix: keep the payment confirmation on screen; only a new checkout drops a paid quote
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 3m3s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m10s
bc1fb60 forgot the paid quote as soon as the confirmation showed, so the next
refresh of the page (the cart emptying) found no quote and replaced "Pagamento
confirmado" with "Nenhum pedido aguardando pagamento". The confirmation keeps
its quote again; the paid one is dropped only when the customer asks to pay a
cart identical to it, which then becomes a new order. The browser test waits
for the confirmation, and checks no "Pedido #" is shown, instead of catching
the momentary "Pedido #N criado" line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 17:07:46 -03:00
Cauê Faleiros
bc1fb60468 fix: a new cart goes to payment instead of showing the last order already paid
Some checks failed
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Failing after 3m19s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Has been skipped
After a payment the browser kept the paid quote as its draft, so a cart
identical to it (the same test repeated) opened the old "Pagamento
confirmado" instead of a payment. The confirmation now forgets the draft, and
a draft found already paid when the customer asks to pay starts a new order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 17:02:35 -03:00
Cauê Faleiros
894e75fd94 feat: Kanban columns are queues, and a card can be dragged up or down
Some checks failed
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Failing after 3m24s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Has been skipped
Each column is sorted explicitly by payment time, first paid on top, however
the board's list was put together (older finished orders, one opened from the
search). A card dragged within its column lands between the two it was
dropped between (queue_key, halfway between their keys) and keeps that place
for everyone; moving to another stage clears it. Reordering is not activity:
the stalled clock keeps running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 16:57:31 -03:00
Cauê Faleiros
d7b1eaae6d feat: customers see an order code, not the sequential number
Some checks failed
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Failing after 3m2s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Has been skipped
"Minha conta" lists and opens orders as "Pedido 1E867B56" (the first 8
characters of the order's id) and searches by that code, so a customer never
sees how many orders the store has. The Kanban shows the code beside the #
number, with a copy button, and its search finds an order by the code a
customer reads out. Tiny keeps its reference (DTF-<number>): it is how a
resent order is found there instead of duplicated, and the WhatsApp notices
the client sends from Tiny use Tiny's own number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 16:50:26 -03:00
Cauê Faleiros
c19941555e fix: the payment confirmation no longer shows the order's sequential number
Some checks failed
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Failing after 3m15s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Has been skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 16:43:40 -03:00
Cauê Faleiros
8236ad8f0a feat: a cancelled order can be deleted
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 2m55s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m2s
"Excluir pedido" now also works on a paid order once it is cancelled; one in
progress must be cancelled first, with its reason. Deleting a cancelled order
also discards its quote, so it neither returns to Cotações as unpaid nor can
be paid again. The payment stays recorded and the audit log keeps who deleted
which order and the cancellation reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 16:32:26 -03:00
Cauê Faleiros
dfa297d9b5 fix: "Excluir pedido de teste" asks before deleting instead of failing
Some checks failed
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 2m51s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Has been cancelled
The order panel kept the "Enviar para correção" button in a variable named
`confirm`, which hid window.confirm from the new delete button ("confirm is
not a function"). It is renamed, as is the same name in the final-files form,
and every question to the operator calls window.confirm explicitly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 16:28:40 -03:00
Cauê Faleiros
05da6d78ad 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>
2026-10-02 16:20:27 -03:00
Cauê Faleiros
7877489563 feat: an approved payment becomes the order by asking Mercado Pago, not only by its notice
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 3m14s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 55s
Production approved a test card while every notification was refused by
signature, and the order never appeared. payments.reconcile() asks the
provider about the payments of open quotes and applies its answer through the
same path as the webhook: the amount must match the reviewed quote, and the
event id (payment id and status) makes a notice and a lookup one delivery,
applied once. The payment page's polling checks an approved card at once; the
worker checks every minute for the rest, such as a PIX paid after the page was
closed. The webhook stays; it is no longer the only way in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 15:58:40 -03:00
Cauê Faleiros
0218f119aa fix: Mercado Pago's signed notifications verify with a pasted secret and close formats
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 2m43s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 54s
Production refused every notification, all current-format (data.id, type),
signed and fresh, though the event and the secret looked right. The secret is
now trimmed (a space or line break pasted into the stack changes every HMAC),
and a few close variants of the signed text are tried besides the documented
one (without the request id, the id's own case, the id from the body); each
still needs the secret. The one that matched, and whether the secret was
trimmed, go to the audit log so the real format can be settled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 15:43:34 -03:00
Cauê Faleiros
ca7cf7f701 chore: say what a refused payment notification looked like
All checks were successful
Build and deploy / Validate source (push) Successful in 10s
Build and deploy / Integration suite on a real stack (push) Successful in 3m8s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 57s
"payment_webhook_rejected reason=signature" did not tell an unsigned old-style
IPN notice (topic/id, which Mercado Pago may send alongside the signed webhook
when a notification_url is given) from a real signature mismatch. The audit now
records the query parameter names, source_news, whether the signature and
request-id headers came, and the signature's age; never values or secrets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 15:18:51 -03:00
Cauê Faleiros
67825a983d fix: payment errors show in red, not in the green of a success
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 2m38s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 54s
The payment page's one message line was always green, so "O Mercado Pago
recusou o pagamento" looked like good news. Each message now has a tone: an
error (a refusal, a form error, a missing field) in red, a changed cart or an
expired quote in amber, a created order in green, the rest neutral.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 13:56:07 -03:00
Cauê Faleiros
90c574a673 docs: the Jadlog freight checked against the old site and confirmed by the client
All checks were successful
Build and deploy / Validate source (push) Successful in 8s
Build and deploy / Integration suite on a real stack (push) Successful in 3m5s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m1s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 13:27:10 -03:00
Cauê Faleiros
5616db1345 feat: Cotações shows the last payment attempt and fits the window
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 2m43s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 53s
Each quote shows its latest payment attempt as a badge ("PIX gerado · expira
12:22", "PIX expirou sem pagamento", "Cartão recusado"), so "tried to pay" is
told apart from "never tried"; quote_view carries the PIX expiry and the
attempt's time for it. The quote stays payable for its 24 hours: a new PIX is
for the same quote.

Cotações now fills the window and never scrolls: a page holds as many quotes
as the list's height fits, measured after each render and on resize, and the
page bar sits at the bottom of the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 11:55:59 -03:00
Cauê Faleiros
1fb2e5d55a feat: expired quotes leave the Kanban, and the buyer's name comes before the e-mail
All checks were successful
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Integration suite on a real stack (push) Successful in 2m42s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 57s
A quote approved more than QUOTE_VALID_HOURS ago can never be paid; it no
longer shows in Cotações, its count or the search. Wherever a customer is
shown, the name comes first (the customer's, else whoever receives the
delivery) with the e-mail under it; with no name, the e-mail alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 11:31:50 -03:00
Cauê Faleiros
7a908060fc fix: the Kanban shows the package's real weight and what Jadlog charges it as
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 2m40s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 57s
"Frete Jadlog · 4,541 kg" read as if 2,30 m of film weighed 4.5 kg. It now
reads "0,47 kg · cobrado como 4,54 kg pela caixa" when the box's cubed weight
is what Jadlog charges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 11:25:26 -03:00
Cauê Faleiros
b7abd401ec feat: Kanban badges: grade pills, product and warning badges, facts in a grid
All checks were successful
Build and deploy / Validate source (push) Successful in 11s
Build and deploy / Integration suite on a real stack (push) Successful in 3m17s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m13s
One badge system on every screen (canvas "Kanban DTF — redesign", v2). The
grade is a pill coloured by the price ladder's bands (90/75/60/40); product,
status and warnings are pills with text, so colour never carries meaning alone.

Quote rows: grade, product, metres, delivery city and age on one line; the
"Aprovada automaticamente" line is gone (only a team review is noted), and a
dot marks quotes from the last ten minutes. The quote detail has a status
badge, the total in large type, a copyable CNPJ, a WhatsApp button, facts in a
grid and items and freight apart. Board cards carry the grade, product, place
and a row of warning badges; columns take their stage colour and filter chips
their counts. The order panel shows what was paid and whether it is stalled at
the top, customer and delivery as cards, a print problem as a callout, the
final-file form behind a "next step", and dates on the right of the history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 11:09:13 -03:00
Cauê Faleiros
4b8b00443e feat: a Jadlog quote counts one box per 60 m of film
All checks were successful
Build and deploy / Validate source (push) Successful in 1m20s
Build and deploy / Integration suite on a real stack (push) Successful in 3m11s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m19s
The client corrected the box to 63 x 15.5 x 15.5 cm and said one box holds
about 60 m. JADLOG_METROS_POR_CAIXA quotes a longer order as several boxes,
each with its packaging weight and volume. UV ships in the same box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 10:04:54 -03:00