fix: เเก้ รับ date null

This commit is contained in:
Net 2024-03-18 17:23:59 +07:00
parent 9b0a5e9194
commit 169fada8ae
5 changed files with 80 additions and 106 deletions

View file

@ -18,7 +18,7 @@ export class ProfileAbility extends EntityBase {
default: false, default: false,
}) })
isActive: boolean; isActive: boolean;
@Column({ @Column({
nullable: true, nullable: true,
comment: "หมายเหตุ", comment: "หมายเหตุ",
@ -67,7 +67,10 @@ export class ProfileAbility extends EntityBase {
}) })
field: string; field: string;
@OneToMany(() => ProfileAbilityHistory, (profileAbilityHistory) => profileAbilityHistory.histories) @OneToMany(
() => ProfileAbilityHistory,
(profileAbilityHistory) => profileAbilityHistory.histories,
)
profileAbilityHistorys: ProfileAbilityHistory[]; profileAbilityHistorys: ProfileAbilityHistory[];
@ManyToOne(() => Profile, (profile) => profile.profileAbilities) @ManyToOne(() => Profile, (profile) => profile.profileAbilities)
@ -76,29 +79,23 @@ export class ProfileAbility extends EntityBase {
} }
export class CreateProfileAbility { export class CreateProfileAbility {
@Column("uuid")
profileId: string | null; profileId: string | null;
@Column()
isActive: boolean; isActive: boolean;
@Column()
remark: string | null; remark: string | null;
@Column()
detail: string | null; detail: string | null;
@Column()
reference: string | null; reference: string | null;
@Column()
dateStart: Date | null; dateStart: Date | null;
@Column()
dateEnd: Date | null; dateEnd: Date | null;
@Column()
field: string | null; field: string | null;
} }
export type UpdateProfileAbility = Partial<CreateProfileAbility>; export type UpdateProfileAbility = {
profileId: string | null;
isActive: boolean;
remark: string | null;
detail: string | null;
reference: string | null;
dateStart?: Date | null;
dateEnd?: Date | null;
field: string | null;
};

View file

@ -22,11 +22,11 @@ export class ProfileAssessment extends EntityBase {
@Column({ @Column({
nullable: true, nullable: true,
comment: "ชื่อแบบประเมิน", comment: "ชื่อแบบประเมิน",
type: "text", type: "text",
default: null, default: null,
}) })
name: string; name: string;
@Column({ @Column({
nullable: true, nullable: true,
type: "datetime", type: "datetime",
@ -83,7 +83,10 @@ export class ProfileAssessment extends EntityBase {
}) })
pointSumTotal: number; pointSumTotal: number;
@OneToMany(() => ProfileAssessmentHistory, (profileAssessmentHistory) => profileAssessmentHistory.histories) @OneToMany(
() => ProfileAssessmentHistory,
(profileAssessmentHistory) => profileAssessmentHistory.histories,
)
profileAssessmentHistorys: ProfileAssessmentHistory[]; profileAssessmentHistorys: ProfileAssessmentHistory[];
@ManyToOne(() => Profile, (profile) => profile.profileAssessments) @ManyToOne(() => Profile, (profile) => profile.profileAssessments)
@ -92,35 +95,27 @@ export class ProfileAssessment extends EntityBase {
} }
export class CreateProfileAssessment { export class CreateProfileAssessment {
@Column("uuid")
profileId: string | null; profileId: string | null;
@Column()
isActive: boolean; isActive: boolean;
@Column()
name: string | null; name: string | null;
@Column()
date: Date | null; date: Date | null;
@Column()
point1: number | null; point1: number | null;
@Column()
point1Total: number | null; point1Total: number | null;
@Column()
point2: number | null; point2: number | null;
@Column()
point2Total: number | null; point2Total: number | null;
@Column()
pointSum: number | null; pointSum: number | null;
@Column()
pointSumTotal: number | null; pointSumTotal: number | null;
} }
export type UpdateProfileAssessment = Partial<CreateProfileAssessment>; export type UpdateProfileAssessment = {
profileId: string | null;
isActive: boolean;
name: string | null;
date?: Date | null;
point1: number | null;
point1Total: number | null;
point2: number | null;
point2Total: number | null;
pointSum: number | null;
pointSumTotal: number | null;
};

View file

@ -41,7 +41,7 @@ export class ProfileDiscipline extends EntityBase {
default: null, default: null,
}) })
detail: string; detail: string;
@Column({ @Column({
nullable: true, nullable: true,
type: "datetime", type: "datetime",
@ -66,7 +66,10 @@ export class ProfileDiscipline extends EntityBase {
}) })
unStigma: string; unStigma: string;
@OneToMany(() => ProfileDisciplineHistory, (profileDisciplineHistory) => profileDisciplineHistory.histories) @OneToMany(
() => ProfileDisciplineHistory,
(profileDisciplineHistory) => profileDisciplineHistory.histories,
)
profileDisciplineHistories: ProfileDisciplineHistory[]; profileDisciplineHistories: ProfileDisciplineHistory[];
@ManyToOne(() => Profile, (profile) => profile.profileDiscipline) @ManyToOne(() => Profile, (profile) => profile.profileDiscipline)
@ -75,30 +78,23 @@ export class ProfileDiscipline extends EntityBase {
} }
export class CreateProfileDiscipline { export class CreateProfileDiscipline {
@Column()
date: Date | null; date: Date | null;
@Column()
profileId: string; profileId: string;
@Column()
isActive: boolean | null; isActive: boolean | null;
level: string | null;
@Column()
level: string | null;
@Column()
detail: string | null; detail: string | null;
@Column()
refCommandDate: Date | null; refCommandDate: Date | null;
@Column()
refCommandNo: string | null; refCommandNo: string | null;
@Column()
unStigma: string | null; unStigma: string | null;
} }
export type UpdateProfileDiscipline = Partial<CreateProfileDiscipline>; export type UpdateProfileDiscipline = {
date?: Date | null;
profileId: string;
isActive: boolean | null;
level: string | null;
detail: string | null;
refCommandDate?: Date | null;
refCommandNo: string | null;
unStigma: string | null;
};

