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

28 lines
632 B
TypeScript

import { Entity, Column, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
@Entity("gender")
export class Gender extends EntityBase {
@Column({
nullable: true,
comment: "เพศ",
length: 255,
default: null,
})
name: string;
@OneToMany(() => Profile, (v) => v.gender)
profile: Profile[];
@OneToMany(() => ProfileEmployee, (v) => v.gender)
profileEmployee: ProfileEmployee[];
}
export class CreateGender {
@Column()
name: string;
}
export type UpdateGender = Partial<CreateGender>;