Merge branch 'main' into MED-57
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"subject": "Your Synlab order has been placed - {{analysisPackageName}}",
|
||||
"previewText": "Your Synlab order has been placed - {{analysisPackageName}}",
|
||||
"heading": "Your Synlab order has been placed - {{analysisPackageName}}",
|
||||
"subject": "Your Medreport order has been placed - {{analysisPackageName}}",
|
||||
"previewText": "Your Medreport order has been placed - {{analysisPackageName}}",
|
||||
"heading": "Your Medreport order has been placed - {{analysisPackageName}}",
|
||||
"hello": "Hello {{personName}},",
|
||||
"lines1": "The order for {{analysisPackageName}} analysis package has been sent to the lab. Please go to the lab to collect the sample: SYNLAB - {{partnerLocationName}}",
|
||||
"lines1": "The order for {{analysisPackageName}} analysis package has been sent to the lab. Please go to the lab to collect the sample: Synlab - {{partnerLocationName}}",
|
||||
"lines2": "<i>If you are unable to go to the lab to collect the sample, you can go to any other suitable collection point - <a href=\"https://medreport.ee/et/verevotupunktid\">view locations and opening hours</a>.</i>",
|
||||
"lines3": "It is recommended to collect the sample in the morning (before 12:00) and not to eat or drink (water can be drunk).",
|
||||
"lines4": "At the collection point, select the order from the queue: the order from the doctor.",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"subject": "Teie SYNLAB tellimus on kinnitatud - {{analysisPackageName}}",
|
||||
"previewText": "Teie SYNLAB tellimus on kinnitatud - {{analysisPackageName}}",
|
||||
"heading": "Teie SYNLAB tellimus on kinnitatud - {{analysisPackageName}}",
|
||||
"subject": "Teie Medreport tellimus on kinnitatud - {{analysisPackageName}}",
|
||||
"previewText": "Teie Medreport tellimus on kinnitatud - {{analysisPackageName}}",
|
||||
"heading": "Teie Medreport tellimus on kinnitatud - {{analysisPackageName}}",
|
||||
"hello": "Tere {{personName}},",
|
||||
"lines1": "Saatekiri {{analysisPackageName}} analüüsi uuringuteks on saadetud laborisse digitaalselt. Palun mine proove andma: SYNLAB - {{partnerLocationName}}",
|
||||
"lines1": "Saatekiri {{analysisPackageName}} analüüsi uuringuteks on saadetud laborisse digitaalselt. Palun mine proove andma: Synlab - {{partnerLocationName}}",
|
||||
"lines2": "<i>Kui Teil ei ole võimalik valitud asukohta minna proove andma, siis võite minna endale sobivasse proovivõtupunkti - <a href=\"https://medreport.ee/et/verevotupunktid\">vaata asukohti ja lahtiolekuaegasid</a>.</i>",
|
||||
"lines3": "Soovituslik on proove anda pigem hommikul (enne 12:00) ning söömata ja joomata (vett võib juua).",
|
||||
"lines4": "Proovivõtupunktis valige järjekorrasüsteemis: <strong>saatekirjad</strong> alt <strong>eriarsti saatekiri</strong>.",
|
||||
|
||||
@@ -32,6 +32,7 @@ import { cn } from '@kit/ui/utils';
|
||||
import { toTitleCase } from '~/lib/utils';
|
||||
|
||||
import { usePersonalAccountData } from '../hooks/use-personal-account-data';
|
||||
import { ApplicationRole, ApplicationRoleEnum } from '../types/accounts';
|
||||
|
||||
const PERSONAL_ACCOUNT_SLUG = 'personal';
|
||||
|
||||
@@ -51,13 +52,13 @@ export function PersonalAccountDropdown({
|
||||
id: string | null;
|
||||
name: string | null;
|
||||
picture_url: string | null;
|
||||
application_role: string;
|
||||
application_role: ApplicationRole | null;
|
||||
};
|
||||
accounts: {
|
||||
label: string | null;
|
||||
value: string | null;
|
||||
image?: string | null;
|
||||
application_role: string;
|
||||
application_role: ApplicationRole | null;
|
||||
}[];
|
||||
signOutRequested: () => unknown;
|
||||
|
||||
@@ -97,13 +98,14 @@ export function PersonalAccountDropdown({
|
||||
|
||||
const isSuperAdmin = useMemo(() => {
|
||||
const hasAdminRole =
|
||||
personalAccountData?.application_role === 'super_admin';
|
||||
personalAccountData?.application_role === ApplicationRoleEnum.SuperAdmin;
|
||||
|
||||
return hasAdminRole && hasTotpFactor;
|
||||
}, [user, personalAccountData, hasTotpFactor]);
|
||||
|
||||
const isDoctor = useMemo(() => {
|
||||
const hasDoctorRole = personalAccountData?.application_role === 'doctor';
|
||||
const hasDoctorRole =
|
||||
personalAccountData?.application_role === ApplicationRoleEnum.Doctor;
|
||||
|
||||
return hasDoctorRole && hasTotpFactor;
|
||||
}, [user, personalAccountData, hasTotpFactor]);
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
import { Database } from '@kit/supabase/database';
|
||||
|
||||
export type UserAnalysisElement = Database['medreport']['Tables']['analysis_response_elements']['Row'];
|
||||
export type UserAnalysisResponse = Database['medreport']['Tables']['analysis_responses']['Row'] & {
|
||||
elements: UserAnalysisElement[];
|
||||
};
|
||||
export type UserAnalysisElement =
|
||||
Database['medreport']['Tables']['analysis_response_elements']['Row'];
|
||||
export type UserAnalysisResponse =
|
||||
Database['medreport']['Tables']['analysis_responses']['Row'] & {
|
||||
elements: UserAnalysisElement[];
|
||||
};
|
||||
export type UserAnalysis = UserAnalysisResponse[];
|
||||
|
||||
export type ApplicationRole =
|
||||
Database['medreport']['Tables']['accounts']['Row']['application_role'];
|
||||
export enum ApplicationRoleEnum {
|
||||
User = 'user',
|
||||
Doctor = 'doctor',
|
||||
SuperAdmin = 'super_admin',
|
||||
}
|
||||
@@ -114,7 +114,8 @@ export class TeamAccountsApi {
|
||||
role,
|
||||
name,
|
||||
slug,
|
||||
picture_url
|
||||
picture_url,
|
||||
application_role
|
||||
)
|
||||
`,
|
||||
)
|
||||
|
||||
@@ -1563,6 +1563,9 @@ export type Database = {
|
||||
Views: {
|
||||
user_account_workspace: {
|
||||
Row: {
|
||||
application_role:
|
||||
| Database["medreport"]["Enums"]["application_role"]
|
||||
| null
|
||||
id: string | null
|
||||
name: string | null
|
||||
picture_url: string | null
|
||||
@@ -1574,6 +1577,9 @@ export type Database = {
|
||||
}
|
||||
user_accounts: {
|
||||
Row: {
|
||||
application_role:
|
||||
| Database["medreport"]["Enums"]["application_role"]
|
||||
| null
|
||||
id: string | null
|
||||
name: string | null
|
||||
picture_url: string | null
|
||||
@@ -1634,7 +1640,9 @@ export type Database = {
|
||||
Returns: Json
|
||||
}
|
||||
create_team_account: {
|
||||
Args: { account_name: string; new_personal_code: string }
|
||||
Args:
|
||||
| { account_name: string }
|
||||
| { account_name: string; new_personal_code: string }
|
||||
Returns: {
|
||||
application_role: Database["medreport"]["Enums"]["application_role"]
|
||||
city: string | null
|
||||
@@ -1801,6 +1809,7 @@ export type Database = {
|
||||
primary_owner_user_id: string
|
||||
subscription_status: Database["medreport"]["Enums"]["subscription_status"]
|
||||
permissions: Database["medreport"]["Enums"]["app_permissions"][]
|
||||
application_role: Database["medreport"]["Enums"]["application_role"]
|
||||
}[]
|
||||
}
|
||||
transfer_team_account_ownership: {
|
||||
@@ -1819,6 +1828,22 @@ export type Database = {
|
||||
}
|
||||
Returns: undefined
|
||||
}
|
||||
update_analysis_order_status: {
|
||||
Args: {
|
||||
order_id: number
|
||||
medusa_order_id_param: string
|
||||
status_param: Database["medreport"]["Enums"]["analysis_order_status"]
|
||||
}
|
||||
Returns: {
|
||||
analysis_element_ids: number[] | null
|
||||
analysis_ids: number[] | null
|
||||
created_at: string
|
||||
id: number
|
||||
medusa_order_id: string
|
||||
status: Database["medreport"]["Enums"]["analysis_order_status"]
|
||||
user_id: string
|
||||
}
|
||||
}
|
||||
upsert_order: {
|
||||
Args: {
|
||||
target_account_id: string
|
||||
|
||||
Reference in New Issue
Block a user