feat(room): add new column of specialist form

This commit is contained in:
avicenan
2026-05-22 22:00:48 +09:00
parent f01c9bfa10
commit a4912caf4f
3 changed files with 21 additions and 7 deletions

View File

@ -8,6 +8,7 @@ import { ServiceClass } from "./service_class";
import { OneToMany } from "typeorm"; import { OneToMany } from "typeorm";
import { MedicalForm } from "./medical_form"; import { MedicalForm } from "./medical_form";
import { JoinTable } from "typeorm"; import { JoinTable } from "typeorm";
import { SpecialistForm } from "../types/specialist_form";
@Entity("rooms") @Entity("rooms")
export class Room { export class Room {
@ -69,13 +70,8 @@ export class Room {
@ManyToMany(() => Service, (service) => service.rooms) @ManyToMany(() => Service, (service) => service.rooms)
services: Service[]; services: Service[];
@ManyToMany(() => MedicalForm, { onDelete: "CASCADE" }) @Column
@JoinTable({ specialist_form: SpecialistForm
name: "room_medical_forms",
joinColumn: { name: "room_id" },
inverseJoinColumn: { name: "medical_form_id" },
})
medical_forms: MedicalForm[];
@CreateDateColumn() @CreateDateColumn()
created_at: Date; created_at: Date;

View File

@ -67,3 +67,4 @@ export * from "../types/role";
export * from "../types/status"; export * from "../types/status";
export * from "../types/email"; export * from "../types/email";
export * from "../types/telegram"; export * from "../types/telegram";
export * from "../types/specialist_form";

View File

@ -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',
}