CREATE OR REPLACE FUNCTION medreport.sync_analysis_results()
RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
  PERFORM net.http_post(
    url := 'https://test.medreport.ee/api/job/sync-analysis-results',
    headers := jsonb_build_object(
      'Content-Type', 'application/json',
      'x-jobs-api-key', 'fd26ec26-70ed-11f0-9e95-431ac3b15a84'
    )
  );
END;
$$;

grant execute on function medreport.sync_analysis_results() to service_role;
