hrms-api-org/src/entities/Relationship.ts
2024-03-21 11:28:02 +07:00

28 lines
675 B
TypeScript

import { Entity, Column, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
@Entity("relationship")
export class Relationship extends EntityBase {
@Column({
nullable: true,
comment: "สถานภาพ",
length: 255,
default: null,
})
name: string;
@OneToMany(() => Profile, (v) => v.relationship)
profile: Profile[];
@OneToMany(() => ProfileEmployee, (v) => v.relationship)
profileEmployee: ProfileEmployee[];
}
export class CreateRelationship {
name: string;
}
export type UpdateRelationship = Partial<CreateRelationship>;