fix entity and store dateRetire
This commit is contained in:
parent
0df3191fcc
commit
cf3c3feba2
4 changed files with 11 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ export class ProfileEducation extends EntityBase {
|
|||
|
||||
@Column({
|
||||
comment: "ระยะเวลาหลักสูตร",
|
||||
nullable: true,
|
||||
})
|
||||
durationYear: number;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ export class ProfileEducationHistory extends EntityBase {
|
|||
|
||||
@Column({
|
||||
comment: "ระยะเวลาหลักสูตร",
|
||||
nullable: true,
|
||||
})
|
||||
durationYear: number;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue