Interno: the Expedição assembles the marketplace's own sales on the fixed
internal customer Gestão fills in once; no Tiny order, no paid e-mail,
marked interno, it stays in house. Venda: a Vendedor or Gestão picks the
customer from the Tiny base and the order goes to Tiny like an approved
quote, faturado (Boleto from TINY_RECEIPT_BOLETO when set), pickup or
'junto com o pedido de roupa nº X'. Números counts both at table price,
apart from cash (and the average ticket over cash orders only). Each stamp
can carry a brand and a public flag for the future catalogue.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Every db.connect() opened a new Postgres connection; with DB_POOL=on each
process keeps a psycopg_pool pool (DB_POOL_SIZE, default 20, 10 s
acquisition timeout, dropped connections replaced) with the same
commit/rollback contract. Production stays off until switched in Portainer;
the local stack and CI run with it on. Two nested acquisitions that ran on
every board load and in audits now reuse the caller's connection.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The montador sends each stamp to storage, splits the list into items of
at most 20 sources and 4000 copies, packs each one with the Site's engine
and creates the order in Arte recebida: typed customer, pickup, the Site's
table price, payment 'faturado', origin dropflow for Expedição and
atendimento otherwise. Until Dropstar decides, these orders do not go to
Tiny and the customer gets no paid e-mail. Vendedor and Expedição may now
upload through the operator upload routes (can_any).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
An approved quote with no payment expires on its own after 24 h, never
while a Pix or card attempt is still live: the worker marks
quotes.expired_at, frees its files and e-mails the customer that the
order expired and can be sent again on the Site. The backlog from before
this front expires silently.
Kanban: Cotações › Aguardando pagamento shows when each one expires and
the review gets an "Abrir conversa" WhatsApp button; Números gets
"Pedidos sem pagamento" (made, paid, expired, waiting, abandonment rate).
release_files moves to app/payments.py so the worker can use it; an
expired quote no longer counts as open there. New tests/unpaid_test.py
in the integration job.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The proof card owns its final PNG, keeps its parent locked until the seller
answers, enters the queue first, and shares one machine with the parent.
The board no longer assigns a machine at payment; the puller records it.
A stalled print file times out with a card warning and a retry, finished
orders sort by completion, and finals are stored as PNG. The original
download carries the order number (items 0.1, 0.4 to 0.7 and 0.9).
An order with a proof (asked for at checkout, or above 10 m) gets a child
card "Prova": an order of its own (orders.parent_id), no sale, with the
film's first 30 cm as DTF-N-item-1-prova.png ("Prova do pedido DTF-N" in its
footer), which follows the flow up to Revisão like any card, hot folder
included. The order waits outside the queue, "Aguardando prova": it is not
pulled to Imprimindo, nor counted in the queue's places.
In Revisão the card is answered by the Vendedor, Gestão or the
Administrador (capability "proof"): Prova OK records who and when and puts
the order in Arte conferida when its finals are approved; Prova reprovada,
with its reason, sends the order back to Arte recebida, its final to be
approved again, and offers "Nova prova". Either way the card closes and
leaves the board. An order from before the cards keeps the old Prova OK.
The card is kept out of Tiny, e-mails, Números, the search, Finalizado and
the customer's account. Deleting an order takes its cards and their rows:
movements, order files and print files now cascade with their order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Marcus's ids of 2026-10-27: the revenue category DTF DROPFLOW (987032506)
for Dropflow orders, which no longer stay out of Tiny, and the formas de
recebimento Dinheiro (919478944) and CORREÇÃO DTF (977493654) for the
customer's credit, on orders the team registers as paid outside the site.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On an approved quote in Cotacoes, Administrador, Gestao and Vendedor pick
the origin (Site, Dropflow, Atendimento) and how it was paid (Pix, cartao,
dinheiro, credito do cliente), neither preselected, with an optional note.
The price is the quote's, the Site's table price. The order is marked paid
outside, counts in Numeros, and goes to Tiny like a Site order with the
payment named in its internal note; a Dropflow order stays out of Tiny,
status updates and cancelling included, until its revenue category exists.
Auto-refresh waits while a register form on screen is half filled in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Orders carry site, dropflow or atendimento, required and with no default,
limited to the three. The Site's orders are marked site where they are
created; older orders became site. The Kanban shows the origin on each card
and in the order panel, filters by it, and Numeros has a Por origem table:
orders, metres, money and time from payment to Finalizado per way in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
Dropstar's item 5 (2026-10-21). The engine placed pieces on a 5 mm grid,
rounding each up: two 28,2 cm pieces needed 57,5 cm on a 57 cm film, so the
second column slid 8 cm down, rows ended 8,6 mm apart and nothing was left
at the edges. Order 1 came out 97,14 cm long.
- pieces are laid out in rows with their exact sizes: 5 mm at the top, the
bottom and between rows; across the width 5 mm at the edges and between
pieces, or, when that does not fit, the space left shared out equally,
never under 1,5 mm (order 1: 2 mm each, 89,42 cm long)
- each artwork stands or lies down, whichever gives the shorter sheet
- the shape packing (pieces fitting into each other) is kept only when it
saves at least 1 cm; otherwise the columns stay aligned
- the order records layout version 3; quotes made with version 2 still pass
- the preview says the spacing really used
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read from two of Dropstar's store orders: a paid order now carries its
forma de recebimento (Pix or credit card) with one parcel on the day, the
carrier with freight paid by the sender (Correios with the contract's PAC or
SEDEX, Jadlog's .PACKAGE, or the DropStar carrier with "Retirar
pessoalmente" and "Retirar em loja" for pickup), and the expected date in
working days. Formas de envio and de frete are looked up by name and code;
the two formas de recebimento and the carrier, which the app may not list,
are Dropstar's ids. Category, seller and tag wait for Dropstar's answer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
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>
Files are uploaded before payment so the price and the security check use
the file itself, but an abandoned cart kept them for 30 days. Now a finished
upload is held 2 days, a quote waiting for review 7, an approved quote 2 more
to be paid, and the paid order keeps its originals for 30 days from upload.
A payment never starts for files that are gone; one under way holds them a
day. Files attached to an order take the order's window.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without an approved card payment there was no way to try the board, the
files and the print flow in production. "Criar pedido de teste" on an
approved quote creates the order through the same path as a paid one, marked
TESTE on its card and panel and audited; neither it nor its stage moves
queue anything for Tiny or WhatsApp.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Week 2 work that did not need client inputs.
Print files (1.4): each paid item gets a PDF the width of the film and the
length of the approved layout, with every copy at its reviewed position,
rotation and mirror. Sources are embedded once at original resolution; JPEG
bytes pass through and PNG alpha becomes a soft mask. Artwork the generator
cannot reproduce goes to hand preparation with the reason. The worker renders
outside any transaction, and the operator approves the generated file as the
final one through the existing review.
Delivery address (3.8): required for any non-pickup quote, bound to the
quoted CEP, carried into the order snapshot, the Kanban card and Tiny.
Kanban (1.5): print-file status per item, and a panel of payment events that
need a person (money without an order, refunds after an order) until an
operator records the resolution.
Mercado Pago and Tiny (1.1, 1.3): adapters written from the public API
documentation and tested against fake transports only. Selectable for
sandbox testing with their credentials; the production preflight still
blocks release. Adds payment intents and a PIX step on the Site.
MinIO: Docker Hub and quay.io now refuse anonymous pulls, so local and CI
storage use Chainguard's MinIO build, pinned by digest.
Verified with the full CI integration sequence on a fresh local build,
including the new print_file_test and both browser suites.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was no inbound payment path at all: a button called a fake synchronously
and wrote an order. A real provider does the opposite — it charges, then tells
us, repeatedly, out of order, and sometimes long afterwards.
POST /api/payments/webhook verifies the signature before the body is parsed, so
an unsigned or tampered delivery is refused and recorded without touching an
order. Verified deliveries are stored under the provider's own event id with a
unique constraint, and applied inside the same transaction that marks them
processed: a repeat is a no-op, a crash is retried rather than half-applied.
An approval whose amount disagrees with the reviewed quote does not become an
order. Underpayment would ship artwork nobody paid for, and overpayment means
something a person should look at.
Order creation moved to app/payments.py so the webhook and the local development
checkout share one implementation and cannot drift. That also closes 3.5: the
charge happens inside the transaction that persists the order, rather than
before it.
The adapter contract is create/verify/parse. FakePayment implements it with a
real HMAC scheme so the whole path is exercised now, by tests/payment_test.py:
unsigned, tampered, underpaid, duplicate, re-sent, unknown reference, and
non-approved statuses. Connecting Mercado Pago is one adapter; no service code
changes.
PAYMENT_WEBHOOK_SECRET is optional in production on purpose. Required would
break the next Portainer render, and a guessable default would be worse than
either: with no secret configured the adapter verifies nothing and therefore
accepts nothing, which is the right state until a provider is connected.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>