refactor(pricing): single source of truth for the service catalog
Previously two hand-maintained price lists (API COMPLIANCE_SERVICES + site SERVICE_META) drifted apart -- that is how the healthcare +$200 raise charged $399 while displaying $599. Eliminate the drift class entirely: - Move the catalog to api/src/service-catalog.ts (the authority; checkout charges from it). compliance-orders.ts imports it. - scripts/gen-service-catalog.mjs generates site/src/lib/service-catalog.generated.ts from the API source. intake_manifest.ts re-exports SERVICE_META from it, so all ~60 site pages keep working unchanged. - deploy.sh regenerates + drift-checks before building (site build context is ./site only and cannot read ../api, so generation happens host-side). - scripts/check-service-catalog-drift.mjs fails the build if the generated file ever diverges from the API (verified: passes aligned, fails on mismatch). To change a price now, edit ONE file: api/src/service-catalog.ts.
This commit is contained in:
parent
2bba28ae6b
commit
09e21a6c97
7 changed files with 718 additions and 534 deletions
10
deploy.sh
10
deploy.sh
|
|
@ -31,6 +31,16 @@ echo ""
|
|||
echo "=== Syncing canonical site header (Services dropdown) ==="
|
||||
python3 scripts/sync_nav.py
|
||||
|
||||
# Single source of truth for service pricing: the API catalog
|
||||
# (api/src/service-catalog.ts) is the authority (it is what checkout charges).
|
||||
# The site build context is ./site only and cannot read ../api, so we generate
|
||||
# site/src/lib/service-catalog.generated.ts here on the host before the docker
|
||||
# build. This guarantees displayed prices == charged prices.
|
||||
echo ""
|
||||
echo "=== Generating site service catalog from API source ==="
|
||||
node scripts/gen-service-catalog.mjs
|
||||
node scripts/check-service-catalog-drift.mjs
|
||||
|
||||
# Render the Alertmanager config from its template. Alertmanager does NOT expand
|
||||
# ${ENV} placeholders in its YAML, so the raw template (with ${TELEGRAM_BOT_TOKEN}
|
||||
# / ${TELEGRAM_CHAT_ID}) crash-loops it ("cannot unmarshal !!str `${TELEG...`").
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue