no message
This commit is contained in:
parent
25b5d58f2a
commit
53787597fd
54 changed files with 219 additions and 332 deletions
|
|
@ -153,13 +153,11 @@ export class ProfileAbilityController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileAbilityHistory();
|
||||
history.profileAbilityId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileAbilityRepo.save(data),
|
||||
(history.profileAbilityId = data.id),
|
||||
this.profileAbilityHistoryRepo.save(history),
|
||||
]);
|
||||
await this.profileAbilityRepo.save(data);
|
||||
history.profileAbilityId = data.id;
|
||||
await this.profileAbilityHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,13 +155,11 @@ export class ProfileAbilityEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileAbilityHistory();
|
||||
history.profileAbilityId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileAbilityRepo.save(data),
|
||||
(history.profileAbilityId = data.id),
|
||||
this.profileAbilityHistoryRepo.save(history),
|
||||
]);
|
||||
await this.profileAbilityRepo.save(data);
|
||||
history.profileAbilityId = data.id;
|
||||
await this.profileAbilityHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,13 +155,11 @@ export class ProfileAbilityEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileAbilityHistory();
|
||||
history.profileAbilityId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileAbilityRepo.save(data),
|
||||
(history.profileAbilityId = data.id),
|
||||
this.profileAbilityHistoryRepo.save(history),
|
||||
]);
|
||||
await this.profileAbilityRepo.save(data);
|
||||
history.profileAbilityId = data.id;
|
||||
await this.profileAbilityHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,13 +165,11 @@ export class ProfileAssessmentsController extends Controller {
|
|||
};
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileAssessmentHistory();
|
||||
history.profileAssessmentId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileAssessmentsRepository.save(data),
|
||||
(history.profileAssessmentId = data.id),
|
||||
this.profileAssessmentsHistoryRepository.save(history),
|
||||
]);
|
||||
await this.profileAssessmentsRepository.save(data);
|
||||
history.profileAssessmentId = data.id;
|
||||
await this.profileAssessmentsHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,13 +167,11 @@ export class ProfileAssessmentsEmployeeController extends Controller {
|
|||
};
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileAssessmentHistory();
|
||||
history.profileAssessmentId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileAssessmentsRepository.save(data),
|
||||
(history.profileAssessmentId = data.id),
|
||||
this.profileAssessmentsHistoryRepository.save(history),
|
||||
]);
|
||||
await this.profileAssessmentsRepository.save(data);
|
||||
history.profileAssessmentId = data.id;
|
||||
await this.profileAssessmentsHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,13 +167,11 @@ export class ProfileAssessmentsEmployeeTempController extends Controller {
|
|||
};
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileAssessmentHistory();
|
||||
history.profileAssessmentId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileAssessmentsRepository.save(data),
|
||||
(history.profileAssessmentId = data.id),
|
||||
this.profileAssessmentsHistoryRepository.save(history),
|
||||
]);
|
||||
await this.profileAssessmentsRepository.save(data);
|
||||
history.profileAssessmentId = data.id;
|
||||
await this.profileAssessmentsHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,13 +143,11 @@ export class ProfileCertificateController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileCertificateHistory();
|
||||
history.profileCertificateId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.certificateRepo.save(data),
|
||||
(history.profileCertificateId = data.id),
|
||||
this.certificateHistoryRepo.save(history),
|
||||
]);
|
||||
await this.certificateRepo.save(data);
|
||||
history.profileCertificateId = data.id;
|
||||
await this.certificateHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,13 +143,11 @@ export class ProfileCertificateEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileCertificateHistory();
|
||||
history.profileCertificateId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.certificateRepo.save(data),
|
||||
(history.profileCertificateId = data.id),
|
||||
this.certificateHistoryRepo.save(history),
|
||||
]);
|
||||
await this.certificateRepo.save(data);
|
||||
history.profileCertificateId = data.id;
|
||||
await this.certificateHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,13 +143,11 @@ export class ProfileCertificateEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileCertificateHistory();
|
||||
history.profileCertificateId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.certificateRepo.save(data),
|
||||
(history.profileCertificateId = data.id),
|
||||
this.certificateHistoryRepo.save(history),
|
||||
]);
|
||||
await this.certificateRepo.save(data);
|
||||
history.profileCertificateId = data.id;
|
||||
await this.certificateHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,13 +141,11 @@ export class ProfileChangeNameController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileChangeNameHistory();
|
||||
history.profileChangeNameId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.changeNameRepository.save(data),
|
||||
(history.profileChangeNameId = data.id),
|
||||
this.changeNameHistoryRepository.save(history),
|
||||
]);
|
||||
await this.changeNameRepository.save(data);
|
||||
history.profileChangeNameId = data.id;
|
||||
await this.changeNameHistoryRepository.save(history);
|
||||
|
||||
profile.firstName = body.firstName ?? profile.firstName;
|
||||
profile.lastName = body.lastName ?? profile.lastName;
|
||||
|
|
|
|||
|
|
@ -142,13 +142,11 @@ export class ProfileChangeNameEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileChangeNameHistory();
|
||||
history.profileChangeNameId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.changeNameRepository.save(data),
|
||||
(history.profileChangeNameId = data.id),
|
||||
this.changeNameHistoryRepository.save(history),
|
||||
]);
|
||||
await this.changeNameRepository.save(data);
|
||||
history.profileChangeNameId = data.id;
|
||||
await this.changeNameHistoryRepository.save(history);
|
||||
|
||||
profile.firstName = body.firstName ?? profile.firstName;
|
||||
profile.lastName = body.lastName ?? profile.lastName;
|
||||
|
|
|
|||
|
|
@ -142,13 +142,11 @@ export class ProfileChangeNameEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileChangeNameHistory();
|
||||
history.profileChangeNameId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.changeNameRepository.save(data),
|
||||
(history.profileChangeNameId = data.id),
|
||||
this.changeNameHistoryRepository.save(history),
|
||||
]);
|
||||
await this.changeNameRepository.save(data);
|
||||
history.profileChangeNameId = data.id;
|
||||
await this.changeNameHistoryRepository.save(history);
|
||||
|
||||
profile.firstName = body.firstName ?? profile.firstName;
|
||||
profile.lastName = body.lastName ?? profile.lastName;
|
||||
|
|
|
|||
|
|
@ -84,13 +84,11 @@ export class ProfileChildrenController extends Controller {
|
|||
data.childrenCitizenId = Extension.CheckCitizen(String(data.childrenCitizenId));
|
||||
|
||||
const history = new ProfileChildrenHistory();
|
||||
history.profileChildrenId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.childrenRepository.save(data),
|
||||
(history.profileChildrenId = data.id),
|
||||
this.childrenHistoryRepository.save(history),
|
||||
]);
|
||||
await this.childrenRepository.save(data);
|
||||
history.profileChildrenId = data.id;
|
||||
await this.childrenHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,13 +90,11 @@ export class ProfileChildrenEmployeeController extends Controller {
|
|||
data.childrenCitizenId = Extension.CheckCitizen(String(data.childrenCitizenId));
|
||||
|
||||
const history = new ProfileChildrenHistory();
|
||||
history.profileChildrenId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.childrenRepository.save(data),
|
||||
(history.profileChildrenId = data.id),
|
||||
this.childrenHistoryRepository.save(history),
|
||||
]);
|
||||
await this.childrenRepository.save(data);
|
||||
history.profileChildrenId = data.id;
|
||||
await this.childrenHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,15 +88,12 @@ export class ProfileChildrenEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
data.childrenCitizenId = Extension.CheckCitizen(String(data.childrenCitizenId));
|
||||
|
||||
const history = new ProfileChildrenHistory();
|
||||
history.profileChildrenId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.childrenRepository.save(data),
|
||||
(history.profileChildrenId = data.id),
|
||||
this.childrenHistoryRepository.save(history),
|
||||
]);
|
||||
await this.childrenRepository.save(data);
|
||||
history.profileChildrenId = data.id;
|
||||
await this.childrenHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,15 +145,12 @@ export class ProfileDisciplineController extends Controller {
|
|||
};
|
||||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
|
||||
const history = new ProfileDisciplineHistory();
|
||||
history.profileDisciplineId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.disciplineRepository.save(data),
|
||||
(history.profileDisciplineId = data.id),
|
||||
this.disciplineHistoryRepository.save(history),
|
||||
]);
|
||||
await this.disciplineRepository.save(data);
|
||||
history.profileDisciplineId = data.id;
|
||||
await this.disciplineHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,15 +136,12 @@ export class ProfileDisciplineEmployeeController extends Controller {
|
|||
};
|
||||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
|
||||
const history = new ProfileDisciplineHistory();
|
||||
history.profileDisciplineId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.disciplineRepository.save(data),
|
||||
(history.profileDisciplineId = data.id),
|
||||
this.disciplineHistoryRepository.save(history),
|
||||
]);
|
||||
await this.disciplineRepository.save(data);
|
||||
history.profileDisciplineId = data.id;
|
||||
await this.disciplineHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,15 +136,12 @@ export class ProfileDisciplineEmployeeTempController extends Controller {
|
|||
};
|
||||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
|
||||
const history = new ProfileDisciplineHistory();
|
||||
history.profileDisciplineId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.disciplineRepository.save(data),
|
||||
(history.profileDisciplineId = data.id),
|
||||
this.disciplineHistoryRepository.save(history),
|
||||
]);
|
||||
await this.disciplineRepository.save(data);
|
||||
history.profileDisciplineId = data.id;
|
||||
await this.disciplineHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,13 +150,11 @@ export class ProfileDutyController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileDutyHistory();
|
||||
history.profileDutyId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.dutyRepository.save(data),
|
||||
(history.profileDutyId = data.id),
|
||||
this.dutyHistoryRepository.save(history),
|
||||
]);
|
||||
await this.dutyRepository.save(data);
|
||||
history.profileDutyId = data.id;
|
||||
await this.dutyHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,13 +111,11 @@ export class ProfileDutyEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileDutyHistory();
|
||||
history.profileDutyId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.dutyRepository.save(data),
|
||||
(history.profileDutyId = data.id),
|
||||
this.dutyHistoryRepository.save(history),
|
||||
]);
|
||||
await this.dutyRepository.save(data);
|
||||
history.profileDutyId = data.id;
|
||||
await this.dutyHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,13 +111,11 @@ export class ProfileDutyEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileDutyHistory();
|
||||
history.profileDutyId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.dutyRepository.save(data),
|
||||
(history.profileDutyId = data.id),
|
||||
this.dutyHistoryRepository.save(history),
|
||||
]);
|
||||
await this.dutyRepository.save(data);
|
||||
history.profileDutyId = data.id;
|
||||
await this.dutyHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,15 +200,12 @@ export class ProfileEducationsController extends Controller {
|
|||
};
|
||||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
|
||||
const history = new ProfileEducationHistory();
|
||||
history.profileEducationId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileEducationRepo.save(data),
|
||||
(history.profileEducationId = data.id),
|
||||
this.profileEducationHistoryRepo.save(history),
|
||||
]);
|
||||
await this.profileEducationRepo.save(data);
|
||||
history.profileEducationId = data.id;
|
||||
await this.profileEducationHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,13 +203,11 @@ export class ProfileEducationsEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileEducationHistory();
|
||||
history.profileEducationId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileEducationRepo.save(data),
|
||||
(history.profileEducationId = data.id),
|
||||
this.profileEducationHistoryRepo.save(history),
|
||||
]);
|
||||
await this.profileEducationRepo.save(data);
|
||||
history.profileEducationId = data.id;
|
||||
await this.profileEducationHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,13 +203,11 @@ export class ProfileEducationsEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileEducationHistory();
|
||||
history.profileEducationId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileEducationRepo.save(data),
|
||||
(history.profileEducationId = data.id),
|
||||
this.profileEducationHistoryRepo.save(history),
|
||||
]);
|
||||
await this.profileEducationRepo.save(data);
|
||||
history.profileEducationId = data.id;
|
||||
await this.profileEducationHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,14 +237,12 @@ export class ProfileFamilyCoupleController extends Controller {
|
|||
|
||||
profile.relationship = familyCouple.relationship; //update profileEmployee.relationship
|
||||
const history = new ProfileFamilyCoupleHistory();
|
||||
history.profileFamilyCoupleId = familyCouple.id;
|
||||
Object.assign(history, { ...familyCouple, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileRepo.save(profile),
|
||||
this.ProfileFamilyCouple.save(familyCouple),
|
||||
(history.profileFamilyCoupleId = familyCouple.id),
|
||||
this.ProfileFamilyCoupleHistory.save(history),
|
||||
]);
|
||||
await this.profileRepo.save(profile);
|
||||
await this.ProfileFamilyCouple.save(familyCouple);
|
||||
history.profileFamilyCoupleId = familyCouple.id;
|
||||
await this.ProfileFamilyCoupleHistory.save(history);
|
||||
|
||||
return new HttpSuccess(familyCouple.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,14 +237,12 @@ export class ProfileFamilyCoupleEmployeeController extends Controller {
|
|||
|
||||
profile.relationship = familyCouple.relationship; //update profileEmployee.relationship
|
||||
const history = new ProfileFamilyCoupleHistory();
|
||||
history.profileFamilyCoupleId = familyCouple.id;
|
||||
Object.assign(history, { ...familyCouple, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileRepo.save(profile),
|
||||
this.ProfileFamilyCouple.save(familyCouple),
|
||||
(history.profileFamilyCoupleId = familyCouple.id),
|
||||
this.ProfileFamilyCoupleHistory.save(history),
|
||||
]);
|
||||
await this.profileRepo.save(profile);
|
||||
await this.ProfileFamilyCouple.save(familyCouple);
|
||||
history.profileFamilyCoupleId = familyCouple.id;
|
||||
await this.ProfileFamilyCoupleHistory.save(history);
|
||||
|
||||
return new HttpSuccess(familyCouple.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,14 +238,12 @@ export class ProfileFamilyCoupleEmployeeTempController extends Controller {
|
|||
|
||||
profile.relationship = familyCouple.relationship; //update profileEmployee.relationship
|
||||
const history = new ProfileFamilyCoupleHistory();
|
||||
history.profileFamilyCoupleId = familyCouple.id;
|
||||
Object.assign(history, { ...familyCouple, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.profileRepo.save(profile),
|
||||
this.ProfileFamilyCouple.save(familyCouple),
|
||||
(history.profileFamilyCoupleId = familyCouple.id),
|
||||
this.ProfileFamilyCoupleHistory.save(history),
|
||||
]);
|
||||
await this.profileRepo.save(profile);
|
||||
await this.ProfileFamilyCouple.save(familyCouple);
|
||||
history.profileFamilyCoupleId = familyCouple.id;
|
||||
await this.ProfileFamilyCoupleHistory.save(history);
|
||||
|
||||
return new HttpSuccess(familyCouple.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,13 +222,11 @@ export class ProfileFamilyFatherController extends Controller {
|
|||
familyFather.lastUpdateFullName = req.user.name;
|
||||
|
||||
const history = new ProfileFamilyFatherHistory();
|
||||
history.profileFamilyFatherId = familyFather.id;
|
||||
Object.assign(history, { ...familyFather, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.ProfileFamilyFather.save(familyFather),
|
||||
(history.profileFamilyFatherId = familyFather.id),
|
||||
this.ProfileFamilyFatherHistory.save(history),
|
||||
]);
|
||||
await this.ProfileFamilyFather.save(familyFather);
|
||||
history.profileFamilyFatherId = familyFather.id;
|
||||
await this.ProfileFamilyFatherHistory.save(history);
|
||||
|
||||
return new HttpSuccess(familyFather.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,13 +222,11 @@ export class ProfileFamilyFatherEmployeeController extends Controller {
|
|||
familyFather.lastUpdateFullName = req.user.name;
|
||||
|
||||
const history = new ProfileFamilyFatherHistory();
|
||||
history.profileFamilyFatherId = familyFather.id;
|
||||
Object.assign(history, { ...familyFather, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.ProfileFamilyFather.save(familyFather),
|
||||
(history.profileFamilyFatherId = familyFather.id),
|
||||
this.ProfileFamilyFatherHistory.save(history),
|
||||
]);
|
||||
await this.ProfileFamilyFather.save(familyFather);
|
||||
history.profileFamilyFatherId = familyFather.id;
|
||||
await this.ProfileFamilyFatherHistory.save(history);
|
||||
|
||||
return new HttpSuccess(familyFather.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,13 +222,11 @@ export class ProfileFamilyFatherEmployeeTempController extends Controller {
|
|||
familyFather.lastUpdateFullName = req.user.name;
|
||||
|
||||
const history = new ProfileFamilyFatherHistory();
|
||||
history.profileFamilyFatherId = familyFather.id;
|
||||
Object.assign(history, { ...familyFather, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.ProfileFamilyFather.save(familyFather),
|
||||
(history.profileFamilyFatherId = familyFather.id),
|
||||
this.ProfileFamilyFatherHistory.save(history),
|
||||
]);
|
||||
await this.ProfileFamilyFather.save(familyFather);
|
||||
history.profileFamilyFatherId = familyFather.id;
|
||||
await this.ProfileFamilyFatherHistory.save(history);
|
||||
|
||||
return new HttpSuccess(familyFather.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,13 +222,11 @@ export class ProfileFamilyMotherController extends Controller {
|
|||
familyMother.lastUpdateFullName = req.user.name;
|
||||
|
||||
const history = new ProfileFamilyMotherHistory();
|
||||
history.profileFamilyMotherId = familyMother.id;
|
||||
Object.assign(history, { ...familyMother, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.ProfileFamilyMother.save(familyMother),
|
||||
(history.profileFamilyMotherId = familyMother.id),
|
||||
this.ProfileFamilyMotherHistory.save(history),
|
||||
]);
|
||||
await this.ProfileFamilyMother.save(familyMother);
|
||||
history.profileFamilyMotherId = familyMother.id;
|
||||
await this.ProfileFamilyMotherHistory.save(history);
|
||||
|
||||
return new HttpSuccess(familyMother.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,13 +222,11 @@ export class ProfileFamilyMotherEmployeeController extends Controller {
|
|||
familyMother.lastUpdateFullName = req.user.name;
|
||||
|
||||
const history = new ProfileFamilyMotherHistory();
|
||||
history.profileFamilyMotherId = familyMother.id;
|
||||
Object.assign(history, { ...familyMother, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.ProfileFamilyMother.save(familyMother),
|
||||
(history.profileFamilyMotherId = familyMother.id),
|
||||
this.ProfileFamilyMotherHistory.save(history),
|
||||
]);
|
||||
await this.ProfileFamilyMother.save(familyMother);
|
||||
history.profileFamilyMotherId = familyMother.id;
|
||||
await this.ProfileFamilyMotherHistory.save(history);
|
||||
|
||||
return new HttpSuccess(familyMother.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,13 +222,11 @@ export class ProfileFamilyMotherEmployeeTempController extends Controller {
|
|||
familyMother.lastUpdateFullName = req.user.name;
|
||||
|
||||
const history = new ProfileFamilyMotherHistory();
|
||||
history.profileFamilyMotherId = familyMother.id;
|
||||
Object.assign(history, { ...familyMother, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.ProfileFamilyMother.save(familyMother),
|
||||
(history.profileFamilyMotherId = familyMother.id),
|
||||
this.ProfileFamilyMotherHistory.save(history),
|
||||
]);
|
||||
await this.ProfileFamilyMother.save(familyMother);
|
||||
history.profileFamilyMotherId = familyMother.id;
|
||||
await this.ProfileFamilyMotherHistory.save(history);
|
||||
|
||||
return new HttpSuccess(familyMother.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,13 +160,11 @@ export class ProfileHonorController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileHonorHistory();
|
||||
history.profileHonorId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.honorRepo.save(data),
|
||||
(history.profileHonorId = data.id),
|
||||
this.honorHistoryRepo.save(history),
|
||||
]);
|
||||
await this.honorRepo.save(data);
|
||||
history.profileHonorId = data.id;
|
||||
await this.honorHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,13 +164,11 @@ export class ProfileHonorEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileHonorHistory();
|
||||
history.profileHonorId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.honorRepo.save(data),
|
||||
(history.profileHonorId = data.id),
|
||||
this.honorHistoryRepo.save(history),
|
||||
]);
|
||||
await this.honorRepo.save(data);
|
||||
history.profileHonorId = data.id;
|
||||
await this.honorHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,13 +164,11 @@ export class ProfileHonorEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileHonorHistory();
|
||||
history.profileHonorId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.honorRepo.save(data),
|
||||
(history.profileHonorId = data.id),
|
||||
this.honorHistoryRepo.save(history),
|
||||
]);
|
||||
await this.honorRepo.save(data);
|
||||
history.profileHonorId = data.id;
|
||||
await this.honorHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,13 +195,11 @@ export class ProfileInsigniaController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileInsigniaHistory();
|
||||
history.profileInsigniaId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.insigniaRepo.save(data),
|
||||
(history.profileInsigniaId = data.id),
|
||||
this.insigniaHistoryRepo.save(history),
|
||||
]);
|
||||
await this.insigniaRepo.save(data);
|
||||
history.profileInsigniaId = data.id;
|
||||
await this.insigniaHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,13 +198,11 @@ export class ProfileInsigniaEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileInsigniaHistory();
|
||||
history.profileInsigniaId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.insigniaRepo.save(data),
|
||||
(history.profileInsigniaId = data.id),
|
||||
this.insigniaHistoryRepo.save(history),
|
||||
]);
|
||||
await this.insigniaRepo.save(data);
|
||||
history.profileInsigniaId = data.id;
|
||||
await this.insigniaHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,13 +198,11 @@ export class ProfileInsigniaEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileInsigniaHistory();
|
||||
history.profileInsigniaId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.insigniaRepo.save(data),
|
||||
(history.profileInsigniaId = data.id),
|
||||
this.insigniaHistoryRepo.save(history),
|
||||
]);
|
||||
await this.insigniaRepo.save(data);
|
||||
history.profileInsigniaId = data.id;
|
||||
await this.insigniaHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,13 +275,11 @@ export class ProfileLeaveController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileLeaveHistory();
|
||||
history.profileLeaveId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.leaveRepo.save(data),
|
||||
(history.profileLeaveId = data.id),
|
||||
this.leaveHistoryRepo.save(history),
|
||||
]);
|
||||
await this.leaveRepo.save(data);
|
||||
history.profileLeaveId = data.id;
|
||||
await this.leaveHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,13 +96,11 @@ export class ProfileLeaveEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileLeaveHistory();
|
||||
history.profileLeaveId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.leaveRepo.save(data),
|
||||
(history.profileLeaveId = data.id),
|
||||
this.leaveHistoryRepo.save(history),
|
||||
]);
|
||||
await this.leaveRepo.save(data);
|
||||
history.profileLeaveId = data.id;
|
||||
await this.leaveHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,13 +96,11 @@ export class ProfileLeaveEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileLeaveHistory();
|
||||
history.profileLeaveId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.leaveRepo.save(data),
|
||||
(history.profileLeaveId = data.id),
|
||||
this.leaveHistoryRepo.save(history),
|
||||
]);
|
||||
await this.leaveRepo.save(data);
|
||||
history.profileLeaveId = data.id;
|
||||
await this.leaveHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,13 +118,11 @@ export class ProfileNopaidController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileNopaidHistory();
|
||||
history.profileNopaidId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.nopaidRepository.save(data),
|
||||
(history.profileNopaidId = data.id),
|
||||
this.nopaidHistoryRepository.save(history),
|
||||
]);
|
||||
await this.nopaidRepository.save(data);
|
||||
history.profileNopaidId = data.id;
|
||||
await this.nopaidHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,13 +89,11 @@ export class ProfileNopaidEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileNopaidHistory();
|
||||
history.profileNopaidId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.nopaidRepository.save(data),
|
||||
(history.profileNopaidId = data.id),
|
||||
this.nopaidHistoryRepository.save(history),
|
||||
]);
|
||||
await this.nopaidRepository.save(data);
|
||||
history.profileNopaidId = data.id;
|
||||
await this.nopaidHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,13 +89,11 @@ export class ProfileNopaidEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileNopaidHistory();
|
||||
history.profileNopaidId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.nopaidRepository.save(data),
|
||||
(history.profileNopaidId = data.id),
|
||||
this.nopaidHistoryRepository.save(history),
|
||||
]);
|
||||
await this.nopaidRepository.save(data);
|
||||
history.profileNopaidId = data.id;
|
||||
await this.nopaidHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,13 +115,11 @@ export class ProfileOtherController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileOtherHistory();
|
||||
history.profileOtherId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.otherRepository.save(data),
|
||||
(history.profileOtherId = data.id),
|
||||
this.otherHistoryRepository.save(history),
|
||||
]);
|
||||
await this.otherRepository.save(data);
|
||||
history.profileOtherId = data.id;
|
||||
await this.otherHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,13 +86,11 @@ export class ProfileOtherEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileOtherHistory();
|
||||
history.profileOtherId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.otherRepository.save(data),
|
||||
(history.profileOtherId = data.id),
|
||||
this.otherHistoryRepository.save(history),
|
||||
]);
|
||||
await this.otherRepository.save(data);
|
||||
history.profileOtherId = data.id;
|
||||
await this.otherHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,13 +86,11 @@ export class ProfileOtherEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileOtherHistory();
|
||||
history.profileOtherId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.otherRepository.save(data),
|
||||
(history.profileOtherId = data.id),
|
||||
this.otherHistoryRepository.save(history),
|
||||
]);
|
||||
await this.otherRepository.save(data);
|
||||
history.profileOtherId = data.id;
|
||||
await this.otherHistoryRepository.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,13 +168,11 @@ export class ProfileSalaryController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileSalaryHistory();
|
||||
history.profileSalaryId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.salaryRepo.save(data),
|
||||
(history.profileSalaryId = data.id),
|
||||
this.salaryHistoryRepo.save(history),
|
||||
]);
|
||||
await this.salaryRepo.save(data);
|
||||
history.profileSalaryId = data.id;
|
||||
await this.salaryHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,13 +97,11 @@ export class ProfileSalaryEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileSalaryHistory();
|
||||
history.profileSalaryId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.salaryRepo.save(data),
|
||||
(history.profileSalaryId = data.id),
|
||||
this.salaryHistoryRepo.save(history),
|
||||
]);
|
||||
await this.salaryRepo.save(data);
|
||||
history.profileSalaryId = data.id;
|
||||
await this.salaryHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,13 +97,11 @@ export class ProfileSalaryEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileSalaryHistory();
|
||||
history.profileSalaryId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.salaryRepo.save(data),
|
||||
(history.profileSalaryId = data.id),
|
||||
this.salaryHistoryRepo.save(history),
|
||||
]);
|
||||
await this.salaryRepo.save(data);
|
||||
history.profileSalaryId = data.id;
|
||||
await this.salaryHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,13 +161,11 @@ export class ProfileTrainingController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileTrainingHistory();
|
||||
history.profileTrainingId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.trainingRepo.save(data),
|
||||
(history.profileTrainingId = data.id),
|
||||
this.trainingHistoryRepo.save(history),
|
||||
]);
|
||||
await this.trainingRepo.save(data);
|
||||
history.profileTrainingId = data.id;
|
||||
await this.trainingHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,13 +164,11 @@ export class ProfileTrainingEmployeeController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileTrainingHistory();
|
||||
history.profileTrainingId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.trainingRepo.save(data),
|
||||
(history.profileTrainingId = data.id),
|
||||
this.trainingHistoryRepo.save(history),
|
||||
]);
|
||||
await this.trainingRepo.save(data);
|
||||
history.profileTrainingId = data.id;
|
||||
await this.trainingHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,13 +164,11 @@ export class ProfileTrainingEmployeeTempController extends Controller {
|
|||
|
||||
Object.assign(data, { ...body, ...meta });
|
||||
const history = new ProfileTrainingHistory();
|
||||
history.profileTrainingId = data.id;
|
||||
Object.assign(history, { ...data, id: undefined });
|
||||
|
||||
await Promise.all([
|
||||
this.trainingRepo.save(data),
|
||||
(history.profileTrainingId = data.id),
|
||||
this.trainingHistoryRepo.save(history),
|
||||
]);
|
||||
await this.trainingRepo.save(data);
|
||||
history.profileTrainingId = data.id;
|
||||
await this.trainingHistoryRepo.save(history);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue