feat(connect): return site_numeric_id in heartbeat response

Local backend needs the cloud DB integer PK to call Connect API
endpoints (menu sync, order pending poll). Heartbeat is the only
authenticated channel available at startup, so we piggyback the id
there rather than adding a new endpoint.

Changes:
  - schemas/site.py: site_numeric_id: int | None added to HeartbeatResponse
  - routers/heartbeat.py: site_numeric_id=site.id included in response

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 00:11:48 +03:00
parent cd8a6c53cf
commit abe7f4ff0d
2 changed files with 2 additions and 0 deletions

View File

@@ -39,4 +39,5 @@ def heartbeat(
expires_at=site.license_expires_at,
latest_version=settings.LATEST_VERSION,
waiter_domain=site.waiter_domain,
site_numeric_id=site.id,
)

View File

@@ -57,3 +57,4 @@ class HeartbeatResponse(BaseModel):
expires_at: datetime
latest_version: str | None = None
waiter_domain: str | None = None
site_numeric_id: int | None = None # cloud DB pk — needed by Connect sync loops