Nobody has started this yet — be first.
Business impact
Any dashboard, audit tool, or support script that paginates the append-only ledger using the documented maximum page size of 500 gets a 400 Bad Request instead of a page of results -- for the exact value the API's own error message claims is valid. It is a small thing, but it is the kind of small thing that erodes trust in an API's documentation: if the boundary value in the error message is wrong, what else is?
Problem
GET /v1/skus/{id}/ledger?limit=500 returns 400 Bad Request with body {"error":"limit must be between 1 and 500"}.
Current behavior
ListLedger's validation checks n <= 0 || n >= 500, rejecting the one value (500) its own error message documents as the valid maximum.
Expected behavior
A limit of exactly 500 should be accepted and return up to 500 ledger entries, matching what the error message itself documents as the valid range.
Steps to reproduce
go test ./tickets/tests/... -run TestTicket03 -vWhy this matters
ListLedger's query-param validation checks a boundary condition on a value that's about to be used as a LIMIT in a SQL query. A stray = on the wrong side of that check rejects the one value it's supposed to allow.
Suggested approach
Look at the boundary check on the parsed limit value in ListLedger and compare it to the error message string sitting right next to it.
Acceptance criteria
Verification
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket03 -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 fix/ledger-limit-boundaryFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin fix/ledger-limit-boundarySubmit 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 1
Fix a bug
Read existing behaviour, correct it.