docs(33): add summaries for plans 01 and 02 (wave 1 complete)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
38
.planning/phases/33-currency-system/33-01-SUMMARY.md
Normal file
38
.planning/phases/33-currency-system/33-01-SUMMARY.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Plan 33-01 Summary
|
||||
|
||||
**Status:** Complete
|
||||
**Completed:** 2026-04-13
|
||||
|
||||
## What Was Built
|
||||
|
||||
Database schema foundation for market-aware pricing and a currency conversion service.
|
||||
|
||||
### Key Changes
|
||||
- Added `market_prices` table (globalItemId, market, currency, priceCents, source) with unique constraint
|
||||
- Added `community_prices` table (globalItemId, userId, market, currency, priceCents, priceDate, sourceType) with unique constraint
|
||||
- Added `priceCurrency` column to items table (default 'EUR')
|
||||
- Added `foundPriceCents`, `foundPriceCurrency`, `foundPriceDate` columns to thread_candidates
|
||||
- Created currency.service.ts with frankfurter.app rate fetching, 24h caching, and conversion math
|
||||
- Added Zod schemas for market price and community price validation
|
||||
- Exported new types (MarketPrice, CommunityPrice, UpsertMarketPrice, SubmitCommunityPrice)
|
||||
|
||||
### Key Files Created/Modified
|
||||
- `src/db/schema.ts` — New tables + columns
|
||||
- `src/shared/schemas.ts` — New validation schemas
|
||||
- `src/shared/types.ts` — New type exports
|
||||
- `src/server/services/currency.service.ts` — Exchange rate service
|
||||
- `tests/services/currency.service.test.ts` — 12 unit tests
|
||||
|
||||
## Self-Check: PASSED
|
||||
|
||||
- [x] market_prices table defined with correct columns and constraint
|
||||
- [x] community_prices table defined with correct columns and constraint
|
||||
- [x] items.priceCurrency column added
|
||||
- [x] threadCandidates foundPrice fields added
|
||||
- [x] Currency service fetches, caches, converts
|
||||
- [x] All 12 tests pass
|
||||
|
||||
## Decisions Made
|
||||
- Used separate tables for market prices and community prices (not JSONB)
|
||||
- EUR as default price currency matching existing data assumption
|
||||
- Module-level caching for exchange rates (simple, effective for single-process)
|
||||
Reference in New Issue
Block a user