Skip to content

feat: Phase 2 — SKU drill-down (stock by location, open holds, movement trail) - #3

Merged
DanMat merged 1 commit into
mainfrom
feat/phase2-sku-drilldown
Aug 30, 2026
Merged

DanMat merged 1 commit into
mainfrom
feat/phase2-sku-drilldown

Conversation

@DanMat

@DanMat DanMat commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Phase 2a "Answers" (from Fable's Stocked & Shipped). Read-only.

What

A per-SKU drill-down at GET /admin/inventory?sku=X — a branch of the existing gated page (no new route; holdsPageGate/ADR 0020 still applies). It answers what the flat list can't:

  • Stock by location (on-hand / reserved / available)
  • Open holds — each reservation with its ref and age, so "why is 6 reserved?" has an answer
  • Full movement trail (qty, reason, ref, actor, when)

Stock-row and recent-movement SKU cells now link to it.

Safety

Read-only; all queries bound to this plugin's own tables; the sku is escaped everywhere it's echoed. No writes, no schema change. (Reviewed pre-build by both skills; security-green — new surface is only the ?sku= param, bound + escaped.)

Tests

Drill-down renders stock/holds/trail; rows link to it; a hostile ?sku= ("><script>, ' OR '1'='1) is bound + escaped; unknown SKU shows a helpful note. 47 tests green; PHPStan + php-cs-fixer clean.

🤖 Generated with Claude Code

…nt trail)

A read-only per-SKU view at GET /admin/inventory?sku=X (a branch of the existing
gated page — no new route, holdsPageGate still applies). Answers the questions
the flat list can't: where is it stocked, *why* is N reserved (each open hold
with its ref + age), and the full movement trail. Stock-row and movement SKU
cells link to it.

All reads are bound queries on this plugin's own tables; the sku is escaped
everywhere it is echoed (heading, links). No writes, no schema change.

Tests: drill-down shows stock/holds/trail, rows link to it, a hostile ?sku= is
bound + escaped (SQLi/XSS regression), an unknown SKU shows a helpful note.
47 tests green; PHPStan + php-cs-fixer clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit 91d3f6a into main Aug 30, 2026
2 checks passed
@DanMat
DanMat deleted the feat/phase2-sku-drilldown branch August 30, 2026 19:26
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