Merge branch 'main' of https://git.shiblysolution.id/SAUDE-TL/entity
This commit is contained in:
@ -9,18 +9,23 @@ import {
|
||||
JoinColumn,
|
||||
ManyToMany,
|
||||
JoinTable,
|
||||
OneToMany,
|
||||
} from 'typeorm';
|
||||
|
||||
import { ServiceType } from './service_type';
|
||||
import { Room } from './room';
|
||||
import { ExaminationDetail } from './examination_detail';
|
||||
import { Status } from '../types/status';
|
||||
import { ServiceFare } from './service_fare';
|
||||
|
||||
@Entity('services')
|
||||
export class Service {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@OneToMany(() => ServiceFare, (servicefare) => servicefare.service)
|
||||
servicefare: ServiceFare;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
@ -37,25 +42,25 @@ export class Service {
|
||||
@JoinColumn()
|
||||
serviceType: ServiceType;
|
||||
|
||||
@ManyToMany(() => Room, (room) => room.services)
|
||||
@JoinTable({
|
||||
name: 'service_rooms',
|
||||
joinColumn: { name: 'service_id', referencedColumnName: 'id' },
|
||||
inverseJoinColumn: { name: 'room_id', referencedColumnName: 'id' },
|
||||
})
|
||||
rooms: Room[];
|
||||
@ManyToMany(() => Room, (room) => room.services)
|
||||
@JoinTable({
|
||||
name: 'service_rooms',
|
||||
joinColumn: { name: 'service_id', referencedColumnName: 'id' },
|
||||
inverseJoinColumn: { name: 'room_id', referencedColumnName: 'id' },
|
||||
})
|
||||
rooms: Room[];
|
||||
|
||||
@ManyToMany(() => ExaminationDetail, { onDelete: 'NO ACTION' })
|
||||
@JoinTable({
|
||||
name: 'service_examinations',
|
||||
joinColumn: { name: 'service_id', referencedColumnName: 'id' },
|
||||
inverseJoinColumn: { name: 'examination_detail_id', referencedColumnName: 'id' },
|
||||
})
|
||||
examination_details: ExaminationDetail[];
|
||||
@ManyToMany(() => ExaminationDetail, { onDelete: 'NO ACTION' })
|
||||
@JoinTable({
|
||||
name: 'service_examinations',
|
||||
joinColumn: { name: 'service_id', referencedColumnName: 'id' },
|
||||
inverseJoinColumn: { name: 'examination_detail_id', referencedColumnName: 'id' },
|
||||
})
|
||||
examination_details: ExaminationDetail[];
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
Reference in New Issue
Block a user