MED-88: add doctor email notifications (#65)

* MED-88: add doctor email notifications

* add logging, send open jobs notification on partial analysis response

* update permissions

* fix import, permissions

* casing, let email be null

* unused import
This commit is contained in:
Helena
2025-09-02 12:14:01 +03:00
committed by GitHub
parent 56a832b96b
commit 3498406a0c
41 changed files with 751 additions and 69 deletions

View File

@@ -0,0 +1,8 @@
grant select on table "medreport"."doctor_analysis_feedback" to "service_role";
create policy "service_role_select"
on "medreport"."doctor_analysis_feedback"
as permissive
for select
to service_role
using (true);

View File

@@ -0,0 +1,10 @@
create trigger "trigger_doctor_notification" after update
on "medreport"."analysis_orders" for each row
execute function "supabase_functions"."http_request"(
'http://host.docker.internal:3000/api/db/webhook',
'POST',
'{"Content-Type":"application/json", "X-Supabase-Event-Signature":"WEBHOOKSECRET"}',
'{}',
'5000'
);

View File

@@ -0,0 +1,10 @@
alter table audit.notification_entries enable row level security;
create policy "service_role_insert"
on "audit"."notification_entries"
as permissive
for insert
to service_role
with check (true);
grant insert on table "audit"."notification_entries" to "service_role";