Owner notification webhook (Telegram re-point) #23
Notifications
Due Date
No due date set.
Blocks
Depends on
#25 Decommission Easy!Appointments + n8n booking-sync
BPPP/smb-online
#16 Availability engine + booking API (create/cancel/reschedule)
BPPP/smb-online
Reference: BPPP/smb-online#23
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#14
What to build
Owner notification on new/changed bookings, reusing the existing Telegram-send logic instead of
reimplementing it — just re-pointed at the new booking module instead of Easy!Appointments.
payload shape as today's
n8n/booking-sync.json→ Telegram-send step expects).n8n/booking-sync.json's Telegram-notify portion is re-pointed at this new internal webhook(the EA-specific lookup/transform steps upstream of it are no longer needed and are removed or
bypassed).
clients.notify_channelselects the channel; onlytelegramsends anything real at launch(other values are accepted but no-op, ready for a future channel).
Acceptance criteria
message to the owning client's configured Telegram chat, with the same information content
as today's EA-sourced notification (business, customer, service, time, contact, source).
notify_channelset to anything other thantelegramreceives no notification(rather than erroring).
n8n/booking-sync.jsonno longer depends on Easy!Appointments' API to build the notificationpayload.
Blocked by
Implemented in
a27ee59.backoffice/app/owner_notify.py: fire-and-forget webhook POST (mirrorsmailer.py's background-thread-queue pattern), firing on booking create/cancel/reschedule viabooking_api.py's three shared mutation helpers (so every caller -- public API, customer token-based cancel/reschedule, owner manual entry -- is covered).Build booking rownode's{booking, business_name, notify_channel}, plus aneventfield (created/cancelled/rescheduled) so the Telegram message text can say what happened instead of always "new booking".n8n/booking-sync.json: newOwner notify webhooknode feeds aTelegram channel?IF node (gates onnotify_channel === 'telegram', no-op otherwise) straight into the existingNotify owner (Telegram)node, now reading fields from the webhook body directly instead of through the EA-lookup-drivenBuild booking rownode. The old EA-sourced path (Booking webhook->Build booking row->Save to CRM) is untouched for CRM sync, but its link into Telegram is removed -- Telegram notify no longer depends on EA's API.OWNER_NOTIFY_WEBHOOK_URLenv var added (blank = skip, same convention asSMTP_HOST).test_owner_notify.py(unit, webhook-call shape) + three new integration tests intest_booking_api.pyasserting create/cancel/reschedule each callowner_notify.notifywith the right event. Full suite (138 tests) passes.Note: the Telegram
chatIdstays a single hardcoded value shared across all clients (pre-existing, not scoped by this ticket) -- per-client chat routing would need a schema addition and wasn't asked for here; the business name in the message text is what currently distinguishes which client a booking belongs to.