hrms-api-org/src/entities/ProfileSalary.ts

83 lines
1.5 KiB
TypeScript
Raw Normal View History

2024-02-23 14:19:39 +07:00
import { Entity, Column, OneToMany, OneToOne, JoinColumn, ManyToMany, ManyToOne, Double } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile" ;
@Entity("profileSalary")
export class ProfileSalary extends EntityBase {
@Column({
comment: "วันที่",
type: "datetime",
nullable: true,
})
date: Date;
@Column({
comment: "เงินเดือนฐาน",
default: 0,
nullable: true,
type: "double"
})
amount: Double;
@Column({
comment: "เงินประจำตำแหน่ง",
default: 0,
nullable: true,
type: "double"
})
positionSalaryAmount: Double;
@Column({
comment: "เงินค่าตอบแทนรายเดือน",
default: 0,
nullable: true,
type: "double"
})
mouthSalaryAmount: Double;
@Column({
length: 40,
comment: "ไอดีโปรไฟล์",
})
profileId: string;
@ManyToOne(() => Profile, (profile) => profile.profileSalary)
@JoinColumn({ name: "profileId" })
profile: Profile;
}
// export class CreateProfileSalary {
// @Column()
// date: Date;
// @Column()
// amount: Double;
// @Column()
// positionSalaryAmount: Double;
// @Column()
// mouthSalaryAmount: Double;
// }
// export class UpdateProfileSalary {
// @Column()
// date: Date;
// @Column()
// amount: Double;
// @Column()
// positionSalaryAmount: Double;
// @Column()
// mouthSalaryAmount: Double;
// }