Skip to content

inventory: per-invoice items, returns, usage, pictures, monthly sweep - #484

Merged
alexeygrigorev merged 3 commits into
mainfrom
inv-invoice-items
Nov 18, 2026
Merged

alexeygrigorev merged 3 commits into
mainfrom
inv-invoice-items

Conversation

@alexeygrigorev

Copy link
Copy Markdown
Member

What

  • Items per invoice: new POST /api/bookkeeping/inventory/items records an item for a picked ledger transaction; one invoice can yield several items that share it as their source record. The tab's Add button opens a picker over the ledger's expenses (searchable), keeps the form open for repeated adds.
  • Returns: exit records gain the returned kind (date + note, no proceeds). Status derives from the latest record: on balance / returned / disposed, with returnedDate alongside disposedDate.
  • Usage: every item tracks active vs idle (usage field, inline select).
  • Pictures: addImage/removeImageUrl edits attach picture URLs (photo or shop product image) with thumbnails in the row.
  • Removal is hard on purpose: the per-row ✕ and 'Scan ledger' are gone. Removal via API/CLI tombstones the item's seed so the sweep and ledger writes never re-derive it; manual splits dismiss the invoice-level seed.
  • Monthly report: generating the accountant archive now runs sweepInventory first (count in the response); CLI bookkeeping inventory-import becomes inventory-sync over POST /inventory/sweep. The import endpoint is deleted.

Verification

  • backend: bookkeeping-inventory (16) + api-bookkeeping (23, incl. archive route with the sweep hook) green; typecheck green
  • frontend: bookkeeping-inventory (21), bookkeeping-inventory-nav, finance-surface, contracts (architecture/coverage/convergence, parity) green

… sweep catch-up

- POST /inventory/items records an item for a picked ledger transaction;
  one invoice can yield several items that share it as their source
- exit records gain the 'returned' kind; the latest record wins the status
  (in-use / returned / disposed) with returnedDate alongside disposedDate
- items track usage (active / idle) and keep up to 8 picture URLs
- DELETE tombstones the item's seed (dismissed seeds), so removed items and
  hand-split invoices are never re-derived by the sweep or ledger writes
- sweepInventory replaces the import endpoint: POST /inventory/sweep and the
  monthly report archive generation catch the inventory up automatically
- CLI: bookkeeping inventory-import becomes inventory-sync
…tures

- Add opens a picker over the ledger's expenses: pick an invoice, describe
  the item, add it; the form stays open so one payment that bought two
  things records both, sharing the invoice as their source
- exit records gain Return alongside Dispose; the status badge shows
  on balance / returned / disposed with the exit date
- rows track active vs idle use; 'in use' total becomes 'on balance'
- pictures attach by link (photo or shop product image) with thumbnails
- the per-row remove button and 'Scan ledger' are gone: removal is
  API/CLI-only, and catch-up runs on the monthly report
- wording says invoice, not ledger
@alexeygrigorev
alexeygrigorev merged commit 3e1ab23 into main Nov 18, 2026
4 checks passed
@alexeygrigorev
alexeygrigorev deleted the inv-invoice-items branch November 18, 2026 16:07
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