28 lines
673 B
TypeScript
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>;
|