From 455d29cbadd50fba33fcb263d37b1b3e0586f2ad Mon Sep 17 00:00:00 2001 From: Muhammad Rayhan Ardiansyah Date: Wed, 18 Mar 2026 09:26:56 +0700 Subject: [PATCH] room to pharmacy --- src/entity/room_to_pharmacy.ts | 45 ++++++++++++++++++++++++++++++++++ src/schema/public.ts | 2 ++ 2 files changed, 47 insertions(+) create mode 100644 src/entity/room_to_pharmacy.ts diff --git a/src/entity/room_to_pharmacy.ts b/src/entity/room_to_pharmacy.ts new file mode 100644 index 0000000..10ca8df --- /dev/null +++ b/src/entity/room_to_pharmacy.ts @@ -0,0 +1,45 @@ +import { + Entity, + PrimaryGeneratedColumn, + ManyToOne, + JoinColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + DeleteDateColumn, +} from "typeorm"; +import { Room } from "./room"; + +@Entity("room_to_pharmacy") +export class RoomToPharmacy { + @PrimaryGeneratedColumn("uuid") + id!: string; + + // Room asal + @ManyToOne(() => Room, { nullable: false }) + @JoinColumn({ name: "room_id" }) + room!: Room; + + // Room tujuan + @ManyToOne(() => Room, { nullable: false }) + @JoinColumn({ name: "pharmacy_room_id" }) + pharmacy_room!: Room; + + @CreateDateColumn() + created_at!: Date; + + @Column({ nullable: true, length: 256 }) + created_by?: string; + + @UpdateDateColumn({ nullable: true }) + updated_at?: Date; + + @Column({ nullable: true, length: 256 }) + updated_by?: string; + + @DeleteDateColumn({ nullable: true }) + deleted_at?: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by?: string; +} \ No newline at end of file diff --git a/src/schema/public.ts b/src/schema/public.ts index c5cef7f..8b92435 100644 --- a/src/schema/public.ts +++ b/src/schema/public.ts @@ -34,6 +34,7 @@ export * from "../entity/patient_group" export * from "../entity/patient_guarantor" export * from "../entity/user_to_room" export * from "../entity/refferal_hospital" +export * from "../entity/room_to_pharmacy" export * from "../types/action"; export * from "../types/error"; @@ -42,3 +43,4 @@ export * from "../types/role"; export * from "../types/status"; export * from "../types/email"; export * from "../types/telegram"; +