feat: Phase 2 — SKU drill-down (stock by location, open holds, movement trail) - #3
Merged
Merged
Conversation
…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>
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.
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-row and recent-movement SKU cells now link to it.
Safety
Read-only; all queries bound to this plugin's own tables; the
skuis 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