Commit Graph

74 Commits

Author SHA1 Message Date
Cauê Faleiros
494925dff4 feat: time in "Aguardando contato" no longer counts in Números (Dropstar's rule D-38)
All checks were successful
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Successful in 3m20s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m0s
Dropstar's internal rules (2026-10-26): waiting for a word with the customer
has no deadline and does not enter the time figures.

- each wait is kept, from the mark to "Contato feito" (and from checkout when
  the customer asks for a proof), in a new table; waits open today are
  recorded from their start
- the time in each stage and "Do pagamento ao Finalizado" leave those waits
  out, and the Números page says so

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:45:14 -03:00
Cauê Faleiros
6a921415ea feat: the folders catch up on what passed while the Kanban computer was off
All checks were successful
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Successful in 3m27s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 56s
Dropstar's internal rules (2026-10-26): the folder must reproduce what passed,
not only what sits in the columns when the computer comes back, or a room
running 24 hours leaves a gap a week in the Finalizado archive.

- the Kanban remembers when the folders were chosen and asks for every order
  paid since then, whatever its stage; each file goes to its stage's folder,
  so an order finished while the computer was off lands in 3. Finalizado
- orders paid before the folders were chosen still stay out, so setting them
  up never pulls old orders back into the queue
- the server's file list for the folders and Baixar now loads only the orders
  that have a file, not every order in the stages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:15:16 -03:00
Cauê Faleiros
35e64d77d7 feat: "Arte tratada" flags the orders whose final the team prepared, counted in Números
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 3m20s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 58s
Dropstar's internal rules (2026-10-26) asked how to tell art that arrived
ready from art the designer had to fix, and Marcus agreed on 2026-10-27 to
mark it automatically, for the designer's productivity.

- an order whose approved final is not the customer's art (not the file the
  system generated from it, not one of their originals, not a correction
  they sent) shows "Arte tratada" on its card and in the order, with who
  approved it
- Números counts the period's treated orders, the share of all orders, and
  how many each person approved
- the Kanban's cancel text: the money stays as the customer's credit, in
  Dropstar's financial control (rule D-15), no longer a refund
- Números' machine table shows the orders waiting in Arte conferida again;
  it still looked for the old print queue

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:01:35 -03:00
Cauê Faleiros
ee1159065a feat: the orders' files in Dropstar's three folders: Arte recebida, Arte conferida, Finalizado
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 4m27s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m19s
Asked by Dropstar on 2026-10-23 and agreed on 2026-10-26. The automatic
folder becomes "Pastas dos pedidos": one main folder is chosen once, in
Chrome or Edge on a factory computer that reaches the server, and the
Kanban keeps three folders inside it, moved with the card.

- Arte recebida: the order's file as soon as the order arrives
- Arte conferida: the queue; the file moves there with the card and stays
  while it prints and is checked in Revisão
- Finalizado: when the order is released, kept 30 days
- Correção, a cancellation or a deletion takes the file out; a replaced
  final is swapped
- orders already printing when the folder is chosen are not downloaded; a
  file someone took out comes back only when its order moves on, so the
  server now returns the files of orders the folders hold while they print,
  are checked and finish
- Firefox, which cannot write into folders, still only downloads the files
  entering Arte conferida

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 16:31:20 -03:00
Cauê Faleiros
b6f20733fa feat: Dropstar's new flow: Arte conferida is the queue, Revisão and the Revisor
All checks were successful
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Integration suite on a real stack (push) Successful in 3m36s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m24s
The board Dropstar drew on 2026-10-23: Arte recebida, Arte conferida,
Imprimindo, Correção, Revisão, Finalizado.

- Fila de impressão leaves the board: Arte conferida is the queue. It takes
  an order only with every item's final approved, keeps the finals as
  approved, orders its cards for printing and has the room's "Baixar" and
  the automatic folder. Orders that were in the queue move there once, with
  a line in their history
- Revisão checks the printed sheet, and the new Revisor profile is the only
  one that sends an order to Finalizado (the superadmin too, for support)
- who moves what, from the server (MOVES): the designer the artwork, asking
  for corrections and bringing the new art back; the operator Arte conferida
  to Imprimindo to Revisão; admin and gestão everything else, Correção
  included; a step back belongs to whoever makes the move it undoes
- Tiny: Arte conferida is "Preparando envio" and Finalizado "Pronto para
  envio", for delivery orders too
- Prova OK still comes before Finalizado; the customer's portal shows the
  new steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:45:57 -03:00
