Skip to content

Inventory: ledger provenance, disposal records, auto-derivation - #384

Merged
alexeygrigorev merged 3 commits into
mainfrom
codex/inventory-provenance-disposal
Nov 7, 2026
Merged

alexeygrigorev merged 3 commits into
mainfrom
codex/inventory-provenance-disposal

Conversation

@alexeygrigorev

Copy link
Copy Markdown
Member

Follow-ups to the inventory tab:

  • Disposal records: selling or decommissioning writes a record (kind, date, sale proceeds, note) instead of a bare status flip. status/disposedDate are derived from the records; removing the last record puts the item back in use. Direct status/disposedDate edits are rejected.
  • Ledger provenance: every inventory GET/PUT response carries source — the current ledger record (description, counterparty, date, amounts) the item was derived from, per-allocation rows included. The tab renders a ledger link per row that opens the transaction.
  • Auto-derivation: creating or editing a ledger transaction now syncs the inventory for that transaction (idempotent by seed, manual edits untouched), so physical purchases land in the inventory at write time — including allocation rows added later by reconciliation or suggestions.

Targeted local suites: bookkeeping-inventory 12/12, api-bookkeeping 21/21, bookkeeping-suggestions 8/8, production-frontend 3/3, frontend inventory 11/11, cli bookkeeping 31/31.

…items

Selling or decommissioning an item now writes a disposal record (kind,
date, sale proceeds, notes) instead of a bare status flip: status and
disposedDate are derived from the records, so removing the last record
puts the item back in use. GET/PUT responses carry the current ledger
record (description, counterparty, date, amounts) each item was derived
from, allocation-backed items describe themselves from their row.
Creating or editing a ledger transaction now syncs the inventory for
that transaction in place of the manual scan: a physical purchase lands
as an item at write time, including per-allocation rows added later by
reconciliation or suggestions. Idempotent by seed, so existing items
and manual edits are never overwritten.
Each item carries a ledger link that opens the transaction it came
from. The status select becomes a derived badge: disposing happens in a
small in-row form (sold with proceeds, or decommissioned, with date and
note), and each disposal record is listed under the row where it can be
removed again - removing the last one puts the item back in use.
@alexeygrigorev
alexeygrigorev merged commit 5f84a7b into main Nov 7, 2026
3 checks passed
@alexeygrigorev
alexeygrigorev deleted the codex/inventory-provenance-disposal branch November 7, 2026 14:18
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