Both flows now POST into the smb-crm DB API instead of appending to Sheets, so
Postgres stays the source of truth and the DB->Sheets mirror keeps the Sheet
current. Telegram notifications unchanged.
- lead-intake: Webhook -> Build lead row -> POST /api/leads -> Telegram
(dropped the direct Sheets append + the redundant activity-log nodes; the DB
service logs + mirrors activity itself).
- onboarding: Webhook -> Compute -> POST /api/clients (DB assigns C-id) ->
Build project w/ returned id -> POST /api/projects -> Telegram. DB computes
renewal_date; go-live = start + 14d.
- Token injected at deploy time; repo keeps the __CRM_TOKEN__ placeholder.
Verified end-to-end on the live webhooks: lead and client+project land in the
DB and mirror to Sheets; test data cleaned; DB/Sheets consistent.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Webhook /webhook/onboard → read Clients → compute next C-#### →
append Clients row (status onboarding, renewal_date auto from billing
cycle) → seed Projects row (checklist from services, +14d go-live) →
log Activity → Telegram confirmation. Sheets writes retry on fail.
Verified end-to-end (C-0002 created across all three tabs).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>