Nobody has started this yet — be first.
Business impact
This is a "someone renamed a field on one side and missed a call site" bug -- a classic real production incident shape, especially across a producer/consumer boundary like this one (a JSON payload written by one component, read by another). The visible symptom is severe and confusing: every payment, no matter what simulator_profile was requested at creation, silently gets approved by the demo bank simulator. The "silent" auto-expiry demo and the "decline" demo both stop working project-wide -- not because those features are broken, but because the profile that selects them never reaches the simulator at all.
Problem
A payment created with simulator_profile: "silent" (or "decline") gets authorized anyway, as if it had been created with "approve" (the default).
Current behavior
Every payment ends up authorized regardless of the requested simulator_profile.
Expected behavior
The requested simulator_profile should reach the bank simulator's Initiate call unchanged, and drive the outcome its switch statement (in internal/bank/simulator.go) actually implements for that profile.
Steps to reproduce
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket09 -v
Why this matters
Service.Create inserts an outbox row of kind upi_initiate with a JSON payload map. internal/outbox/dispatcher.go's callBank later reads that payload back (payload["simulator_profile"]) to build the HTTP request it sends to the bank simulator. The two sides need to agree on the exact key string -- right now they don't.
Suggested approach
Look at the map literal Service.Create passes to s.store.InsertOutbox(...) for the upi_initiate kind, and compare every key against what internal/outbox/dispatcher.go's callBank actually reads out of payload[...]. One of them has a typo.
Acceptance criteria
Verification
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket09 -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/simulator-profile-payload-typoFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin fix/simulator-profile-payload-typoSubmit 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 indocker composepaystate/paystate/go.modreplace reliable => ../reliabledocker compose up --buildpaystate/context: ..docker-compose.ymlCREATED_TIMEOUTAUTHORIZED_TIMEOUTWork the tickets in tickets/docs/ (ticket-01 through ticket-25); each names one Go test in tickets/tests/:
TEST_DATABASE_URL=postgresql://... go test ./tickets/tests/... -run TestTicket01 -v # a single ticket
TEST_DATABASE_URL=postgresql://... ./tickets/run_tickets.sh # all 25, clean pass/fail summary
Tickets that don't touch Postgres (02, 03, 04, 05, 06, 14, 15, 24) run fine without TEST_DATABASE_URL set; the rest report FAIL with a "TEST_DATABASE_URL not set" message if it's missing. make test-race runs the full go test -race -p 1 ./... suite the same way.
Level 1
Fix a bug
Read existing behaviour, correct it.