Repository navigation
[ttp1-rust] Single current-batch screen with per-file cards (print-portal v2) - #24
Merged
Merged
Conversation
Replace the per-order list/detail screens with one home screen showing the supplier's current print batch (open or active), against the frozen monorepo-incluir print-portal v2 contract (27022467): - domain: v2 DTOs (Batch, BatchItem with previouslyCancelledIn, BatchQuote, BatchList, OpenBatchResponse, kind-discriminated monthly-close items), strict serde + schema/semantic checks (itemCount, unique orders/files) - port/adapter/fake: /api/print-portal/v2 batch routes (open, list, detail, member file, collected, quotes, quote file, printed), ETag/If-Match, Idempotency-Key replay/conflict, EMPTY_BATCH; memory fake hooks for Financeiro decision, receipt and cancellation - use cases: getCurrentBatch (open, else the active collected…printed batch from history) plus one span per batch operation - web: `/` = current batch header, progress bar, per-file cards grouped by request, residual "Instruções gerais" per request, cancelled-batch warning, state-driven actions with confirmation (collect needs the checkbox; quote upload; mark printed; waiting messages), empty state; "Lotes anteriores" history + read-only detail; invoices on v2 closes; old /orders screens and /api/print/v1 BFF routes removed; data-ttp smoke markers - tests: conformance suite on the frozen fixture + real PDF assets for the memory fake and the HTTP adapter; web tests run the shared staging smoke (infra/ttp/staging.py) for every frozen checkpoint, the full journey, stale-ETag recovery, 503 retry with the same Idempotency-Key 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-rust): replace "list of orders → open one order" with one home screen showing the supplier's current print batch, against the frozen monorepo-incluirprint-portal-v2contract (@ 27022467). No backend/contract change, no new dependency.What changed
portal-domain/src/batch.rs): v2 DTOs:Batch,BatchItem(incl.previouslyCancelledIn),BatchQuote,BatchList,OpenBatchResponse, and kind-discriminated close items (batch/legacy_order). Strict serde (unknown keys rejected) plus schema/semantic checks (itemCount = items, unique orderId, each file exactly once per item, at least one file,LOT-/IMP-references)./api/print-portal/v2(batches,batches/open,batches/:id, member file,collected{},quotesmultipart file+amountCents, quote file,printed{quoteId}, monthly closes). Same security as before: fixed origin, no redirects, strict parsing, bearer server-side, size caps. The fake keeps ETag CAS, Idempotency-Key replay/conflict, 428/412/409/EMPTY_BATCH, and has hooks for Financeiro decision, receipt and cancellation.getCurrentBatchreturns the open batch, or else the active collected…printed batch found in history (the upstream hides open meanwhile). One span per operation; no content in spans or logs./shows the current batch:LOT-xxxx, status, item and file counts, total copies, and the progress barPronto → Arquivos retirados → Orçamento enviado → Orçamento aprovado → Impresso.IMP-xxxx · título, one card per file (name, size, copies, instructions, Baixar arquivo). Residual files show "Não identificadas / Sem vínculo seguro"; residual Instruções gerais get their own block inside their own request./ordersscreens and the/api/print/v1BFF routes are removed. Thedata-ttpsmoke markers sit on the real components.PrintApiconformance suite on the vendored frozen fixture and its real PDF assets, run against the memory fake and the HTTP adapter (via a fake Hono over a socket).infra/ttp/staging.py) against the BFF over real sockets for every frozen checkpoint: open, collected, quote-pending, quote-rejected, quote-approved, printed, next-batch, rebatched, plus empty (no history / only received / only cancelled).examples/src/bin/portal_e2e.rslive-stack run and the README are updated to v2.Gate
cargo xtask check→CHECK PASSED(fmt, architecture, clippy -D warnings, codegen drift on live PG16, full instrumented test suite + coverage, examples, hooks), locally and in pre-push.🤖 Generated with Claude Code