Skip to content

Close the last QA gaps: BR-019, «bajo pedido» and order risk - #84

Merged
PapiCuche merged 1 commit into
mainfrom
chore/qa-gap-closure
Oct 22, 2026
Merged

PapiCuche merged 1 commit into
mainfrom
chore/qa-gap-closure

Conversation

@PapiCuche

Copy link
Copy Markdown
Owner

The remaining Mobile gap is traced to its real cause and filed; two of the
fixture limitations turned out to be real coverage once authentic domain state
existed, and the rest are classified with the rule that produces them.

The gap: part consumption — BACKEND_BLOCKED (BR-019)

POST service/orders/<id>/parts/ takes { quote_item_id, quantity, idempotency_key } — not a product — and Mobile already sends exactly that.
The blocker is one door earlier: a candidate is an approved quote line of type
PART with a product bound to it, and binding one needs a numeric product_id.

Nothing a technician holding service.diagnostic.manage may call answers with
one:

Surface Capability Product identity
inventory/stock/ inventory.view product_slug (its id is the BranchStock row)
inventory/adjustments/, transfers/<id>/items/ inventory.* write by product_slug
parts/candidates/ service.repair.manage product_id, but only for lines already bound — circular
sales/pos/products/search/ sales.pos.use product_id, at the price of the till's authority
public catalogue — only what the storefront publishes; a workshop part need not be

BR-019 asks for the smallest symmetric fix — accept product_slug on the quote
line, resolved within the tenant — and names two alternatives. Verified against
origin/master fb7fcee. Mobile's postServiceQuoteItem already sends
product_id when it has one, so the remaining work here is a search screen the
day the identifier is obtainable.

Fixtures that became real coverage

Both were built with the backend's own domain helpers, in the scratch database:

  • «bajo pedido» — a product sold stock_or_order with no stock in the
    branch, a supplier and a valid offer (supply_services.create_supplier /
    create_offer). 31-pos-on-order sells it: the shelf shows «Bajo pedido»
    instead of «Agregar», the lead time and the offer's price are the server's,
    and the sale commits a unit of the offer. It also asserts the app prints the
    server's reason for a receipt it cannot issue instead of hiding the option.
  • order risk — order_risk.assess, the same function checkout calls, run
    on the fixture's online order. 32-order-risk reads what it actually found
    («Bajo», «Es la primera compra pagada de este cliente») and takes the
    decision branch only when the server offers one.

Everything still uncovered, classified

Limitation Class Why
Part consumption BACKEND_BLOCKED BR-019
Notice marked read FIXTURE_LIMITATION active_internal_users excludes superusers deliberately
Address book, customer's repairs FIXTURE_LIMITATION the customer surface 404s for somebody who never bought here — 26 asserts the app meets it honestly
Identifying a device on an order FIXTURE_LIMITATION no serialized product and no stock unit exists; building all three would invent what the test should find
Deciding on a risky order FIXTURE_LIMITATION the real assessment says «No requiere revisión»; flagging one means inventing risk
Fiscal receipt EXTERNAL_INFRA_BLOCKED electronic issuance is off on this server; 31 asserts its sentence reaches the cashier
Reversing a payment SYSTEM_UI_LIMITATION the OS alert's button shares its word with the row's, and the alert closes between commands; 27 now takes it best-effort

Verification

No app code changed, so the gate is git diff --check plus the affected flows:
27, 31 and 32 pass on the simulator, and 31 is confirmed server-side —
the supplier offer's committed_quantity rose with each sale.

🤖 Generated with Claude Code

Part consumption is the last real gap in the app, and the blocker is one
door earlier than it looks. `POST parts/` takes a `quote_item_id`, which
Mobile already sends; what it cannot do is create the line that becomes a
candidate, because binding a product to a quote line needs a numeric
`product_id` and nothing a technician is allowed to call answers with
one:

- `inventory/stock/` speaks `product_slug`, and its `id` is the
  `BranchStock` row;
- every inventory WRITE also takes `product_slug`;
- `parts/candidates/` reports `product_id` only for lines already bound;
- `sales/pos/products/search/` has it, but asking a technician for
  `sales.pos.use` to fill in a quote widens authority to fill a form.

BR-019 asks for the smallest symmetric fix — accept `product_slug` on
the quote line — and names two alternatives the backend may prefer.
Verified against origin/master fb7fcee.

Also adds two flows and the fixtures that make them real, built with the
backend's own domain helpers in the scratch database:

- 31 pos-on-order — a product sold `stock_or_order` with no stock and a
  valid supplier offer (`supply_services.create_supplier` /
  `create_offer`). The sale commits a unit of the offer, and the flow
  asserts the app prints the server's reason for a receipt it cannot
  issue rather than hiding the option.
- 32 order-risk — `order_risk.assess`, the function checkout itself
  calls, run on the fixture's online order. It answers «No requiere
  revisión» with the signals it really found, so the decision branch is
  conditional: flagging an order would mean inventing risk.

The README now classifies every remaining limitation, each with the rule
that produces it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@PapiCuche
PapiCuche merged commit dbf1c95 into main Oct 22, 2026
3 checks passed
@PapiCuche
PapiCuche deleted the chore/qa-gap-closure branch October 22, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant