MED-82: add patient notification emails (#74)

* MED-82: add patient notification emails

* remove console.log

* clean up

* remove extra paragraph from email
This commit is contained in:
Helena
2025-09-09 10:37:22 +03:00
committed by GitHub
parent d00449da29
commit ca13e9e30a
37 changed files with 718 additions and 179 deletions

View File

@@ -1,6 +1,5 @@
import type { Tables } from '@/packages/supabase/src/database.types';
import { AccountWithParams } from '@kit/accounts/api';
import { getSupabaseServerAdminClient } from '@kit/supabase/server-admin-client';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
@@ -26,6 +25,19 @@ export async function getAccount(id: string): Promise<AccountWithMemberships> {
return data as unknown as AccountWithMemberships;
}
export async function getUserContactAdmin(userId: string) {
const { data } = await getSupabaseServerAdminClient()
.schema('medreport')
.from('accounts')
.select('name, last_name, email, preferred_locale')
.eq('primary_owner_user_id', userId)
.eq('is_personal_account', true)
.single()
.throwOnError();
return data;
}
export async function getAccountAdmin({
primaryOwnerUserId,
}: {