MED-145: send notification to patient when summary completed (#61)

* MED-145: send notification to patient when summary completed

* MED-145: send notification to patient when summary completed

* use aliased imports where possible, revert cart service urls

* save language preference to local db

* remove unnecessary optional chaning
This commit is contained in:
Helena
2025-08-28 13:05:07 +03:00
committed by GitHub
parent 5159325e6d
commit 86dc221cc6
22 changed files with 551 additions and 169 deletions

View File

@@ -108,6 +108,90 @@ export type Database = {
}
Relationships: []
}
medipost_dispatch: {
Row: {
changed_by: string | null
created_at: string
error_message: string | null
id: number
is_medipost_error: boolean
is_success: boolean
medusa_order_id: string
}
Insert: {
changed_by?: string | null
created_at?: string
error_message?: string | null
id?: number
is_medipost_error: boolean
is_success: boolean
medusa_order_id: string
}
Update: {
changed_by?: string | null
created_at?: string
error_message?: string | null
id?: number
is_medipost_error?: boolean
is_success?: boolean
medusa_order_id?: string
}
Relationships: []
}
medusa_action: {
Row: {
action: string
created_at: string
id: number
medusa_user_id: string
page: string | null
user_email: string
}
Insert: {
action: string
created_at?: string
id?: number
medusa_user_id: string
page?: string | null
user_email: string
}
Update: {
action?: string
created_at?: string
id?: number
medusa_user_id?: string
page?: string | null
user_email?: string
}
Relationships: []
}
notification_entries: {
Row: {
action: string
comment: string | null
created_at: string
id: number
related_record_key: string | null
status: Database["audit"]["Enums"]["action_status"]
}
Insert: {
action: string
comment?: string | null
created_at?: string
id?: number
related_record_key?: string | null
status: Database["audit"]["Enums"]["action_status"]
}
Update: {
action?: string
comment?: string | null
created_at?: string
id?: number
related_record_key?: string | null
status?: Database["audit"]["Enums"]["action_status"]
}
Relationships: []
}
page_views: {
Row: {
account_id: string
@@ -201,28 +285,6 @@ export type Database = {
}
Relationships: []
}
medusa_action: {
Row: {
id: number
medusa_user_id: string
user_email: string
action: string
page: string
created_at: string
}
Insert: {
medusa_user_id: string
user_email: string
action: string
page: string
}
Update: {
medusa_user_id?: string
user_email?: string
action?: string
page?: string
}
}
}
Views: {
[_ in never]: never
@@ -231,6 +293,7 @@ export type Database = {
[_ in never]: never
}
Enums: {
action_status: "SUCCESS" | "FAIL"
doctor_page_view_action:
| "VIEW_ANALYSIS_RESULTS"
| "VIEW_DASHBOARD"
@@ -329,14 +392,14 @@ export type Database = {
id: string
is_personal_account: boolean
last_name: string | null
medusa_account_id: string | null
name: string
personal_code: string | null
phone: string | null
picture_url: string | null
preferred_locale: Database["medreport"]["Enums"]["locale"] | null
primary_owner_user_id: string
public_data: Json
slug: string | null
medusa_account_id: string | null
updated_at: string | null
updated_by: string | null
}
@@ -351,14 +414,14 @@ export type Database = {
id?: string
is_personal_account?: boolean
last_name?: string | null
medusa_account_id?: string | null
name: string
personal_code?: string | null
phone?: string | null
picture_url?: string | null
preferred_locale?: Database["medreport"]["Enums"]["locale"] | null
primary_owner_user_id?: string
public_data?: Json
slug?: string | null
medusa_account_id?: string | null
updated_at?: string | null
updated_by?: string | null
}
@@ -373,14 +436,14 @@ export type Database = {
id?: string
is_personal_account?: boolean
last_name?: string | null
medusa_account_id?: string | null
name?: string
personal_code?: string | null
phone?: string | null
picture_url?: string | null
preferred_locale?: Database["medreport"]["Enums"]["locale"] | null
primary_owner_user_id?: string
public_data?: Json
slug?: string | null
medusa_account_id?: string | null
updated_at?: string | null
updated_by?: string | null
}
@@ -393,6 +456,7 @@ export type Database = {
created_at: string
created_by: string | null
has_seen_confirmation: boolean
id: string
updated_at: string
updated_by: string | null
user_id: string
@@ -403,6 +467,7 @@ export type Database = {
created_at?: string
created_by?: string | null
has_seen_confirmation?: boolean
id?: string
updated_at?: string
updated_by?: string | null
user_id: string
@@ -413,6 +478,7 @@ export type Database = {
created_at?: string
created_by?: string | null
has_seen_confirmation?: boolean
id?: string
updated_at?: string
updated_by?: string | null
user_id?: string
@@ -1798,12 +1864,13 @@ export type Database = {
id: string
is_personal_account: boolean
last_name: string | null
medusa_account_id: string | null
name: string
personal_code: string | null
phone: string | null
picture_url: string | null
preferred_locale: Database["medreport"]["Enums"]["locale"] | null
primary_owner_user_id: string
public_data: Json
slug: string | null
updated_at: string | null
updated_by: string | null
@@ -1836,6 +1903,7 @@ export type Database = {
primary_owner_user_id: string
name: string
email: string
personal_code: string
picture_url: string
created_at: string
updated_at: string
@@ -1853,10 +1921,18 @@ export type Database = {
account_id: string
}[]
}
get_medipost_dispatch_tries: {
Args: { p_medusa_order_id: string }
Returns: number
}
get_nonce_status: {
Args: { p_id: string }
Returns: Json
}
get_order_possible_actions: {
Args: { p_medusa_order_id: string }
Returns: Json
}
get_upper_system_role: {
Args: Record<PropertyKey, never>
Returns: string
@@ -1937,6 +2013,10 @@ export type Database = {
Args: { account_id: string; user_id: string }
Returns: boolean
}
medipost_retry_dispatch: {
Args: { order_id: string }
Returns: Json
}
revoke_nonce: {
Args: { p_id: string; p_reason?: string }
Returns: boolean
@@ -2057,21 +2137,6 @@ export type Database = {
}
Returns: Json
}
medipost_retry_dispatch: {
Args: {
order_id: string
}
Returns: {
success: boolean
error: string | null
}
}
get_medipost_dispatch_tries: {
Args: {
p_medusa_order_id: string
}
Returns: number
}
}
Enums: {
analysis_feedback_status: "STARTED" | "DRAFT" | "COMPLETED"
@@ -2093,6 +2158,7 @@ export type Database = {
| "invites.manage"
application_role: "user" | "doctor" | "super_admin"
billing_provider: "stripe" | "lemon-squeezy" | "paddle" | "montonio"
locale: "en" | "et" | "ru"
notification_channel: "in_app" | "email"
notification_type: "info" | "warning" | "error"
payment_status: "pending" | "succeeded" | "failed"
@@ -7959,6 +8025,7 @@ export type CompositeTypes<
export const Constants = {
audit: {
Enums: {
action_status: ["SUCCESS", "FAIL"],
doctor_page_view_action: [
"VIEW_ANALYSIS_RESULTS",
"VIEW_DASHBOARD",
@@ -7996,6 +8063,7 @@ export const Constants = {
],
application_role: ["user", "doctor", "super_admin"],
billing_provider: ["stripe", "lemon-squeezy", "paddle", "montonio"],
locale: ["en", "et", "ru"],
notification_channel: ["in_app", "email"],
notification_type: ["info", "warning", "error"],
payment_status: ["pending", "succeeded", "failed"],