feat(MED-86): add db fn to show medipost dispatch error for order in Medusa
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
CREATE OR REPLACE FUNCTION medreport.order_has_medipost_dispatch_error(medusa_order_id text)
|
||||
RETURNS boolean AS $$
|
||||
SELECT EXISTS (
|
||||
SELECT 1 FROM medreport.medipost_actions
|
||||
WHERE medusa_order_id = $1
|
||||
AND has_error = true
|
||||
);
|
||||
$$ LANGUAGE sql STABLE;
|
||||
|
||||
grant execute on function medreport.order_has_medipost_dispatch_error(text) to service_role;
|
||||
Reference in New Issue
Block a user