diff --git a/src/entity/room.ts b/src/entity/room.ts index 1352b2a..192b1c0 100644 --- a/src/entity/room.ts +++ b/src/entity/room.ts @@ -8,6 +8,7 @@ import { ServiceClass } from "./service_class"; import { OneToMany } from "typeorm"; import { MedicalForm } from "./medical_form"; import { JoinTable } from "typeorm"; +import { SpecialistForm } from "../types/specialist_form"; @Entity("rooms") export class Room { @@ -69,13 +70,8 @@ export class Room { @ManyToMany(() => Service, (service) => service.rooms) services: Service[]; - @ManyToMany(() => MedicalForm, { onDelete: "CASCADE" }) - @JoinTable({ - name: "room_medical_forms", - joinColumn: { name: "room_id" }, - inverseJoinColumn: { name: "medical_form_id" }, - }) - medical_forms: MedicalForm[]; + @Column + specialist_form: SpecialistForm @CreateDateColumn() created_at: Date; diff --git a/src/schema/public.ts b/src/schema/public.ts index c11f339..d97a6d7 100644 --- a/src/schema/public.ts +++ b/src/schema/public.ts @@ -67,3 +67,4 @@ export * from "../types/role"; export * from "../types/status"; export * from "../types/email"; export * from "../types/telegram"; +export * from "../types/specialist_form"; diff --git a/src/types/specialist_form.ts b/src/types/specialist_form.ts new file mode 100644 index 0000000..97c536d --- /dev/null +++ b/src/types/specialist_form.ts @@ -0,0 +1,17 @@ +/** + * Workflow kategori form khusus poli. + * DENTAL: poli gigi + * CARDIOLOGY: poli jantung + * DERMATOLOGY: poli kulit dan kelamin + * GYNECOLOGY: poli kebidanan dan kandungan + * ORTHOPEDICS: poli orthopedi + * NEUROLOGY: poli neurologi + */ +export enum SpecialistForm { + DENTAL = 'dental', + CARDIOLOGY = 'cardiology', + DERMATOLOGY = 'dermatology', + GYNECOLOGY = 'gynecology', + ORTHOPEDICS = 'orthopedics', + NEUROLOGY = 'neurology', +}