Cauê Faleiros
88819c3a5f feat: one price per product; the grade is shown but no longer prices
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 3m58s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m11s
Dropstar asked on 2026-10-23 to drop the five-band ladder by grade:
textile R$ 19,90 a ready sheet and R$ 21,90 loose art, UV R$ 79,90 and
R$ 89,90.

- the server charges PRICES (app/core/pricing.py) whatever the grade; the
  grade is still validated and kept with the item, and discount_cents is gone
- a file opened by hand pays the product's price plus MANUAL_FILE_EXTRA_CENTS
- the Site's PRECO replaces FAIXAS, TABELA and MONTAGEM; the top chip, the
  home example, the product cards, the selector and the price table read it
  (data-preco), so no page still says "a partir de R$ 14,90"
- no "Desconto pela nota", ladder, "cai até" or "sai mais barato" anywhere;
  the buy box shows "Nota da arte" on its own line, the 96 DPI refusal and the
  resolution warning stay
- the review reason "Nota informada sem análise da arte" is removed: it only
  stopped a discount. The server still checks the grade against the files,
  so the grade shown on the Kanban and in Tiny stays honest
- the Tiny probe's test order uses the single price
- docs/CONTEXT.md: Commercial rules and Still to do

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 11:07:00 -03:00
Cauê Faleiros
a9253d830a feat: Dropstar's answers of 23/10 that need nothing more from them
All checks were successful
Build and deploy / Validate source (push) Successful in 1m6s
Build and deploy / Integration suite on a real stack (push) Successful in 4m5s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 2m6s
- JPG is refused in every product, at upload and by the server: it has no
  transparency, so the background prints and loose art packs as a box
- a PDF over 150 MB says before payment that the Site cannot check it, as a
  file opened by hand does
- every piece that is not square is tried both ways; the 1 cm rule left
  19,5 x 18,5 cm standing, 2 to a row instead of 3
- a mirrored order (UV only) is flagged on its card and panel, and its print
  file's footer ends in ESPELHADO, in bold
- print files are named DTF-23-item-1, and the order panel copies DTF-23-,
  so the code pasted into the folder's search finds them
- the proof: up to 30 cm, from the thinnest lines, a piece of each different
  artwork, at most three per order, free
- a file opened by hand costs R$ 2,00 more a metre by default, and the Site
  says so

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:33:22 -03:00
Cauê Faleiros
1dc8cf1efb feat: the print proof: Prova OK before Finalizado, and a proof the customer can ask for
Some checks failed
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Failing after 56s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Has been skipped
Dropstar's items 15 and 16 (2026-10-21).

- an order above 10 m prints 20 cm of proof first; the room checks it and
  marks "Prova OK", without stopping the order, and without that mark the
  order cannot reach Finalizado
- at checkout, "Quero aprovar uma prova antes de imprimir", for any length:
  the paid order arrives marked "Aguardando contato" with what to do, and
  waits for the customer's word on the photo sent by WhatsApp
- the card shows Prova / Prova OK, the panel gives the next step, and
  "Prova a conferir" is a board filter; the designer cannot mark it
- the proof is not billed, as Dropstar leans; rounds and which part of the
  sheet wait for their answer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:21:26 -03:00
Cauê Faleiros
3ae453f47a fix: Números measures what Dropstar asked: machines by film printed, stages by order
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 3m23s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 1m7s
- a machine's metres are the film printed, not the metres billed, which round
  up to one metre and made small orders look like fast printing
- orders in Imprimindo together on one machine count that time once
- a stage's median time is per order, the sum of its passages, so rework
  reads as one slow order instead of quick passages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:25:08 -03:00
Cauê Faleiros
d4494a0654 feat: Dropstar's corrections of 21/10 that need no answer from them
All checks were successful
Build and deploy / Validate source (push) Successful in 1m30s
Build and deploy / Integration suite on a real stack (push) Successful in 4m2s
Build and deploy / Secret scan and release gate (push) Successful in 14s
Build and deploy / Publish images (push) Successful in 1m48s
- the home example priced as the ready sheet it shows (nota 92, R$ 14,90)
- opening hours 7h to 18h, and art sent at any time
- uploads up to 1 GB, every file scanned
- a Designer profile: artwork and corrections on every order, moving only
  among Arte recebida, Arte conferida and Correção
