From d0bbf48bb5da4ee80e18f74714aebee07e31a782 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Mon, 13 Apr 2026 18:07:16 +0200 Subject: [PATCH] docs(33): add summaries for plans 03 and 04 (wave 2 complete) Co-Authored-By: Claude Opus 4.6 (1M context) --- .../33-currency-system/33-03-SUMMARY.md | 30 +++++++++++++++++++ .../33-currency-system/33-04-SUMMARY.md | 26 ++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .planning/phases/33-currency-system/33-03-SUMMARY.md create mode 100644 .planning/phases/33-currency-system/33-04-SUMMARY.md diff --git a/.planning/phases/33-currency-system/33-03-SUMMARY.md b/.planning/phases/33-currency-system/33-03-SUMMARY.md new file mode 100644 index 0000000..2a1799f --- /dev/null +++ b/.planning/phases/33-currency-system/33-03-SUMMARY.md @@ -0,0 +1,30 @@ +# Plan 33-03 Summary + +**Status:** Complete +**Completed:** 2026-04-13 + +## What Was Built + +Market prices API, exchange rates endpoint, and currency context in item/candidate responses. + +### Key Changes +- Created market-price.service.ts with getMarketPrices, getMarketPricesForMarket, upsertMarketPrice +- Created exchange-rates route (GET /api/exchange-rates) — public endpoint returning ECB rates +- Created market-prices route (GET/POST /api/market-prices/global-items/:id/prices) +- Registered routes in server index with public GET access +- Added priceCurrency to item service getAllItems, getItemById, createItem +- Added foundPriceCents/Currency/Date to thread candidate select, create, and update + +### Key Files Created/Modified +- `src/server/services/market-price.service.ts` — Market price CRUD +- `src/server/routes/exchange-rates.ts` — Exchange rates endpoint +- `src/server/routes/market-prices.ts` — Market prices API +- `src/server/index.ts` — Route registration + public access +- `src/server/services/item.service.ts` — priceCurrency in selects/create +- `src/server/services/thread.service.ts` — foundPrice fields in candidate operations + +## Self-Check: PASSED +- [x] Exchange rates endpoint created +- [x] Market prices CRUD endpoints created +- [x] Item responses include priceCurrency +- [x] Candidate responses include foundPrice fields diff --git a/.planning/phases/33-currency-system/33-04-SUMMARY.md b/.planning/phases/33-currency-system/33-04-SUMMARY.md new file mode 100644 index 0000000..f0fa9a0 --- /dev/null +++ b/.planning/phases/33-currency-system/33-04-SUMMARY.md @@ -0,0 +1,26 @@ +# Plan 33-04 Summary + +**Status:** Complete +**Completed:** 2026-04-13 + +## What Was Built + +Community price submission system with ownership validation and per-market aggregation, plus setup totals currency metadata. + +### Key Changes +- Created community-price.service.ts with validateOwnership, submitCommunityPrice, getCommunityPriceStats +- Created community-prices route (GET public stats, POST requires auth + ownership) +- Aggregation uses PERCENTILE_CONT(0.5) for median with HAVING COUNT >= 3 +- Ownership validation: user must have item linked to globalItemId +- Added priceCurrency to setup service (getSetupWithItems and getSetupWithItemsById) + +### Key Files Created/Modified +- `src/server/services/community-price.service.ts` — Community price logic +- `src/server/routes/community-prices.ts` — Community price API +- `src/server/index.ts` — Route registration +- `src/server/services/setup.service.ts` — priceCurrency in item lists + +## Self-Check: PASSED +- [x] Community price service with ownership validation +- [x] Median aggregation with 3-report minimum +- [x] Setup items include priceCurrency