feat: read opening hours from Google Business Profile

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>
This commit is contained in:
2026-11-04 16:13:35 +01:00
co-authored by Claude Opus 5.5
parent 29d8700081
commit a651519dbe
15 changed files with 378 additions and 46 deletions
+29
View File
@@ -0,0 +1,29 @@
# 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; `--cerca` to find the Place ID)
- `src/data/orari.ts` (snapshot or fallback, `orariTesto` generated), `officina.ts` uses it; legal name added (footer + `legalName`)
- Insegna reads `/dati/orari.json` at runtime, handles special closures, redraws bars
- `docker-compose.yml`: `orari` service + shared volume; nginx `/dati/` no-cache; `deploy.sh` snapshot + `.env.server` transfer
- 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`, set `GOOGLE_PLACE_ID`, `./deploy.sh`, commit the snapshot