feat(MED-131): use existing supabase server admin client conf
This commit is contained in:
8
lib/services/codes.service.ts
Normal file
8
lib/services/codes.service.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { getSupabaseServerAdminClient } from "@kit/supabase/server-admin-client";
|
||||
import type { ICode } from "~/lib/types/code";
|
||||
|
||||
export const createCodes = async (codes: ICode[]) => {
|
||||
await getSupabaseServerAdminClient()
|
||||
.schema('medreport').from('codes')
|
||||
.upsert(codes);
|
||||
}
|
||||
9
lib/types/code.ts
Normal file
9
lib/types/code.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export interface ICode {
|
||||
hk_code: string;
|
||||
hk_code_multiplier: number;
|
||||
coefficient: number;
|
||||
price: number;
|
||||
analysis_group_id: number | null;
|
||||
analysis_element_id: number | null;
|
||||
analysis_id: number | null;
|
||||
}
|
||||
@@ -224,3 +224,36 @@ export const ConfirmedLoadResponseSchema = z.object({
|
||||
ErrorMessage: z.union([z.string(), z.null()]),
|
||||
});
|
||||
export type ConfirmedLoadResponse = z.infer<typeof ConfirmedLoadResponseSchema>;
|
||||
|
||||
export interface ISearchLoadResponse {
|
||||
Value: string;
|
||||
Data: {
|
||||
T_Lic: {
|
||||
ID: number;
|
||||
Name: string;
|
||||
OnlineCanSelectWorker: boolean;
|
||||
Email: string | null;
|
||||
PersonalCodeRequired: boolean;
|
||||
Phone: string | null;
|
||||
}[];
|
||||
T_Service: {
|
||||
ID: number;
|
||||
ClinicID: number;
|
||||
Code: string;
|
||||
Description: string | null;
|
||||
Display: string;
|
||||
Duration: number;
|
||||
HasFreeCodes: boolean;
|
||||
Name: string;
|
||||
NetoDuration: number;
|
||||
OnlineHideDuration: number;
|
||||
OnlineHidePrice: number;
|
||||
Price: number;
|
||||
PricePeriods: string | null;
|
||||
RequiresPayment: boolean;
|
||||
SyncID: string;
|
||||
}[];
|
||||
};
|
||||
ErrorCode: number;
|
||||
ErrorMessage: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user