hrms-api-org/src/entities/BloodGroup.ts
2024-03-20 09:09:42 +07:00

25 lines
625 B
TypeScript

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