เพิ่มวันที่แก้ไข

This commit is contained in:
kittapath 2024-08-30 21:02:14 +07:00
parent 218886b3f4
commit ad4efc2b47
28 changed files with 205 additions and 40 deletions

View file

@ -1268,6 +1268,8 @@ export class ProfileController extends Controller {
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date();
profile.lastUpdatedAt = new Date();
profile.dateRetire = calculateRetireDate(profile.birthDate);
profile.dateRetireLaw = calculateRetireLaw(profile.birthDate);
await this.profileRepo.save(profile);
@ -1310,6 +1312,8 @@ export class ProfileController extends Controller {
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date();
profile.lastUpdatedAt = new Date();
await this.profileRepo.save(profile);
return new HttpSuccess(profile.id);
}
@ -1346,6 +1350,8 @@ export class ProfileController extends Controller {
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date();
profile.lastUpdatedAt = new Date();
await this.profileRepo.save(profile);
return new HttpSuccess(profile.id);
}
@ -1386,6 +1392,7 @@ export class ProfileController extends Controller {
profile.isProbation = false;
profile.lastUpdateUserId = req.user.sub;
profile.lastUpdateFullName = req.user.name;
profile.lastUpdatedAt = new Date();
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
profileId: body.profileId,
date: body.date,
@ -1470,6 +1477,7 @@ export class ProfileController extends Controller {
_profile.dateLeave = dateLeave_;
_profile.lastUpdateUserId = req.user.sub;
_profile.lastUpdateFullName = req.user.name;
_profile.lastUpdatedAt = new Date();
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
profileId: body.profileId,
date: body.date,
@ -1550,6 +1558,7 @@ export class ProfileController extends Controller {
_profile.dateLeave = dateLeave_;
_profile.lastUpdateUserId = req.user.sub;
_profile.lastUpdateFullName = req.user.name;
_profile.lastUpdatedAt = new Date();
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
profileId: body.profileId,
date: body.date,
@ -1630,6 +1639,7 @@ export class ProfileController extends Controller {
_profile.dateLeave = dateLeave_;
_profile.lastUpdateUserId = req.user.sub;
_profile.lastUpdateFullName = req.user.name;
_profile.lastUpdatedAt = new Date();
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
profileId: body.profileId,
date: body.date,
@ -1726,6 +1736,7 @@ export class ProfileController extends Controller {
_profile.dateLeave = dateLeave_;
_profile.lastUpdateUserId = req.user.sub;
_profile.lastUpdateFullName = req.user.name;
_profile.lastUpdatedAt = new Date();
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
profileId: body.profileId,
date: body.date,
@ -2245,6 +2256,7 @@ export class ProfileController extends Controller {
profile.dateLeave = null_;
profile.lastUpdateUserId = req.user.sub;
profile.lastUpdateFullName = req.user.name;
profile.lastUpdatedAt = new Date();
// const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
// profileId: body.profileId,
// date: body.date,
@ -2387,6 +2399,7 @@ export class ProfileController extends Controller {
Object.assign(record, body);
record.lastUpdateUserId = request.user.sub;
record.lastUpdateFullName = request.user.name;
record.lastUpdatedAt = new Date();
record.dateRetire = calculateRetireDate(record.birthDate);
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
await this.profileRepo.save(record);
@ -5487,6 +5500,8 @@ export class ProfileController extends Controller {
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date();
profile.lastUpdatedAt = new Date();
// return new HttpSuccess(profile);
await this.profileRepo.save(profile);
return new HttpSuccess(profile.id);