Use fixed demo currency snapshot
Build and deploy Docker image / build (push) Successful in 1m13s

This commit is contained in:
Ruslan Bakiev
2026-08-24 18:15:32 +07:00
parent bd06ee04c0
commit ca0e70d723
4 changed files with 75 additions and 171 deletions
@@ -0,0 +1,37 @@
-- Seed the fixed 2026-08-24 demo snapshot. Runtime pricing reads only this table.
INSERT INTO "exchange_currency_rate_snapshots" (
"uuid",
"base_currency",
"effective_date",
"quoted_at",
"next_update_at",
"provider",
"documentation",
"terms_of_use"
)
VALUES (
'00000000-0000-4000-8000-202608240001',
'USD',
DATE '2026-08-24',
TIMESTAMP '2026-08-24 00:02:31',
NULL,
'demo-fixed',
'internal demo snapshot',
'demo only'
)
ON CONFLICT ("base_currency", "effective_date") DO NOTHING;
INSERT INTO "exchange_currency_rates" ("snapshot_id", "quote_currency", "rate")
SELECT snapshot."id", rate."quote_currency", rate."rate"
FROM "exchange_currency_rate_snapshots" AS snapshot
CROSS JOIN (
VALUES
('USD', 1.0000000000::DECIMAL(24,10)),
('RUB', 82.8028650000::DECIMAL(24,10)),
('CNY', 6.7291140000::DECIMAL(24,10)),
('EUR', 0.8561800000::DECIMAL(24,10)),
('AED', 3.6725000000::DECIMAL(24,10))
) AS rate("quote_currency", "rate")
WHERE snapshot."base_currency" = 'USD'
AND snapshot."effective_date" = DATE '2026-08-24'
ON CONFLICT ("snapshot_id", "quote_currency") DO NOTHING;