21 lines
457 B
TypeScript
21 lines
457 B
TypeScript
import { BaseEntity } from 'src/common/entities/base.entity';
|
|
import { Complaint } from 'src/complaint/entities/complaint.entity';
|
|
import { Column, Entity, OneToMany } from 'typeorm';
|
|
|
|
@Entity('organs')
|
|
export class Organ extends BaseEntity {
|
|
@Column({
|
|
type: 'varchar',
|
|
length: 50,
|
|
})
|
|
name: string;
|
|
|
|
@Column({
|
|
type: 'text',
|
|
})
|
|
logo: string;
|
|
|
|
@OneToMany(() => Complaint, (complaint) => complaint.organ)
|
|
complaints: Complaint[];
|
|
}
|