- Números by date range, per machine, and orders apart from passages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:09:15 -03:00
Cauê Faleiros
53c6234feb feat: machines share the work by metres open, with an optional limit, their load on show and operators set from the machine
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 3m31s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 59s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 10:28:13 -03:00
Cauê Faleiros
df30046027 feat: Integrações buttons only for the superadmin; the folder downloads in Arte recebida by default
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 3m7s
Build and deploy / Secret scan and release gate (push) Successful in 4s
Build and deploy / Publish images (push) Successful in 47s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 09:55:31 -03:00
Cauê Faleiros
c8857a5bf5 feat: the team no longer gets alert e-mails; the Kanban user form drops the option
All checks were successful
Build and deploy / Validate source (push) Successful in 47s
Build and deploy / Integration suite on a real stack (push) Successful in 3m38s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m20s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 09:37:41 -03:00
Cauê Faleiros
12d5ba8d15 feat: passwords need 8 characters or more, on the Site and in the Kanban
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 3m28s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m2s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 15:31:59 -03:00
Cauê Faleiros
3879754397 feat: customer e-mails in the Site's look, and an order confirmation
All checks were successful
Build and deploy / Validate source (push) Successful in 49s
Build and deploy / Integration suite on a real stack (push) Successful in 3m23s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m17s
The account e-mails (signup and e-mail change codes, new password, an
address that already has an account, the changed-e-mail notice) gain an
HTML version beside their plain text: the DROPSTAR header, a white card,
orange buttons, the customer greeted by first name. Built with tables and
inline styles only, so Gmail, Outlook and phone apps show it the same.

A paid order now also e-mails the customer "Recebemos seu pedido #N": the
items, delivery and total, the stages to come, and a link to the order in
the account. Not for an operator's test order. A code's or a recovery
link's HTML is erased with its text once sent. The team's alerts stay plain
text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:18:20 -03:00
Cauê Faleiros
dbf1efc112 feat: Tiny follows printing and cancellation
Some checks failed
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Publish images (push) Has been cancelled
Build and deploy / Secret scan and release gate (push) Has been cancelled
Build and deploy / Integration suite on a real stack (push) Has been cancelled
With TINY_STATUS_UPDATES on, an order entering Imprimindo becomes
"Preparando envio" in Tiny, and a cancelled order "Cancelada", next to the
"Aprovada" on payment and the pickup "Pronto para envio" there already.
Neither sends a WhatsApp in the client's n8n. An order the team already
moved further in Tiny is never moved back, and an invoiced one is not
cancelled here: its nota fiscal is cancelled in Tiny. Cancelling a paid
order now tells Tiny, which it did not before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 18:45:23 -03:00
Cauê Faleiros
1f2358c8b5 feat: the cart and the account ask for the customer's name
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 4m49s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m15s
The Site asked only for CPF/CNPJ, WhatsApp and e-mail, so a person's Tiny
contact was named after the recipient or the e-mail, and the WhatsApp notices
the client's n8n sends from Tiny greeted "Olá, fulano@gmail.com". The cart's
"Seus dados" and the signup now ask for a name, the account page can change
it, and it names a CPF customer's Tiny contact (a CNPJ keeps the registry's
razão social), the Kanban card and the team's alerts. Orders placed before
have none, as the server still accepts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 18:38:09 -03:00
Cauê Faleiros
7eb7d90f8b refactor: remove the WhatsApp integration
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 4m24s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m11s
The system will not send WhatsApp messages: the client's n8n already does,
from Tiny's status changes. Paid orders and stage changes now queue only
the Tiny delivery; the fake WhatsApp adapter, its setting and secret, the
Integrações row and the send log's Destino column are gone, and the old
WhatsApp log rows are removed. The customer's WhatsApp number, the
"Avisar no WhatsApp" link for corrections and the contact links stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 17:49:50 -03:00
Cauê Faleiros
6919383d37 feat: "Fazer backup agora" in Integrações
All checks were successful
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Integration suite on a real stack (push) Successful in 4m40s
Build and deploy / Secret scan and release gate (push) Successful in 13s
Build and deploy / Publish images (push) Successful in 1m29s
The backup row gets a button that asks for a backup outside the daily hour,
for after a failure or before a risky change. The Kanban records the
request; the backup service, which alone may read the whole database, looks
every minute and runs it. The row says it was asked for until it runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 17:09:00 -03:00
Cauê Faleiros
4f49ace867 fix: accounts confirmed more than a day ago also bring their orders
Some checks failed
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Integration suite on a real stack (push) Failing after 4m2s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Has been skipped
The signups that marked an account as confirmed are deleted after a day, so
an older account was left unconfirmed and brought nothing. The code e-mail
sent before the account existed stays in the queue and now counts too. A
password reset, whose link came by e-mail, also confirms the address and
brings the orders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:51:25 -03:00
Cauê Faleiros
1a7736dc8b feat: an account brings the orders bought without it with its CPF/CNPJ and e-mail
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 4m44s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m22s
At signup (once the e-mailed code confirms the address), on an e-mail
change and at every sign-in, a confirmed account takes over the guest
orders placed with the same CPF/CNPJ and the same e-mail, from any browser,
with their carts and files. A CPF or CNPJ alone, which others may know,
brings nothing; neither does an account whose e-mail was never confirmed.
Accounts already confirmed by a code are marked as such.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:35:07 -03:00
Cauê Faleiros
4a2ce72764 feat: the folder can download as the order arrives, and removes cancelled orders' files
All checks were successful
Build and deploy / Validate source (push) Successful in 14s
Build and deploy / Integration suite on a real stack (push) Successful in 5m5s
Build and deploy / Secret scan and release gate (push) Successful in 11s
Build and deploy / Publish images (push) Successful in 1m23s
Integrações gets "Baixar ao chegar" next to "Baixar na Fila". On arrival the
file (the generated print file, or the final once approved) goes into a
Recebidos folder inside the chosen one and moves up when the order enters
the queue. Files of orders cancelled, deleted or sent back for correction,
and files replaced by another final, leave the folder.

