migrate db profie

This commit is contained in:
Kittapath 2024-03-13 10:52:28 +07:00
parent a94316e781
commit 637a01deab
3 changed files with 232 additions and 123 deletions

View file

@ -1,6 +1,15 @@
import { Entity, Column, OneToMany, OneToOne, JoinColumn, ManyToMany, ManyToOne, Double } from "typeorm";
import {
Entity,
Column,
OneToMany,
OneToOne,
JoinColumn,
ManyToMany,
ManyToOne,
Double,
} from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile" ;
import { Profile } from "./Profile";
import { ProfileSalaryHistory } from "./ProfileSalaryHistory";
@Entity("profileSalary")
@ -16,7 +25,7 @@ export class ProfileSalary extends EntityBase {
comment: "เงินเดือนฐาน",
default: 0,
nullable: true,
type: "double"
type: "double",
})
amount: Double;
@ -24,7 +33,7 @@ export class ProfileSalary extends EntityBase {
comment: "เงินประจำตำแหน่ง",
default: 0,
nullable: true,
type: "double"
type: "double",
})
positionSalaryAmount: Double;
@ -32,14 +41,14 @@ export class ProfileSalary extends EntityBase {
comment: "เงินค่าตอบแทนรายเดือน",
default: 0,
nullable: true,
type: "double"
type: "double",
})
mouthSalaryAmount: Double;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง profile",
type: "uuid"
type: "uuid",
})
profileId: string;
@ -99,7 +108,7 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionExecutiveId : string;
positionExecutiveId: string;
@Column({
nullable: true,
@ -108,7 +117,7 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionExecutiveSideId : string;
positionExecutiveSideId: string;
@Column({
nullable: true,
@ -117,8 +126,8 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionLevelId : string;
positionLevelId: string;
@Column({
nullable: true,
length: 40,
@ -126,8 +135,8 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionLineId : string;
positionLineId: string;
@Column({
nullable: true,
length: 40,
@ -135,8 +144,8 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionPathSideId : string;
positionPathSideId: string;
@Column({
nullable: true,
length: 40,
@ -144,8 +153,8 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionTypeId : string;
positionTypeId: string;
@Column({
nullable: true,
length: 40,
@ -153,8 +162,8 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
organizationShortNameId : string;
organizationShortNameId: string;
@Column({
nullable: true,
length: 40,
@ -162,8 +171,8 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionEmployeeGroupId : string;
positionEmployeeGroupId: string;
@Column({
nullable: true,
length: 40,
@ -171,8 +180,8 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionEmployeeLevelId : string;
positionEmployeeLevelId: string;
@Column({
nullable: true,
length: 40,
@ -180,8 +189,8 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionEmployeePositionId : string;
positionEmployeePositionId: string;
@Column({
nullable: true,
length: 40,
@ -189,16 +198,15 @@ export class ProfileSalary extends EntityBase {
type: "uuid",
default: null,
})
positionEmployeePositionSideId : string;
positionEmployeePositionSideId: string;
@Column({
nullable: true,
length: 40,
comment: "Id เลขที่ตำแหน่งลูกจ้าง",
type: "text",
default: null,
})
posNoEmployee : string;
posNoEmployee: string;
@Column({
nullable: true,
@ -249,33 +257,31 @@ export class ProfileSalary extends EntityBase {
@ManyToOne(() => Profile, (profile) => profile.profileSalary)
@JoinColumn({ name: "profileId" })
profile: Profile;
}
export class CreateProfileSalary {
@Column({
type: "datetime"
type: "datetime",
})
date: Date;
@Column({
type: "double"
type: "double",
})
amount: Double;
@Column({
type: "double"
type: "double",
})
positionSalaryAmount: Double;
@Column({
type: "double"
type: "double",
})
mouthSalaryAmount: Double;
@Column({
type: "uuid"
type: "uuid",
})
profileId: string;
@ -304,29 +310,29 @@ export class CreateProfileSalary {
// positionExecutiveSideId : string | null;
// @Column("uuid")
// positionLevelId : string | null;
// positionLevelId : string | null;
// @Column("uuid")
// positionLineId : string | null;
// @Column("uuid")
// positionPathSideId : string | null;
// @Column("uuid")
// positionTypeId : string | null;
// @Column("uuid")
// organizationShortNameId : string | null;
// @Column("uuid")
// positionEmployeeGroupId : string | null;
// @Column("uuid")
// positionEmployeeLevelId : string | null;
// @Column("uuid")
// positionEmployeePositionId : string | null;
// @Column("uuid")
// positionEmployeePositionSideId : string | null;
@ -350,32 +356,30 @@ export class CreateProfileSalary {
// @Column()
// salaryStatus: string | null;
}
export class UpdateProfileSalary {
@Column({
type: "datetime"
type: "datetime",
})
date: Date;
@Column({
type: "double"
type: "double",
})
amount: Double;
@Column({
type: "double"
type: "double",
})
positionSalaryAmount: Double;
@Column({
type: "double"
type: "double",
})
mouthSalaryAmount: Double;
// @Column()
// @Column()
// isActive: boolean;
// @Column()
@ -400,29 +404,29 @@ export class UpdateProfileSalary {
// positionExecutiveSideId : string | null;
// @Column("uuid")
// positionLevelId : string | null;
// positionLevelId : string | null;
// @Column("uuid")
// positionLineId : string | null;
// @Column("uuid")
// positionPathSideId : string | null;
// @Column("uuid")
// positionTypeId : string | null;
// @Column("uuid")
// organizationShortNameId : string | null;
// @Column("uuid")
// positionEmployeeGroupId : string | null;
// @Column("uuid")
// positionEmployeeLevelId : string | null;
// @Column("uuid")
// positionEmployeePositionId : string | null;
// @Column("uuid")
// positionEmployeePositionSideId : string | null;
@ -446,6 +450,4 @@ export class UpdateProfileSalary {
// @Column()
// salaryStatus: string | null;
}