upd
This commit is contained in:
42
src/entity/department.ts
Normal file
42
src/entity/department.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||||
|
|
||||||
|
import { Status } from "../types/status";
|
||||||
|
|
||||||
|
@Entity("departments")
|
||||||
|
export class Department {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 128,
|
||||||
|
})
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
status: Status;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
created_by: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by: string;
|
||||||
|
}
|
||||||
68
src/entity/doctor_schedule.ts
Normal file
68
src/entity/doctor_schedule.ts
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||||
|
|
||||||
|
import { Status } from "../types/status";
|
||||||
|
import { Room } from "./room";
|
||||||
|
|
||||||
|
@Entity("doctor_schedules")
|
||||||
|
export class DoctorSchedule {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 32,
|
||||||
|
})
|
||||||
|
day: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 16,
|
||||||
|
})
|
||||||
|
start_time: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 16,
|
||||||
|
})
|
||||||
|
end_time: string;
|
||||||
|
|
||||||
|
@Column({ type: "uuid", nullable: false })
|
||||||
|
doctor_id: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => Room, { onDelete: "NO ACTION" })
|
||||||
|
@JoinColumn()
|
||||||
|
room: Room;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
length: 32,
|
||||||
|
})
|
||||||
|
quota: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 64,
|
||||||
|
})
|
||||||
|
status: Status;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
created_by: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@UpdateDateColumn()
|
||||||
|
updated_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
@DeleteDateColumn()
|
||||||
|
deleted_at: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by: string;
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@ import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateCol
|
|||||||
|
|
||||||
import { Status } from "../types/status";
|
import { Status } from "../types/status";
|
||||||
import { Poli } from "./poli";
|
import { Poli } from "./poli";
|
||||||
|
import { Department } from "./department";
|
||||||
import { Service } from "./service";
|
import { Service } from "./service";
|
||||||
|
|
||||||
@Entity("rooms")
|
@Entity("rooms")
|
||||||
@ -27,10 +28,14 @@ export class Room {
|
|||||||
})
|
})
|
||||||
description: string;
|
description: string;
|
||||||
|
|
||||||
@ManyToOne(() => Poli, { onDelete: "RESTRICT", nullable: false })
|
@ManyToOne(() => Poli, { onDelete: "RESTRICT", nullable: true })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
poli: Poli;
|
poli: Poli;
|
||||||
|
|
||||||
|
@ManyToOne(() => Department, { onDelete: "NO ACTION", nullable: true })
|
||||||
|
@JoinColumn()
|
||||||
|
department: Department;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
nullable: false,
|
||||||
length: 64,
|
length: 64,
|
||||||
|
|||||||
@ -19,6 +19,8 @@ export * from "../entity/service_class"
|
|||||||
export * from "../entity/service"
|
export * from "../entity/service"
|
||||||
export * from "../entity/service_fare"
|
export * from "../entity/service_fare"
|
||||||
export * from "../entity/service_package"
|
export * from "../entity/service_package"
|
||||||
|
export * from "../entity/department"
|
||||||
|
export * from "../entity/doctor_schedule"
|
||||||
|
|
||||||
export * from "../types/action";
|
export * from "../types/action";
|
||||||
export * from "../types/error";
|
export * from "../types/error";
|
||||||
|
|||||||
Reference in New Issue
Block a user