73 lines
1.4 KiB
TypeScript
73 lines
1.4 KiB
TypeScript
import type { MedicineFormData } from "~/schemas/medicine.schema"
|
|
import { type Base, genBase } from "./_base"
|
|
import type { MedicineGroup } from "./medicine-group"
|
|
import type { MedicineMethod } from "./medicine-method"
|
|
|
|
export interface Medicine extends Base {
|
|
code: string
|
|
name: string
|
|
medicineGroup_code?: string
|
|
medicineGroup?: MedicineGroup
|
|
medicineMethod_code?: string
|
|
medicineMethod?: MedicineMethod
|
|
medicineForm_code?: string
|
|
medicineForm?: MedicineFormData
|
|
uom_code: string
|
|
infra_id?: string | null
|
|
stock: number
|
|
}
|
|
|
|
export interface CreateDto {
|
|
code: string
|
|
name: string
|
|
medicineGroup_code: string
|
|
medicineMethod_code: string
|
|
uom_code: string
|
|
infra_id?: string | null
|
|
stock: number
|
|
}
|
|
|
|
export interface UpdateDto extends CreateDto {
|
|
id: number
|
|
}
|
|
|
|
export interface GetListDto {
|
|
page: number
|
|
size: number
|
|
name?: string
|
|
code?: string
|
|
medicineGroup_code?: string
|
|
medicineMethod_code?: string
|
|
uom_code?: string
|
|
type?: string
|
|
dose?: string
|
|
infra_id?: string
|
|
stock?: string
|
|
status?: string
|
|
}
|
|
|
|
export interface GetDetailDto {
|
|
id: number
|
|
}
|
|
|
|
export interface UpdateDto extends CreateDto {
|
|
id: number
|
|
}
|
|
|
|
export interface DeleteDto {
|
|
id: number
|
|
}
|
|
|
|
export function genMedicine(): Medicine {
|
|
return {
|
|
...genBase(),
|
|
name: 'name',
|
|
code: 'code',
|
|
medicineGroup_code: 'medicineGroup_code',
|
|
medicineMethod_code: 'medicineMethod_code',
|
|
uom_code: 'uom_code',
|
|
infra_id: null,
|
|
stock: 0
|
|
}
|
|
}
|