move medipost xml to separate service to be unit tested
This commit is contained in:
@@ -2,7 +2,7 @@ import type { Tables } from '@/packages/supabase/src/database.types';
|
||||
import { getSupabaseServerAdminClient } from '@kit/supabase/server-admin-client';
|
||||
import type { IUuringElement } from "./medipost.types";
|
||||
|
||||
type AnalysesWithGroupsAndElements = ({
|
||||
export type AnalysesWithGroupsAndElements = ({
|
||||
analysis_elements: Tables<{ schema: 'medreport' }, 'analysis_elements'> & {
|
||||
analysis_groups: Tables<{ schema: 'medreport' }, 'analysis_groups'>;
|
||||
};
|
||||
@@ -105,7 +105,13 @@ export const createMedusaSyncSuccessEntry = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
export async function getAnalyses({ ids, originalIds }: { ids?: number[], originalIds?: string[] }): Promise<AnalysesWithGroupsAndElements> {
|
||||
export async function getAnalyses({
|
||||
ids,
|
||||
originalIds,
|
||||
}: {
|
||||
ids?: number[];
|
||||
originalIds?: string[];
|
||||
}): Promise<AnalysesWithGroupsAndElements> {
|
||||
const query = getSupabaseServerAdminClient()
|
||||
.schema('medreport')
|
||||
.from('analyses')
|
||||
|
||||
Reference in New Issue
Block a user