The launch reset now restarts order numbers at #1 by itself: the worker's
role may set the orders' number sequence, and nothing else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:07:29 -03:00
Cauê Faleiros
b83e60ef0c feat: customers buy with a CPF or a CNPJ
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 4m57s
Build and deploy / Secret scan and release gate (push) Successful in 13s
Build and deploy / Publish images (push) Successful in 2m1s
The cart and the account signup take either document, each with its own
mask and check digits. Tiny gets a person (F) for a CPF, Mercado Pago the
matching identification type, and only CNPJs go to the company registry.
The Kanban, the account page and the alerts show which one it is.

Also pins the Correios test's clock: its fake token expired today, so the
suite failed from Oct 16 on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 13:33:50 -03:00
Cauê Faleiros
90e3126075 feat: the cart offers Correios PAC and SEDEX next to Jadlog
All checks were successful
Build and deploy / Validate source (push) Successful in 1m48s
Build and deploy / Integration suite on a real stack (push) Successful in 4m25s
Build and deploy / Secret scan and release gate (push) Successful in 15s
Build and deploy / Publish images (push) Successful in 1m54s
Dropstar sent its Correios contract. The cart now asks every carrier at once
for the CEP and lists each option with its delivery time, cheapest first and
chosen by default: Jadlog .PACKAGE, Correios PAC and Correios SEDEX, plus
pickup. A carrier that does not answer is left out instead of blocking the
others, and the server quotes the customer's choice again at approval. The
order summary, the Kanban and Minha conta name the carrier chosen.

app/correios.py follows the CWS manuals: a token from the posting card (kept
until shortly before it expires, renewed once if refused), the contract's own
prices by its DR, and the delivery time. Each box is one object priced by its
sides; Correios work out the cubic weight. All carriers price the same
package, now in app/package.py. Only CORREIOS_CODIGO_ACESSO goes in the
stack; the user, card and contract are its defaults. python -m
app.correios_probe checks the contract and its service codes on the account.

Tested: tests/test_correios (token, contract parameters, prices in Brazilian
format, boxes, a code override, a failing carrier), the full suite in a
CI-style stack, and the cart in Brave on desktop and phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:47:53 -03:00
Cauê Faleiros
7383e44ff4 feat: a new account e-mail is confirmed with a code, and the old one is told
Changing the e-mail in Dados da conta took effect at once, with nothing
checking the new address: a typo locked the customer out, and anyone at a
signed-in computer who knew the password could move the account to their own
e-mail and then reset its password. Now the code goes to the new address, the
account changes only once it is entered (same screen and limits as signup,
and only the account that asked can complete it), and the old address gets
"O e-mail da sua conta foi trocado", with the WhatsApp to call if it was not
them. Without e-mail on, it changes at once as before.

