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

28 lines
673 B
TypeScript

import { Entity, Column, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
@Entity("bloodGroup")
export class BloodGroup extends EntityBase {
@Column({
nullable: true,
comment: "กรุ๊ปเลือด",
length: 255,
default: null,
})
name: string;
@OneToMany(() => Profile, (v) => v.bloodGroup)
profile: Profile[];
@OneToMany(() => Profile, (v) => v.bloodGroup)
profileEmployee: ProfileEmployee[];
}
export class CreateBloodGroup {
@Column()
name: string;
}
export type UpdateBloodGroup = Partial<CreateBloodGroup>;