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