Repository navigation
[ttp1-phoenix] Single batch screen with per-file cards (TTP task 1) - #25
Merged
Merged
Conversation
The home page `/` is now the current print batch (v2 contract, monorepo-incluir PR #1053): reference, status, item count, total copies and the Pronto → Impresso track, then one card per file grouped under its request (jobs first, then residual files), with residual general instructions in their own request block and the backend's previouslyCancelledIn warning. Batch actions by status (collect with checkbox + confirmation, whole-batch quote, mark printed) run over the socket with If-Match = the batch ETag and one Idempotency-Key per intent; a 412 re-reads the batch and asks for confirmation again; "Repetir" after a lost reply reuses the key. "Lotes anteriores" lists every batch with a read-only detail; "Notas fiscais" reads the v2 monthly closes. The old per-order list/detail screens are removed (the v1 JSON API is unchanged). PrintApi gains the v2 batch port (HTTP adapter, memory fake, FakeHono and the shared conformance suite), with strict v2 contract validation. The data-ttp smoke markers are rendered on the real components. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
By contract, GET /batches/open is null while a collected…printed batch is active (print-portal-v2.md; the fixture's visibilityTimeline), so the home page lost the batch right after "Retirei os arquivos". The memory fake now follows the contract (failing conformance case first), and getCurrentBatch falls back to the active batch from the history (every page of GET /batches), read with its ETag through GET /batches/:id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TTP task 1 (trial
ttp1-phoenix) for the Phoenix arm, against the frozen v2 batch contract (monorepo-incluir PR #1053 @ 2702246; fixture/schema/assets copied byte-exact intotest/fixtures/).What changed
/= current batch (GET /api/print-portal/v2/batches/open):LOT-xxxx, status, item count, total copies, track Pronto → Arquivos retirados → Orçamento enviado → Orçamento aprovado → Impresso; empty state Nenhum pedido aguardando.IMP-xxxx · title), jobs first then residual files: name, size, copies, instructions, Baixar arquivo (session-authenticated/api/print/v2/batches/:id/orders/:orderId/files/:fileId). Residual files say Não identificadas / Sem vínculo seguro — consulte instruções gerais; residualgeneralInstructionsrender in an Instruções gerais block inside their own request only.previouslyCancelledInshows Este item esteve no lote LOT-xxxx, cancelado — confira antes de imprimir.open→ checkbox Conferi todos os arquivos + Retirei os arquivos (412 → re-read + reconfirm, with Atualizar)files_collected/quote_rejected→ Enviar orçamento (file + total R$; rejection reason shown)quote_pending→ Aguardando aprovação do Financeiro;quote_approved→ Marcar como impresso;printed→ Aguardando recebimento/lotes,/lotes/:id): batch history (reference, status, dates, approved amount) + read-only detail with the same cards./orders,/orders/:id). The/api/print/v1JSON routes are unchanged.PrintApigains the v2 batch callbacks, implemented in the HTTP adapter (strict v2 contract validation), the memory fake and FakeHono, all covered by the shared conformance suite.data-ttpsmoke markers on the real components.No backend/contract change, no new dependency.
Tests
mix checkgreen locally (178 tests; lint, structure, typecheck, depcruise, coverage, examples, hooks).test/unit/contract_v2_test.exs,test/unit/batch_test.exs, v2 conformance cases (Memory + HTTP over real sockets),test/integration/portal_batch_live_test.exs(plain HTTP GET marker checks, byte-exact downloads, checkbox/confirm, stale 412, quote type/size/415 refusals, lost reply → Repetir reuses the key with no duplicate quote, printed, history, empty state), confidentiality now covers the batch page.infra/ttp/feature_smoke.py'sverify()over the rendered pages for every checkpoint (flow ×7, cancel/rebatched, empty): all pass.Note: the default v1 staging smoke fetches the HTML
/orders, which this task retires on purpose. The trial needs thetask1-v2selector.🤖 Generated with Claude Code