MED-109: add doctor role and basic view (#45)

* MED-109: add doctor role and basic view

* add role to accounts

* remove old super admin and doctor sql
This commit is contained in:
Helena
2025-08-13 12:28:50 +03:00
committed by GitHub
parent ce7b04fda8
commit 3c6c86c7c8
32 changed files with 562 additions and 35 deletions

View File

@@ -4,9 +4,13 @@ import { Database } from '@kit/supabase/database';
import { UserAnalysis } from '../types/accounts';
export type AccountWithParams = Database['medreport']['Tables']['accounts']['Row'] & {
account_params: Pick<Database['medreport']['Tables']['account_params']['Row'], 'weight' | 'height'> | null;
};
export type AccountWithParams =
Database['medreport']['Tables']['accounts']['Row'] & {
account_params: Pick<
Database['medreport']['Tables']['account_params']['Row'],
'weight' | 'height'
> | null;
};
/**
* Class representing an API for interacting with user accounts.
@@ -79,7 +83,8 @@ class AccountsApi {
accounts (
name,
slug,
picture_url
picture_url,
application_role
)
`,
)
@@ -95,6 +100,7 @@ class AccountsApi {
label: accounts.name,
value: accounts.slug,
image: accounts.picture_url,
application_role: accounts.application_role,
}));
}
@@ -209,11 +215,12 @@ class AccountsApi {
return null;
}
return analysisResponses
.map((r) => ({
...r,
elements: analysisResponseElements.filter((e) => e.analysis_response_id === r.id),
}));
return analysisResponses.map((r) => ({
...r,
elements: analysisResponseElements.filter(
(e) => e.analysis_response_id === r.id,
),
}));
}
}