add parth admin history
This commit is contained in:
parent
74e64176e6
commit
4b6fd79264
23 changed files with 309 additions and 50 deletions
|
|
@ -66,12 +66,10 @@ export class ProfileAbilityController extends Controller {
|
|||
@Path() abilityId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
const _record = await this.profileAbilityRepo.findOne({
|
||||
where: { id: abilityId },
|
||||
});
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||
}
|
||||
const _record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||
}
|
||||
|
||||
const record = await this.profileAbilityHistoryRepo.find({
|
||||
where: { profileAbilityId: abilityId },
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ export class ProfileAssessmentsEmployeeController extends Controller {
|
|||
return new HttpSuccess(getProfileAssessments);
|
||||
}
|
||||
|
||||
@Get("history/{assessmentId}")
|
||||
public async getProfileAssessmentsHistory(
|
||||
@Get("admin/history/{assessmentId}")
|
||||
public async getProfileAdminAssessmentsHistory(
|
||||
@Path() assessmentId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
|
|
@ -89,6 +89,23 @@ export class ProfileAssessmentsEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{assessmentId}")
|
||||
public async getProfileAssessmentsHistory(
|
||||
@Path() assessmentId: string,
|
||||
) {
|
||||
const record = await this.profileAssessmentsHistoryRepository.find({
|
||||
where: {
|
||||
profileAssessmentId: assessmentId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
if (!record) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async profileAssessment(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ export class ProfileAssessmentsEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(getProfileAssessments);
|
||||
}
|
||||
|
||||
@Get("history/{assessmentId}")
|
||||
public async getProfileAssessmentsHistory(
|
||||
@Get("admin/history/{assessmentId}")
|
||||
public async getProfileAdminAssessmentsHistory(
|
||||
@Path() assessmentId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
|
|
@ -87,6 +87,24 @@ export class ProfileAssessmentsEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{assessmentId}")
|
||||
public async getProfileAssessmentsHistory(
|
||||
@Path() assessmentId: string,
|
||||
) {
|
||||
const record = await this.profileAssessmentsHistoryRepository.find({
|
||||
where: {
|
||||
profileAssessmentId: assessmentId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
|
||||
if (!record) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async profileAssessment(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ export class ProfileCertificateEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{certificateId}")
|
||||
public async certificateHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{certificateId}")
|
||||
public async certificateAdminHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.certificateRepo.findOneBy({ id: certificateId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -73,6 +73,17 @@ export class ProfileCertificateEmployeeController extends Controller {
|
|||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{certificateId}")
|
||||
public async certificateHistory(@Path() certificateId: string) {
|
||||
const record = await this.certificateHistoryRepo.find({
|
||||
where: {
|
||||
profileCertificateId: certificateId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newCertificate(
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ export class ProfileCertificateEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{certificateId}")
|
||||
public async certificateHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{certificateId}")
|
||||
public async certificateAdminHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const record = await this.certificateHistoryRepo.find({
|
||||
where: {
|
||||
|
|
@ -67,6 +67,17 @@ export class ProfileCertificateEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{certificateId}")
|
||||
public async certificateHistory(@Path() certificateId: string) {
|
||||
const record = await this.certificateHistoryRepo.find({
|
||||
where: {
|
||||
profileCertificateId: certificateId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newCertificate(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ export class ProfileDisciplineEmployeeController extends Controller {
|
|||
return new HttpSuccess(lists);
|
||||
}
|
||||
|
||||
@Get("history/{disciplineId}")
|
||||
public async disciplineHistory(@Path() disciplineId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{disciplineId}")
|
||||
public async disciplineAdminHistory(@Path() disciplineId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.disciplineRepository.findOneBy({ id: disciplineId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -82,6 +82,15 @@ export class ProfileDisciplineEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{disciplineId}")
|
||||
public async disciplineHistory(@Path() disciplineId: string) {
|
||||
const record = await this.disciplineHistoryRepository.find({
|
||||
where: { profileDisciplineId: disciplineId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newDiscipline(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ export class ProfileDisciplineEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(lists);
|
||||
}
|
||||
|
||||
@Get("history/{disciplineId}")
|
||||
public async disciplineHistory(@Path() disciplineId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{disciplineId}")
|
||||
public async disciplineAdminHistory(@Path() disciplineId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const record = await this.disciplineHistoryRepository.find({
|
||||
where: { profileDisciplineId: disciplineId },
|
||||
|
|
@ -75,6 +75,15 @@ export class ProfileDisciplineEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{disciplineId}")
|
||||
public async disciplineHistory(@Path() disciplineId: string) {
|
||||
const record = await this.disciplineHistoryRepository.find({
|
||||
where: { profileDisciplineId: disciplineId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newDiscipline(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ export class ProfileDutyEmployeeController extends Controller {
|
|||
return new HttpSuccess(lists);
|
||||
}
|
||||
|
||||
@Get("history/{dutyId}")
|
||||
public async dutyHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{dutyId}")
|
||||
public async dutyAdminHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.dutyRepository.findOneBy({ id: dutyId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -68,6 +68,15 @@ export class ProfileDutyEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{dutyId}")
|
||||
public async dutyHistory(@Path() dutyId: string) {
|
||||
const record = await this.dutyHistoryRepository.find({
|
||||
where: { profileDutyId: dutyId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newDuty(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeDuty) {
|
||||
if (!body.profileEmployeeId) {
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ export class ProfileDutyEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(lists);
|
||||
}
|
||||
|
||||
@Get("history/{dutyId}")
|
||||
public async dutyHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{dutyId}")
|
||||
public async dutyAdminHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const record = await this.dutyHistoryRepository.find({
|
||||
where: { profileDutyId: dutyId },
|
||||
|
|
@ -61,6 +61,15 @@ export class ProfileDutyEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{dutyId}")
|
||||
public async dutyHistory(@Path() dutyId: string) {
|
||||
const record = await this.dutyHistoryRepository.find({
|
||||
where: { profileDutyId: dutyId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newDuty(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeDuty) {
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ export class ProfileEducationsEmployeeController extends Controller {
|
|||
return new HttpSuccess(getProfileEducation);
|
||||
}
|
||||
|
||||
@Get("history/{educationId}")
|
||||
public async getProfileEducationHistory(
|
||||
@Get("admin/history/{educationId}")
|
||||
public async getProfileAdminEducationHistory(
|
||||
@Path() educationId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
|
|
@ -90,6 +90,22 @@ export class ProfileEducationsEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{educationId}")
|
||||
public async getProfileEducationHistory(
|
||||
@Path() educationId: string,
|
||||
) {
|
||||
const record = await this.profileEducationHistoryRepo.find({
|
||||
where: {
|
||||
profileEducationId: educationId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
if (!record) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newProfileEducation(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ export class ProfileEducationsEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(getProfileEducation);
|
||||
}
|
||||
|
||||
@Get("history/{educationId}")
|
||||
public async getProfileEducationHistory(
|
||||
@Get("admin/history/{educationId}")
|
||||
public async getProfileAdminEducationHistory(
|
||||
@Path() educationId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
|
|
@ -82,6 +82,22 @@ export class ProfileEducationsEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{educationId}")
|
||||
public async getProfileEducationHistory(
|
||||
@Path() educationId: string,
|
||||
) {
|
||||
const record = await this.profileEducationHistoryRepo.find({
|
||||
where: {
|
||||
profileEducationId: educationId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
if (!record) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newProfileEducation(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ export class ProfileHonorEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{honorId}")
|
||||
public async honorHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{honorId}")
|
||||
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.honorRepo.findOneBy({ id: honorId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -97,6 +97,17 @@ export class ProfileHonorEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{honorId}")
|
||||
public async honorHistory(@Path() honorId: string) {
|
||||
const record = await this.honorHistoryRepo.find({
|
||||
where: {
|
||||
profileHonorId: honorId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newHonor(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeHonor) {
|
||||
if (!body.profileEmployeeId) {
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ export class ProfileHonorEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{honorId}")
|
||||
public async honorHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{honorId}")
|
||||
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const record = await this.honorHistoryRepo.find({
|
||||
where: {
|
||||
|
|
@ -89,6 +89,17 @@ export class ProfileHonorEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{honorId}")
|
||||
public async honorHistory(@Path() honorId: string) {
|
||||
const record = await this.honorHistoryRepo.find({
|
||||
where: {
|
||||
profileHonorId: honorId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newHonor(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeHonor) {
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ export class ProfileInsigniaEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{InsigniaId}")
|
||||
public async getInsigniaHistory(@Path() InsigniaId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{InsigniaId}")
|
||||
public async getInsigniaAdminHistory(@Path() InsigniaId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -91,6 +91,22 @@ export class ProfileInsigniaEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{InsigniaId}")
|
||||
public async getInsigniaHistory(@Path() InsigniaId: string) {
|
||||
const record = await this.insigniaHistoryRepo.find({
|
||||
relations: {
|
||||
insignia: {
|
||||
insigniaType: true,
|
||||
},
|
||||
},
|
||||
where: {
|
||||
profileInsigniaId: InsigniaId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newInsignia(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ export class ProfileInsigniaEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{InsigniaId}")
|
||||
public async getInsigniaHistory(@Path() InsigniaId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{InsigniaId}")
|
||||
public async getInsigniaAdminHistory(@Path() InsigniaId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const record = await this.insigniaHistoryRepo.find({
|
||||
relations: {
|
||||
|
|
@ -84,6 +84,22 @@ export class ProfileInsigniaEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{InsigniaId}")
|
||||
public async getInsigniaHistory(@Path() InsigniaId: string) {
|
||||
const record = await this.insigniaHistoryRepo.find({
|
||||
relations: {
|
||||
insignia: {
|
||||
insigniaType: true,
|
||||
},
|
||||
},
|
||||
where: {
|
||||
profileInsigniaId: InsigniaId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newInsignia(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ export class ProfileLeaveEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{leaveId}")
|
||||
public async leaveHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{leaveId}")
|
||||
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -88,6 +88,16 @@ export class ProfileLeaveEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{leaveId}")
|
||||
public async leaveHistory(@Path() leaveId: string) {
|
||||
const record = await this.leaveHistoryRepo.find({
|
||||
relations: { leaveType: true },
|
||||
where: { profileLeaveId: leaveId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newLeave(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeLeave) {
|
||||
if (!body.profileEmployeeId) {
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ export class ProfileLeaveEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{leaveId}")
|
||||
public async leaveHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{leaveId}")
|
||||
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const record = await this.leaveHistoryRepo.find({
|
||||
relations: { leaveType: true },
|
||||
|
|
@ -81,6 +81,16 @@ export class ProfileLeaveEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{leaveId}")
|
||||
public async leaveHistory(@Path() leaveId: string) {
|
||||
const record = await this.leaveHistoryRepo.find({
|
||||
relations: { leaveType: true },
|
||||
where: { profileLeaveId: leaveId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newLeave(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeLeave) {
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ export class ProfileOtherEmployeeController extends Controller {
|
|||
return new HttpSuccess(lists);
|
||||
}
|
||||
|
||||
@Get("history/{otherId}")
|
||||
public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{otherId}")
|
||||
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.otherRepository.findOneBy({ id: otherId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -71,6 +71,15 @@ export class ProfileOtherEmployeeController extends Controller {
|
|||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{otherId}")
|
||||
public async otherHistory(@Path() otherId: string) {
|
||||
const record = await this.otherHistoryRepository.find({
|
||||
where: { profileOtherId: otherId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newOther(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeOther) {
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ export class ProfileOtherEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(lists);
|
||||
}
|
||||
|
||||
@Get("history/{otherId}")
|
||||
public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{otherId}")
|
||||
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const record = await this.otherHistoryRepository.find({
|
||||
where: { profileOtherId: otherId },
|
||||
|
|
@ -66,6 +66,15 @@ export class ProfileOtherEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{otherId}")
|
||||
public async otherHistory(@Path() otherId: string) {
|
||||
const record = await this.otherHistoryRepository.find({
|
||||
where: { profileOtherId: otherId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newOther(@Request() req: RequestWithUser, @Body() body: CreateProfileEmployeeOther) {
|
||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ export class ProfileSalaryEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{salaryId}")
|
||||
public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{salaryId}")
|
||||
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.salaryRepo.findOneBy({ id: salaryId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -85,6 +85,17 @@ export class ProfileSalaryEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{salaryId}")
|
||||
public async salaryHistory(@Path() salaryId: string) {
|
||||
const record = await this.salaryHistoryRepo.find({
|
||||
where: {
|
||||
profileSalaryId: salaryId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newSalaryEmployee(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ export class ProfileSalaryEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{salaryId}")
|
||||
public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{salaryId}")
|
||||
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const record = await this.salaryHistoryRepo.find({
|
||||
where: {
|
||||
|
|
@ -78,6 +78,17 @@ export class ProfileSalaryEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{salaryId}")
|
||||
public async salaryHistory(@Path() salaryId: string) {
|
||||
const record = await this.salaryHistoryRepo.find({
|
||||
where: {
|
||||
profileSalaryId: salaryId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newSalaryEmployee(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ export class ProfileTrainingEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{trainingId}")
|
||||
public async trainingHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{trainingId}")
|
||||
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||
const _record = await this.trainingRepo.findOneBy({ id: trainingId });
|
||||
if (_record) {
|
||||
await new permission().PermissionOrgUserGet(
|
||||
|
|
@ -76,6 +76,17 @@ export class ProfileTrainingEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{trainingId}")
|
||||
public async trainingHistory(@Path() trainingId: string) {
|
||||
const record = await this.trainingHistoryRepo.find({
|
||||
where: {
|
||||
profileTrainingId: trainingId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newTraining(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ export class ProfileTrainingEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{trainingId}")
|
||||
public async trainingHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||
@Get("admin/history/{trainingId}")
|
||||
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||
const record = await this.trainingHistoryRepo.find({
|
||||
where: {
|
||||
|
|
@ -68,6 +68,17 @@ export class ProfileTrainingEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{trainingId}")
|
||||
public async trainingHistory(@Path() trainingId: string) {
|
||||
const record = await this.trainingHistoryRepo.find({
|
||||
where: {
|
||||
profileTrainingId: trainingId,
|
||||
},
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newTraining(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue