feat(api): shop price lookup - visit-day prices in the payment currency (#17, part 2) #83
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!83
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pricing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #17 (part 2 of 2; part 1 was #82).
What
The shop price lookup that replaces the legacy
ProductSearchService, following ADR 0004.GET /v1/parks/{id}/products?date=YYYY-MM-DD¤cy=KES[&category_id=][&product_id=](public, cacheable 60 s):internal/money), rounded once to cents;available: false, reason: "not available in KES", never a wrong, duplicated or missing line;converted_from: native amount, rate, rate id) so the order can store the rate later.Legacy defects this fixes (each has a test)
FirstOrDefaultdoubleand culture-dependentToString("F")money.Amount, rounded once, half away from zeroStandards review (docs/development-standards.md)
Resolveis pure;Servicedepends on three narrow reader interfaces (offers, rates, currencies) defined in the consumer; the PostgreSQL implementation is read-only and swappable; the handler depends on a one-methodQuoter.pricingdoes not importcatalogorlookups.make lint0 issues. Security scans run onmainafter merge (the CI job is authoritative, not a local run).Known limits
🤖 Generated with Claude Code
internal/pricing: Resolve (pure: native price, else one conversion at the exact currency pair's rate, else 'not available in <currency>'), Service over three narrow readers, a public cacheable endpoint GET /v1/parks/{id}/products, and read-only PostgreSQL readers. Money uses internal/money, so conversion is exact and rounded once. Fixes the legacy defects recorded in ADR 0004: wrong-rate conversion, duplicate rows, nulls for missing prices, arrival-or-departure window test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>