Signup and e-mail change share one code check (expiry, five attempts, the
60 s resend wait). Tested: mail_test (wrong password, same and taken e-mail,
wrong code, another account's attempt, resend wait, the notice), the full
suite in a CI-style stack, and the screen in Brave.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:32:46 -03:00
Cauê Faleiros
95be624cca feat: a new account is confirmed with a code sent to its e-mail
All checks were successful
Build and deploy / Validate source (push) Successful in 17s
Build and deploy / Integration suite on a real stack (push) Successful in 4m25s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m22s
Anyone could open an account on someone else's e-mail. Now "Criar conta"
e-mails a 6-digit code, and the account exists only once it is entered: one
big field that takes a paste or the phone's autofill and confirms by itself,
"Reenviar código" after 60 s, "Trocar e-mail", and the sign-in box hidden
meanwhile.

Security: 15 minutes per code, 5 wrong attempts, at most 5 codes, limits per
address and per source; the password is hashed at the first step and the code
stored only as a hash, its e-mail erased once sent. An address that already
has an account gets the same answer on screen and a "você já tem conta"
e-mail instead of a code, so the form does not reveal who is registered.
Without e-mail (MAIL_ADAPTER=off) the account is created at once, as before.

The browser test reads the code from a local-only endpoint that exists only
where e-mail stays in the log. Tested: mail_test (wrong, locked, resent,
expired codes, existing address, erasure after SMTP), the full suite and the
browser test in a CI-style stack, and the screens in Brave on desktop and phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 15:18:37 -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
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
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
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
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
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
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
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
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
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
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
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
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
Cauê Faleiros
26c46ccc1d feat: Jadlog quotes by the larger of the real and the cubed weight
All checks were successful
Build and deploy / Validate source (push) Successful in 9s
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
The client's box is 56 x 14 x 14 cm and weighs 0.30 kg; the film is 0.075 kg
per metre. Jadlog charges the larger of the real and the cubed weight, and this
box is large for its weight, so quoting the real weight alone would price
below what Jadlog charges. JADLOG_CAIXA_CM and JADLOG_CUBAGEM_KG_M3 (both or
neither) give the cubed weight; the quote sends the larger. Until the
contract's factor is set, the Kanban's Frete card says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 16:20:44 -03:00
Cauê Faleiros
352590e63a feat: Kanban shows each order's artwork, filters quotes and searches orders and quotes
All checks were successful
Build and deploy / Validate source (push) Successful in 1m25s
Build and deploy / Integration suite on a real stack (push) Successful in 3m16s
Build and deploy / Secret scan and release gate (push) Successful in 13s
Build and deploy / Publish images (push) Successful in 1m29s
The customer's browser sends the small picture it already makes of each file
(at most 300 KB, WebP/JPEG/PNG read from the bytes, own uploads only); it goes
when the file's bytes go. Board cards, quote rows, the order panel and the
quote detail show it, with the layout drawing as a second view and as the
fallback for files without a picture.

Cotações gets a customer filter (e-mail, CNPJ, WhatsApp) and product, layout
and resolution-warning chips, with the page bar always shown. The board adds
Entrega, Retirada and stalled-order chips. The top search now covers orders in
any stage and unpaid quotes; CNPJ and phone match by digits only when nothing
but digits and punctuation was typed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 11:46:33 -03:00
Cauê Faleiros
24ee4e9eab feat: Minha conta with sign-in, overview, orders and account details
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 3m7s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m6s
The order page becomes the customer's area, one page at four addresses:

- /conta/entrar: sign in or create an account, side by side. "Esqueci
  minha senha" points to the Dropstar WhatsApp until e-mail can be sent.
- /conta: the counts of orders waiting for payment, in production, in
  correction and finished, and the latest one.
- /conta/pedidos: every order and the cart waiting for payment in one list,
  newest first, filtered by group, order number and period, ten per page.
  The cart shows "Aguardando pagamento" and its "Pagar" goes to the PIX
  page when a PIX code is open. An order opens in place with its progress,
  items, delivery, history, files and the correction form. A guest sees
  the orders paid in this browser.
- /conta/dados: WhatsApp and a saved delivery address (the CNPJ is locked),
  e-mail and password changes, both confirmed with the current password;
  a password change signs the other devices out.

The cart fills in the account's details and saved address. New API routes
for the details, and the order list takes filters and pages and returns
the counts; only the newest unpaid quote whose files still exist is listed.
The Site's "Minha conta" and "Ver meus pedidos" point to the new addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 16:57:37 -03:00
Cauê Faleiros
37715ef223 feat: the server checks the grade against the files before approving
All checks were successful
Build and deploy / Validate source (push) Successful in 1m23s
Build and deploy / Integration suite on a real stack (push) Successful in 3m13s
Build and deploy / Secret scan and release gate (push) Successful in 10s
Build and deploy / Publish images (push) Successful in 1m25s
The price depends on the grade, which the browser worked out and the API
took on trust. Before a cart is approved at checkout the API now recomputes
it from the uploaded files by the Site's own rules: the pixel size in a
PNG, JPG or WebP header across the printed width (rotation included), and
the area-weighted DPI of the images placed in a PDF of up to 150 MB, 300
for vectors. Sheets take the worst grade, artworks the average. A claim more
than 2 points above the file's grade, or a discount on a file the server
cannot grade, waits for an operator, with the reason on the Kanban.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 12:24:37 -03:00