fix entity and store dateRetire

This commit is contained in:
AdisakKanthawilang 2024-05-15 18:06:28 +07:00
parent 0df3191fcc
commit cf3c3feba2
4 changed files with 11 additions and 1 deletions

View file

@ -241,8 +241,11 @@ export class ProfileController extends Controller {
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.dateRetire = calculateRetireDate(profile.birthDate);
profile.dateRetireLaw = calculateRetireDate(profile.birthDate);
await this.profileRepo.save(profile);
return new HttpSuccess();
}
@ -379,7 +382,8 @@ export class ProfileController extends Controller {
Object.assign(record, body);
record.lastUpdateUserId = request.user.sub;
record.lastUpdateFullName = request.user.name;
record.dateRetire = calculateRetireDate(record.birthDate);
record.dateRetireLaw = calculateRetireDate(record.birthDate);
await this.profileRepo.save(record);
return new HttpSuccess();

View file

@ -114,6 +114,8 @@ export class ProfileEmployeeController extends Controller {
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.dateRetire = calculateRetireDate(profile.birthDate);
profile.dateRetireLaw = calculateRetireDate(profile.birthDate);
await this.profileRepo.save(profile);
return new HttpSuccess();
@ -202,6 +204,8 @@ export class ProfileEmployeeController extends Controller {
Object.assign(record, body);
record.lastUpdateUserId = request.user.sub;
record.lastUpdateFullName = request.user.name;
record.dateRetire = calculateRetireDate(record.birthDate);
record.dateRetireLaw = calculateRetireDate(record.birthDate);
await this.profileRepo.save(record);

View file

@ -40,6 +40,7 @@ export class ProfileEducation extends EntityBase {
@Column({
comment: "ระยะเวลาหลักสูตร",
nullable: true,
})
durationYear: number;

View file

@ -31,6 +31,7 @@ export class ProfileEducationHistory extends EntityBase {
@Column({
comment: "ระยะเวลาหลักสูตร",
nullable: true,
})
durationYear: number;