Repository navigation
Close the last QA gaps: BR-019, «bajo pedido» and order risk - #84
Merged
Merged
Conversation
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>
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.
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.managemay call answers withone:
inventory/stock/inventory.viewproduct_slug(itsidis theBranchStockrow)inventory/adjustments/,transfers/<id>/items/inventory.*product_slugparts/candidates/service.repair.manageproduct_id, but only for lines already bound — circularsales/pos/products/search/sales.pos.useproduct_id, at the price of the till's authorityBR-019 asks for the smallest symmetric fix — accept
product_slugon the quoteline, resolved within the tenant — and names two alternatives. Verified against
origin/masterfb7fcee. Mobile'spostServiceQuoteItemalready sendsproduct_idwhen it has one, so the remaining work here is a search screen theday the identifier is obtainable.
Fixtures that became real coverage
Both were built with the backend's own domain helpers, in the scratch database:
stock_or_orderwith no stock in thebranch, a supplier and a valid offer (
supply_services.create_supplier/create_offer).31-pos-on-ordersells 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.assess, the same function checkout calls, runon the fixture's online order.
32-order-riskreads 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
active_internal_usersexcludes superusers deliberately26asserts the app meets it honestly31asserts its sentence reaches the cashier27now takes it best-effortVerification
No app code changed, so the gate is
git diff --checkplus the affected flows:27,31and32pass on the simulator, and31is confirmed server-side —the supplier offer's
committed_quantityrose with each sale.🤖 Generated with Claude Code