fix: currency suggestion uses region detection, seed adds market prices
All checks were successful
CI / ci (push) Successful in 1m24s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 15s

- Currency auto-suggestion now uses locale region subtag (en-US → US → USD,
  en-DE → DE → EUR) instead of language prefix. Fixes wrong suggestion for
  users with English browser locale in European countries.
- Added dismiss button (X) to suggestion banner
- Dev seed script now clears existing dev data before re-seeding (safe to
  run repeatedly without manual DB cleanup)
- Added DEV_MARKET_PRICES with multi-market UVP data for 10 global items
  (EU/US/UK prices) and community prices for 5 owned items

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 21:27:57 +02:00
parent 51c8703a3d
commit 23027551b4
3 changed files with 356 additions and 30 deletions

View File

@@ -881,6 +881,212 @@ export const DEV_SETUPS = [
},
] as const;
// ── Market Prices ─────────────────────────────────────────────────
// Multi-market UVP/MSRP prices for global items.
// globalItemIndex references DEV_GLOBAL_ITEMS array positions.
export const DEV_MARKET_PRICES = [
// Revelate Designs Terrapin (index 0)
{
globalItemIndex: 0,
market: "EU",
currency: "EUR",
priceCents: 18500,
source: "manufacturer",
},
{
globalItemIndex: 0,
market: "US",
currency: "USD",
priceCents: 19900,
source: "manufacturer",
},
{
globalItemIndex: 0,
market: "UK",
currency: "GBP",
priceCents: 16500,
source: "manufacturer",
},
// Apidura Expedition Handlebar Pack (index 1)
{
globalItemIndex: 1,
market: "EU",
currency: "EUR",
priceCents: 16000,
source: "manufacturer",
},
{
globalItemIndex: 1,
market: "US",
currency: "USD",
priceCents: 17500,
source: "manufacturer",
},
{
globalItemIndex: 1,
market: "UK",
currency: "GBP",
priceCents: 14000,
source: "manufacturer",
},
// Ortlieb Frame-Pack RC (index 2)
{
globalItemIndex: 2,
market: "EU",
currency: "EUR",
priceCents: 12000,
source: "manufacturer",
},
{
globalItemIndex: 2,
market: "US",
currency: "USD",
priceCents: 14500,
source: "manufacturer",
},
// Zpacks Duplex (index 6) — US brand, different pricing per market
{
globalItemIndex: 6,
market: "US",
currency: "USD",
priceCents: 67900,
source: "manufacturer",
},
{
globalItemIndex: 6,
market: "EU",
currency: "EUR",
priceCents: 72000,
source: "retailer",
},
{
globalItemIndex: 6,
market: "UK",
currency: "GBP",
priceCents: 62000,
source: "retailer",
},
// Tarptent Stratospire Li (index 7)
{
globalItemIndex: 7,
market: "US",
currency: "USD",
priceCents: 62500,
source: "manufacturer",
},
{
globalItemIndex: 7,
market: "EU",
currency: "EUR",
priceCents: 68000,
source: "retailer",
},
// MSR Hubba Hubba (index 8)
{
globalItemIndex: 8,
market: "EU",
currency: "EUR",
priceCents: 49000,
source: "manufacturer",
},
{
globalItemIndex: 8,
market: "US",
currency: "USD",
priceCents: 47000,
source: "manufacturer",
},
{
globalItemIndex: 8,
market: "UK",
currency: "GBP",
priceCents: 42000,
source: "manufacturer",
},
// Enlightened Equipment Enigma (index 10)
{
globalItemIndex: 10,
market: "US",
currency: "USD",
priceCents: 29500,
source: "manufacturer",
},
{
globalItemIndex: 10,
market: "EU",
currency: "EUR",
priceCents: 33000,
source: "retailer",
},
// Therm-a-Rest NeoAir XLite (index 13)
{
globalItemIndex: 13,
market: "EU",
currency: "EUR",
priceCents: 22000,
source: "manufacturer",
},
{
globalItemIndex: 13,
market: "US",
currency: "USD",
priceCents: 21000,
source: "manufacturer",
},
{
globalItemIndex: 13,
market: "UK",
currency: "GBP",
priceCents: 19000,
source: "manufacturer",
},
// BRS-3000T Stove (index 15) — cheap item, big market variance
{
globalItemIndex: 15,
market: "EU",
currency: "EUR",
priceCents: 1500,
source: "retailer",
},
{
globalItemIndex: 15,
market: "US",
currency: "USD",
priceCents: 2000,
source: "retailer",
},
{
globalItemIndex: 15,
market: "UK",
currency: "GBP",
priceCents: 1300,
source: "retailer",
},
// Wahoo ELEMNT BOLT (index 24)
{
globalItemIndex: 24,
market: "EU",
currency: "EUR",
priceCents: 27900,
source: "manufacturer",
},
{
globalItemIndex: 24,
market: "US",
currency: "USD",
priceCents: 27999,
source: "manufacturer",
},
{
globalItemIndex: 24,
market: "UK",
currency: "GBP",
priceCents: 24999,
source: "manufacturer",
},
] as const;
// ── Settings ───────────────────────────────────────────────────────
export const DEV_SETTINGS = [