Places API script normalizes regular and special hours; build uses a snapshot, an orari sidecar refreshes /dati/orari.json every 6 hours for the open-now sign. Adds the company legal name. Key stays in .env.server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
Handoff
Issue
None (explicit user instruction: read opening hours from the Google Business Profile via Places API)
Goal
Make Google Business Profile the single source of opening hours.
Status
in-progress — code done; waiting for the API key in .env.server to look up the Place ID, take the first snapshot and deploy
What changed
scripts/orari-google.mjs(Places API → site format;--cercato find the Place ID)src/data/orari.ts(snapshot or fallback,orariTestogenerated),officina.tsuses it; legal name added (footer +legalName)- Insegna reads
/dati/orari.jsonat runtime, handles special closures, redraws bars docker-compose.yml:orariservice + shared volume; nginx/dati/no-cache;deploy.shsnapshot +.env.servertransfer- ADR 0005, runbook, module map, CLAUDE.md
Tests
- Run: script with a stubbed Places response (regular hours + holiday + half day) → correct
settimana/prossimiGiorni - Run: Insegna with a test
/dati/orari.json(today closed) → "Chiuso ora · Riapriamo venerdì alle 8:00"; without file → build hours - Not run: real Places API call (no key yet), server container
Risks / open questions
- Billing account required on Google Cloud; check free usage on the current price list
- Restrict the key to Places API (New) only
Suggested next step
- Fill
.env.server, run--cerca, setGOOGLE_PLACE_ID,./deploy.sh, commit the snapshot