feat: implement order notifications service with TTO reservation confirmation handling feat: create migration for TTO booking email webhook trigger
11 lines
406 B
SQL
11 lines
406 B
SQL
create trigger tto_order_confirmation_email
|
|
after update on medreport.connected_online_reservation
|
|
for each row
|
|
when (old.status is distinct from new.status and new.status = 'CONFIRMED')
|
|
execute function supabase_functions.http_request(
|
|
'http://host.docker.internal:3000/api/db/webhook',
|
|
'POST',
|
|
'{"Content-Type":"application/json", "X-Supabase-Event-Signature":"WEBHOOKSECRET"}',
|
|
'{}',
|
|
'1000'
|
|
); |