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>
app/cart_pricing.py prices a cart once for every caller: the catalog read
once, a pure price_items (base price, manual extra, splits, bands) pinned
against today's arithmetic by a 16-cart characterization test, then the
grade rules, the coupon and the treatment. create_quote and approve call
it instead of their two drifting copies; the Site's pre-check now counts
the manual-file extra like the approval does.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A pure move: the 48 Kanban routes, their code and comments are unchanged,
grouped in session, board, quotes, orders, rework, integrations, stats
and files, with shared helpers in common. The fast CI check now compiles
the package's files too (app/**/*.py does not reach a third level without
globstar).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The API ran as one uvicorn process, so a slow 150 MB PDF check at checkout
held every other request; WEB_CONCURRENCY now comes from API_WORKERS
(default 2, 1 restores one process) and the api /tmp grows to 512 MiB for
two checks at once. The worker delivered one outbox job per second; it now
drains up to 50 per pass before its periodic tasks.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Gestão sets in the Site tab below which grade the designer is warned and
below which the designer treatment is required (only while it is offered).
The decision is stored with the approved quote, so a later change never
rewrites old orders; the card shows 'Nota N: conferir a arte', the Site
forces the treatment box with the reason. With no rule nothing changes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
schema.sql dropped and re-added three CHECK constraints on every start, so
an older image narrowed the lists and failed on rows written by a newer one
(an Expedição user, for example). They are now created only when missing,
and app/migrate.py applies timestamped files from app/migrations/ once each,
recording them in dtf_local.migrations; an older image skips names it does
not know. The first migration sets today's full lists. A CI step rehearses
the rollback on the real database inside a rolled-back transaction.
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>
Dropstar uploads the six videos themselves; 100 MB was our own limit and
could stop a longer video in the videos area. ClamAV scans up to 2000 MiB,
so 500 MB is still scanned.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Gestão creates coupons in the Site tab: a code, a percentage or an amount
per billed metre, validity, a minimum of metres, use limits in all and per
customer, one product or all, and a note; they can be paused and deleted
(kept for history). The customer types the code at checkout; the server
checks it when the quote is made and again at approval, discounts only the
eligible items after the bands (never freight or the treatment) and keeps
the coupon on the order. Tiny gets the discount, the e-mail and receipt
show it, the order panel carries a badge and Números counts orders,
metres, discount and money per coupon.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Dropstar uploads the six videos themselves, so the panel moves from
Integrações to the Site tab, next to products and prices. A video can be
published without a VTT: the Site plays it without a captions track.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A price may carry up to five bands, "from N m, R$ Y": the order's total
billed metres of that product chooses one price for its whole quantity,
the manual-file extra still on top. Bands start and become history with
their price row. The Site charges the same band for the cart, shows
"Faltam X m para R$ Y o metro" and lists the bands under the price
table; the Kanban's Site tab edits them.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Gestão and the administrators switch each product on and off and set its
price from a start date; a price that has started is history and cannot
change, a scheduled one can be cancelled. The Site and the server read
the current price; with no row the code's prices and TREATMENT_CENTS
still apply, so nothing changes until someone sets one. A switched-off
product disappears from the Site and new quotes with it are refused.
Approved quotes and paid orders keep their price.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The new Expedição profile and the seller may assemble sheets (capability
assemble). Gestão edits the size table (letter and width). The Montar tab
reads Estampas/<code>-<size>.png or <code>.png from the orders folder,
checks the resolution with the Site's 96/200 DPI ruler, merges repeated
lines and estimates the metres. Montar itself is slice 2.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
An order generated before item 13 had a PDF print file and no strips,
so the 100% viewer opened it blank. Those still in Arte recebida, with
no approved final and no customer correction, are generated again once
as PNG with strips (migration png-regenerate-v1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new Números section, "Máquinas, mês a mês", one column per machine
and a month at a time: metres printed, metres per hour and hours
running (time shared by two orders counted once), hours stopped with
their reasons; metres per film roll, ink per 100 m by colour, powder
per 100 m; supplies, parts and total cost per metre; what the printed
orders sold, the month's contribution and since installation; and the
return in % and months to pay back once Gestão types the price.
Refills stand for consumption. Every ratio without data shows "—".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The machine's name in Imprimindo (and "Ficha" in Usuários › Máquinas)
opens its sheet: metres since the last cleaning and since the last film
change, each supply's estimate, pending alerts and the entries. The room
enters supplies (film, ink by colour, powder; a supply without cost
takes the last one), parts (cap, damper, head, wiper, other) and events
(cleaning, head alignment, a stop with reason and minutes). Gestão types
the price, installation date and supply minimums.
Alerts appear when someone pulls the next card onto the machine, never
mid-print: 10 m since the last cleaning, 20 m after a film change
without aligning the head, and a supply at its minimum. Marked done it
records the event; postponed once it lets one more card through. The
server refuses the pull otherwise. Counters start when the sheet went
live (machines.log_since), not from everything printed before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In Revisão the card gets "Revisar": a photo or a video of up to 30 s of
the printed sheet, from the computer's or the phone's camera in the
browser, or a file already recorded. It is attached to the order as
DTF-<n>-revisao-<seq> with when and who, kept 180 days, and copied by
the computers with the order folders to Kanban/Revisões/. A photo needs
1600 px on its longer side. An order above 1 m cannot reach Finalizado
without one. In Finalizado the customer's order page shows the photo.
The Revisor, Gestão and the administrators take it (capability
"inspect"). Dialogs opened from a card's face or the board (Revisar,
Editar tempos) now show over the page when the order panel is closed;
inside the closed panel they were invisible.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A paid treatment adds its 24 h to Arte recebida's acceptable time, on
the card and in Números (fronts 5 and 11).
- TINY_PRODUCT_TREATMENT is a required Tiny setting once the treatment
has a price, instead of every treated order failing at the Tiny.
- A quote reads each PDF once: Files caches the header and the DPI.
- A proof made from the parent's final split into parts uses the part
that holds the finest stroke, not the last one (0.1).
- Prumo report: one format line per item, the time from the claim (kept
on the finished print file), and the stroke class in customer words.
- The Site says the Prumo checks the art, and a too-tall PNG no longer
says "Este PDF".
Co-Authored-By: Claude Opus 5.5 <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>
A delivery is done when it leaves and a test card is not production. Only
pickup orders waiting in Finalizado can be late, and the top strip now
shows working columns; the finished pickup keeps its card colour and its
place in Números.
TREATMENT_CENTS sets a fixed price per order; 0 keeps the option hidden.
The cart shows the designer treatment and adds 24 h; the quote total and
Tiny line carry it, and the card gets the "Tratamento pago" label. The
designer uploads the treated file through the existing card flow.
Gestão edits the hours and the responsible for each column. A card past the
limit turns yellow, twice the limit red, and the board lists it under
Atrasados. Números compares the real median with the limit and counts the
passages that exceeded it in the period and today.
Every order now carries a short report of the decisions that happened:
original format, conversion, resolution, background, residue, montage,
billed length, contraction, thin-stroke warning, parts and generation time.
The card shows it above the file; the payment summary shows the customer's
version. The upload keeps the original name so a renamed CDR/PDF is told.
The proof answer is the parent's check: every ready full print file Prumo
generated becomes an active final, and the parent enters Arte conferida.
Items that still need hand preparation stay in Arte recebida.
The existing launch_reset now also empties the Kanban flow folders, keeps
Estampas/, and no longer restarts orders.number: DTF-1…DTF-15 already exist
in Tiny. It still refuses real money, counts first and needs APAGAR.
The browser records page load, upload speed and bytes, Prumo's check and
the loose-art montage; the quote keeps them and Números shows average and
p95 per period. Print generation and the payment-to-card time come from
the database. The upload bar already estimates its remaining time.
The browser records where the thinnest stroke sits in the assembled film;
the proof takes a 15 cm window around it instead of always the top. A free
proof no longer fails the layout's billed-metres check, and answering the
proof card clears "Aguardando contato" and ends its timer.
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).
Residue and thin strokes can be accepted on ready sheets and loose art,
with the consent and its time kept on the order. The resolution rule is
96/200 DPI, and a final file must be a transparent 300 DPI PNG. The art
score leaves the customer's cart and buy box (Dropstar, 2026-11-05).
The cleanup purges 50 expired files a pass, oldest first, and the suites
before the retention test now leave more than that: the test runs it until
its own fixture is reached. A print job for an item without a layout (an
order written straight to the database) is hand preparation, not a crash on
the footer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The card's "Abrir e conferir" opens the order's print file full screen
(Dropstar's third round, item 7): zoom up to 100% real (one file pixel, one
screen pixel), the position in cm, the order's files one after the other
without closing, and the background behind the transparency light, dark or
checkered, remembered (Dropstar, 2026-10-30). Closed in Arte recebida, it asks
"Está OK?": the class of each item, prefilled with the measure, then
"Mover para Arte conferida" (the final approved, the class kept, the card
moved) or "Tratar a arte".
A 15 m film is loaded like a map: while the PNG is written, its strips of
512 rows go to storage at 100% and at each halving (app/printtiles.py,
originals/tiles/<upload>/), and the viewer (web/kanban-viewer.js) fetches
only those on screen. They go when their file expires. Storing a print file
that fails is now an attempt like a failed render, not a claim held for an
hour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pulled to Imprimindo, an order's files go as a copy into
3. Imprimindo/<máquina>/<C1|C2|C3>/, the class of each item (chosen in the
Kanban, or measured by the Site), where FlexiPRINT takes them (Dropstar's
third round, item 10). A film in parts goes to the same machine, in order,
never more than two parts in its folder: the next is written when Flexi
takes one. The card says "Parte 3/7 imprimindo · 4/7 ripando".
The server decides what each folder gets (app/hotfolder.py,
dtf_local.hot_parts) and the Kanban's computers write it: each part is
claimed by one computer, so Flexi never gets it twice; a claim that did not
finish goes back to the queue; a part gone from its folder was taken and is
never written again; a card that leaves Imprimindo or is cancelled has what
Flexi did not take deleted. A part without a class waits for one, and the
class may still change in Imprimindo until its file is written.
The folder sync also follows files one by one, so the parts of a film over
15 m are no longer taken for replaced copies of each other.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FlexiPRINT's Spot OK 1 makes the white from transparency and reads it
reliably only from a PNG (Dropstar's third round, item 13): each order item
is now DTF-N-item-I.png, 300 DPI, RGBA on a transparent background, with its
footer; a film over 15 m leaves as DTF-N-item-I-pK.png parts, each with
"Parte K/N" in its footer, cut between pieces of loose art when it can be.
app/printpng.py never holds a whole sheet: the film is composed and written
in bands. Pillow encodes each band (it picks the PNG filters) and one zlib
stream takes them; a long PNG sheet is read band by band by wrapping its
compressed rows as small PNGs; a PDF page is drawn band by band at 300 DPI by
PDFium (pypdfium2, a self-contained wheel); loose art is turned and scaled
once. A 57 x 220 cm sheet peaks at 191 MB, a 15 m film at 279 MB.
The parts of an item are dtf_local.print_parts (print_files.upload_id stays
the first); the board, the final approval, the folders and the cleanup see
every part, and the Kanban approves and downloads them all. A large PNG or
PDF is now generated like any other; only other large formats go to hand
preparation, and the original no longer stands in as the print file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- "The designer approves every file" (Dropstar's rule D-16): the Operador
leaves "produce", so it no longer approves final files, picks the
contraction, treats the art or marks the contact wait. It pulls and
prints. The order panel says the Designer approves and shows the
contraction read-only; the profiles table follows.
- The stroke measure drops ink components under 30 px (at 300 DPI) before
the distance, as Dropstar's method says (2026-10-30). Each strip keeps
at least 30 rows of context, so a speck is always seen whole and a
component cut by the strip is a stroke. One real order sheet went from
C1 (2 px, specks) to C2 (5 px); Dropstar's four test sheets still give
2, 5, 20 and 4 px. The artwork browser test checks widths 2, 5 and 6,
and a C3 sheet with 300 specks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 3, items 9, 4, 16 and 17 (Dropstar, 2026-10-30).
- 9: the Site measures the thinnest stroke of each sheet and loose artwork
(alpha > 40, chamfer distance in strips, width at local maxima, 1st
percentile, at 300 DPI) and sends stroke_px and C1/C2/C3 with the item.
The Kanban shows the class prefilled in the approve step; Produção may
change it (POST /orders/{id}/contraction, who and when recorded), and the
manifest carries it.
- 4: the residue check runs on each loose artwork, accepted per artwork; the
sheet inherits what was accepted.
- 16: fine lines and solid areas in one file. Loose art: a pop-up with
[Subir separado] [Continuar assim]. Ready sheet: protect the fine lines
(default), protect the solid areas (stroke_choice client_c3, starts at C3)
or go back and send two sheets, which holds the order.
- 17: loose art of fine (C1, C2) and solid (C3) strokes goes on separate
sheets, each its own order item (split group/part/of) with its own file
and class. Each sheet rounds to 10 cm and the 1 m minimum is charged once
per group, since the customer did not choose the split. Cart, payment
summary, portal, receipt and mail show it as such.
- The board loads quote views in two queries instead of two per quote.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Imprimindo: every active machine has its lane, and a card dragged
from the queue onto a lane goes to that machine (if it prints the
product and has a place), instead of the one it came with. The
operator's pull still goes to the machine they are on (item 12).
- Pagamentos: each payment shows who tried to pay and what they were
buying (the quote's customer and items, and its order if there is
one); a click opens the customer's name, e-mail, CPF/CNPJ, WhatsApp
and delivery, the quote, and Mercado Pago's id and status.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Board: product switch and a filters panel with counts, cards that say
the next step and the most urgent mark, Imprimindo in one lane per
machine with its free places, Finalizado as short cards.
- Order panel: the stage and codes on top, "Próximo passo" with its
button, Pedido / Arquivos / Histórico tabs; going back, contact,
rework and cancelling in a menu; every form in a dialog.
- Cotações, Pagamentos, Integrações, Números (a calendar for the
period) and Usuários (who is on the system now, what each profile
does, the machines) in the design's panels; the sign-in page.
- Phone: sections at the bottom, one stage at a time, the order and
the dialogs over the whole screen.
- API: each session records when it was last used (at most once a
minute), for "Ativo agora"; the board says who is on each machine.
- .dockerignore leaves the local test files out of the build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After signing in, the Kanban asks "Em qual máquina você está?": required
for the operator, optional for Gestão and Administrador ("Não estou em
máquina"), never for the other profiles. The session keeps it until it
ends or is changed from the header, where the machine shows in green;
one person on two computers runs two machines. Someone else already on
the machine is a warning, not a refusal.
Operators see the whole board (no more per-machine filter). From Arte
conferida they pull any card, which becomes their machine's (a machine
that does not print its product refuses it); they move only their
machine's cards, and the others show without drag or buttons. Their
cards and their machine's row in Imprimindo are outlined in green. The
history records the machine with the person: "Imprimindo · Thales ·
máquina2". Usuários shows who is on each machine now, read-only; the old
operator/machine assignment is no longer read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>