Nobody has started this yet — be first.
Business impact
The API can fetch one SKU at a time by id (GET /v1/skus/{id}), but there is no way to discover what SKUs exist at all short of querying Postgres directly. An admin dashboard or a support engineer investigating "what's even in the catalog right now?" has nothing to call.
Problem
The route is already wired up (r.Get("/skus", s.ListSKUs)) and Server.ListSKUs exists only as a panicking TODO(ticket-14) stub.
Current behavior
GET /v1/skus currently returns a 500 because Server.ListSKUs panics with "TODO(ticket-14): Server.ListSKUs not implemented".
Expected behavior
GET /v1/skus returns a JSON array of every known SKU's current snapshot, in the same shape GET /v1/skus/{id} already returns for one.
Steps to reproduce
go test ./tickets/tests/... -run TestTicket14 -vWhy this matters
The route is already wired up (r.Get("/skus", s.ListSKUs) in internal/handler/server.go) and Server.ListSKUs exists as a stub -- this is purely about writing the query (SELECT ... FROM sku_inventory, no WHERE) and reusing the existing toSKUResponse conversion for each row, the same way GetSKU already does for one.
Suggested approach
Look at GetSKU right above ListSKUs in internal/handler/sku_handler.go for the query/scan pattern, and ListLedger further down for the "loop over rows.Next(), build a slice" pattern for returning more than one row.
Acceptance criteria
Verification
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket14 -v
Hints (0/2)
Try it without hints first — the reading is the exercise.
Working on this ticket
Work on a branch named for the ticket — that's what you'll submit.
Branch off your fork
Sign in to create it automatically, or do it yourself:
$git checkout -b feat/list-skus-endpointFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin feat/list-skus-endpointSubmit it below
Paste your fork URL and the branch name, with a short write-up of the root cause.
Questions
Ask about anything unclear in the ticket — the maintainer and anyone who has solved it can answer. Please don't post full solutions.
Sign in to ask a question or reply.
Sign inSKIP LOCKEDhttp://localhost:8081localhost:5434flash-saleeveryday-widgetcurl localhost:8081/healthzgo run ./cmd/loadtest -url http://localhost:8081 -sku flash-sale -concurrency 10000Work the tickets in tickets/docs/ (ordered easy → hard); each names one dedicated Go test in tickets/tests/:
export TEST_DATABASE_URL=postgresql://inventory:inventory@localhost:5432/inventory_test?sslmode=disable
go test ./tickets/tests/... -run TestTicket24 -v # a single ticket
./tickets/run_tickets.sh # all 25, clean pass/fail summary
Tickets that don't touch Postgres (02, 07, 17, 19) run fine without TEST_DATABASE_URL; the rest t.Skip cleanly, not fail, if it's unset.
Level 2
Implement a feature
Extend the system within its own patterns.