View file

@ -76,29 +76,23 @@ export class ProfileDuty extends EntityBase {
} }
export class CreateProfileDuty { export class CreateProfileDuty {
@Column("uuid")
profileId: string | null; profileId: string | null;
@Column()
isActive: boolean; isActive: boolean;
@Column()
dateStart: Date | null; dateStart: Date | null;
@Column()
dateEnd: Date | null; dateEnd: Date | null;
@Column()
detail: string | null; detail: string | null;
@Column()
reference: string | null; reference: string | null;
@Column()
refCommandDate: Date | null; refCommandDate: Date | null;
@Column()
refCommandNo: string | null; refCommandNo: string | null;
} }
export type UpdateProfileDuty = Partial<CreateProfileDuty>; export type UpdateProfileDuty = {
profileId: string | null;
isActive: boolean;
dateStart?: Date | null;
dateEnd?: Date | null;
detail: string | null;
reference: string | null;
refCommandDate?: Date | null;
refCommandNo: string | null;
};

View file

@ -104,8 +104,11 @@ export class ProfileTraining extends EntityBase {
default: null, default: null,
}) })
isDate: boolean; isDate: boolean;
@OneToMany(() => ProfileTrainingHistory, (profileTrainingHistory) => profileTrainingHistory.histories) @OneToMany(
() => ProfileTrainingHistory,
(profileTrainingHistory) => profileTrainingHistory.histories,
)
profileTrainingHistories: ProfileTrainingHistory[]; profileTrainingHistories: ProfileTrainingHistory[];
@ManyToOne(() => Profile, (profile) => profile.profileTrainings) @ManyToOne(() => Profile, (profile) => profile.profileTrainings)
@ -114,44 +117,33 @@ export class ProfileTraining extends EntityBase {
} }
export class CreateProfileTraining { export class CreateProfileTraining {
@Column("uuid")
profileId: string | null; profileId: string | null;
@Column()
isActive: boolean; isActive: boolean;
@Column()
startDate: Date | null; startDate: Date | null;
@Column()
endDate: Date | null; endDate: Date | null;
numberOrder: string | null;
@Column()
numberOrder: string | null;
@Column()
topic: string | null; topic: string | null;
@Column()
place: string | null; place: string | null;
@Column()
dateOrder: Date | null; dateOrder: Date | null;
@Column()
department: string | null; department: string | null;
@Column()
duration: string | null; duration: string | null;
@Column()
name: string | null; name: string | null;
@Column()
yearly: number | null; yearly: number | null;
@Column()
isDate: boolean | null; isDate: boolean | null;
} }
export type UpdateProfileTraining = Partial<CreateProfileTraining>; export type UpdateProfileTraining = {
profileId: string | null;
isActive: boolean;
startDate?: Date | null;
endDate?: Date | null;
numberOrder: string | null;
topic: string | null;
place: string | null;
dateOrder?: Date | null;
department: string | null;
duration: string | null;
name: string | null;
yearly: number | null;
isDate: boolean | null;
};