Skip to content

v0.1.23 — Fase 5-full COMPLETE + post_sale fix

Latest

Choose a tag to compare

@pabloalvarez99 pabloalvarez99 released this 18 May 11:17
ab0a85f

Fase 5-full COMPLETE (BACKLOG #8)

Three pooled slices merged on this branch since v0.1.22:

  • PO receipt + WAC (PR #38, slice 2) — POST /api/v1/purchase-orders/{id}/receive atomically increments product.stock, recomputes product.cost_price via weighted-average cost, emits stock_movement(reason='purchase_receipt', ref=<po_id>), flips PO draft → received. Mirrors sales::apply_sale's BEGIN/COMMIT atomicity.
  • Accounts payable (PR #40, slice 3) — purchase_payment ledger (migration 0016). Closes Fase 5-full.
  • Latent bug fix in sales::post_sale (PR #43) — stock pre-check now indexes loaded products by id instead of zipping positionally against IN $ids results. Caused spurious InsufficientStock under load when stocks differed across the cart; no production data was at risk (the atomic tx's product_batch.stock ASSERT >= 0 would have aborted any oversell). Surfaced by the v0.1.22 stock-rotation test on serialized runs.

Additive. No schema breaking changes.

MSI

pharma-server-0.1.23-x86_64.msi — 12,304,384 bytes
sha256: 4a2c61c395d8f848bf3d5e6bda8f12cf2ea0f59f47c9bdf06233c567cc4d4a24

Smoke-verified: MajorUpgrade over v0.1.22, service Running, / {"version":"0.1.23"}, /health/ready 200 db:ok.

🤖 Generated with Claude Code