delete
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
This commit is contained in:
parent
f51adcc8cb
commit
ce5c56bfca
33 changed files with 22 additions and 55 deletions
|
|
@ -28,7 +28,6 @@ import { RequestWithUser } from "../middlewares/user";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class BloodGroupController extends Controller {
|
export class BloodGroupController extends Controller {
|
||||||
private bloodGroupRepository = AppDataSource.getRepository(BloodGroup);
|
private bloodGroupRepository = AppDataSource.getRepository(BloodGroup);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ import CallAPI from "../interfaces/call-api";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class ChangePositionController extends Controller {
|
export class ChangePositionController extends Controller {
|
||||||
private changePositionRepository = AppDataSource.getRepository(ChangePosition);
|
private changePositionRepository = AppDataSource.getRepository(ChangePosition);
|
||||||
private profileChangePositionRepository = AppDataSource.getRepository(ProfileChangePosition);
|
private profileChangePositionRepository = AppDataSource.getRepository(ProfileChangePosition);
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,6 @@ import permission from "../interfaces/permission";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class CommandController extends Controller {
|
export class CommandController extends Controller {
|
||||||
private commandRepository = AppDataSource.getRepository(Command);
|
private commandRepository = AppDataSource.getRepository(Command);
|
||||||
private commandTypeRepository = AppDataSource.getRepository(CommandType);
|
private commandTypeRepository = AppDataSource.getRepository(CommandType);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import { CommandSys } from "../entities/CommandSys";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class CommandSalaryController extends Controller {
|
export class CommandSalaryController extends Controller {
|
||||||
private commandSalaryRepository = AppDataSource.getRepository(CommandSalary);
|
private commandSalaryRepository = AppDataSource.getRepository(CommandSalary);
|
||||||
private commandSysRepository = AppDataSource.getRepository(CommandSys);
|
private commandSysRepository = AppDataSource.getRepository(CommandSys);
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ import { CommandSys, CreateCommandSys, UpdateCommandSys } from "../entities/Comm
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class CommandSysController extends Controller {
|
export class CommandSysController extends Controller {
|
||||||
private commandSysRepository = AppDataSource.getRepository(CommandSys);
|
private commandSysRepository = AppDataSource.getRepository(CommandSys);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import { CommandSys } from "../entities/CommandSys";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class CommandTypeController extends Controller {
|
export class CommandTypeController extends Controller {
|
||||||
private commandTypeRepository = AppDataSource.getRepository(CommandType);
|
private commandTypeRepository = AppDataSource.getRepository(CommandType);
|
||||||
private commandSysRepository = AppDataSource.getRepository(CommandSys);
|
private commandSysRepository = AppDataSource.getRepository(CommandSys);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ import { RequestWithUser } from "../middlewares/user";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class DistrictController extends Controller {
|
export class DistrictController extends Controller {
|
||||||
private districtRepository = AppDataSource.getRepository(District);
|
private districtRepository = AppDataSource.getRepository(District);
|
||||||
private provinceRepository = AppDataSource.getRepository(Province);
|
private provinceRepository = AppDataSource.getRepository(Province);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class EducationLevelController extends Controller {
|
export class EducationLevelController extends Controller {
|
||||||
private educationLevelRepository = AppDataSource.getRepository(EducationLevel);
|
private educationLevelRepository = AppDataSource.getRepository(EducationLevel);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ import { EmployeePosDict } from "../entities/EmployeePosDict";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class EmployeePosLevelController extends Controller {
|
export class EmployeePosLevelController extends Controller {
|
||||||
private employeePosDictRepository = AppDataSource.getRepository(EmployeePosDict);
|
private employeePosDictRepository = AppDataSource.getRepository(EmployeePosDict);
|
||||||
private employeePosTypeRepository = AppDataSource.getRepository(EmployeePosType);
|
private employeePosTypeRepository = AppDataSource.getRepository(EmployeePosType);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class EmployeePosTypeController extends Controller {
|
export class EmployeePosTypeController extends Controller {
|
||||||
private employeePosDictRepository = AppDataSource.getRepository(EmployeePosDict);
|
private employeePosDictRepository = AppDataSource.getRepository(EmployeePosDict);
|
||||||
private employeePosTypeRepository = AppDataSource.getRepository(EmployeePosType);
|
private employeePosTypeRepository = AppDataSource.getRepository(EmployeePosType);
|
||||||
|
|
@ -81,8 +80,8 @@ export class EmployeePosTypeController extends Controller {
|
||||||
EmpPosType.lastUpdateFullName = request.user.name;
|
EmpPosType.lastUpdateFullName = request.user.name;
|
||||||
EmpPosType.createdAt = new Date();
|
EmpPosType.createdAt = new Date();
|
||||||
EmpPosType.lastUpdatedAt = new Date();
|
EmpPosType.lastUpdatedAt = new Date();
|
||||||
await this.employeePosTypeRepository.save(EmpPosType, {data: request});
|
await this.employeePosTypeRepository.save(EmpPosType, { data: request });
|
||||||
setLogDataDiff(request, {before, after: EmpPosType});
|
setLogDataDiff(request, { before, after: EmpPosType });
|
||||||
return new HttpSuccess(EmpPosType.id);
|
return new HttpSuccess(EmpPosType.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,8 +128,8 @@ export class EmployeePosTypeController extends Controller {
|
||||||
EmpPosType.lastUpdateFullName = request.user.name;
|
EmpPosType.lastUpdateFullName = request.user.name;
|
||||||
EmpPosType.lastUpdatedAt = new Date();
|
EmpPosType.lastUpdatedAt = new Date();
|
||||||
this.employeePosTypeRepository.merge(EmpPosType, requestBody);
|
this.employeePosTypeRepository.merge(EmpPosType, requestBody);
|
||||||
await this.employeePosTypeRepository.save(EmpPosType, {data: request});
|
await this.employeePosTypeRepository.save(EmpPosType, { data: request });
|
||||||
setLogDataDiff(request, {before, after: EmpPosType});
|
setLogDataDiff(request, { before, after: EmpPosType });
|
||||||
return new HttpSuccess(EmpPosType.id);
|
return new HttpSuccess(EmpPosType.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,8 +146,8 @@ export class EmployeePosTypeController extends Controller {
|
||||||
try {
|
try {
|
||||||
result = await this.employeePosTypeRepository.findOne({
|
result = await this.employeePosTypeRepository.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
})
|
});
|
||||||
await this.employeePosTypeRepository.remove(result, {data: request});
|
await this.employeePosTypeRepository.remove(result, { data: request });
|
||||||
} catch {
|
} catch {
|
||||||
throw new HttpError(
|
throw new HttpError(
|
||||||
HttpStatusCode.NOT_FOUND,
|
HttpStatusCode.NOT_FOUND,
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ import { after } from "node:test";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class EmployeePositionController extends Controller {
|
export class EmployeePositionController extends Controller {
|
||||||
private employeePosDictRepository = AppDataSource.getRepository(EmployeePosDict);
|
private employeePosDictRepository = AppDataSource.getRepository(EmployeePosDict);
|
||||||
private employeePosTypeRepository = AppDataSource.getRepository(EmployeePosType);
|
private employeePosTypeRepository = AppDataSource.getRepository(EmployeePosType);
|
||||||
|
|
@ -169,8 +168,8 @@ export class EmployeePositionController extends Controller {
|
||||||
empPosDict.lastUpdateFullName = request.user.name;
|
empPosDict.lastUpdateFullName = request.user.name;
|
||||||
empPosDict.lastUpdatedAt = new Date();
|
empPosDict.lastUpdatedAt = new Date();
|
||||||
this.employeePosDictRepository.merge(empPosDict, requestBody);
|
this.employeePosDictRepository.merge(empPosDict, requestBody);
|
||||||
await this.employeePosDictRepository.save(empPosDict,{data: request});
|
await this.employeePosDictRepository.save(empPosDict, { data: request });
|
||||||
setLogDataDiff( request, { before, after: empPosDict });
|
setLogDataDiff(request, { before, after: empPosDict });
|
||||||
return new HttpSuccess(empPosDict.id);
|
return new HttpSuccess(empPosDict.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import { RequestWithUser } from "../middlewares/user";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class GenderController extends Controller {
|
export class GenderController extends Controller {
|
||||||
private genderRepository = AppDataSource.getRepository(Gender);
|
private genderRepository = AppDataSource.getRepository(Gender);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ import { RequestWithUser } from "../middlewares/user";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class InsigniaController extends Controller {
|
export class InsigniaController extends Controller {
|
||||||
private insigniaTypeRepository = AppDataSource.getRepository(InsigniaType);
|
private insigniaTypeRepository = AppDataSource.getRepository(InsigniaType);
|
||||||
private insigniaRepository = AppDataSource.getRepository(Insignia);
|
private insigniaRepository = AppDataSource.getRepository(Insignia);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class InsigniaTypeController extends Controller {
|
export class InsigniaTypeController extends Controller {
|
||||||
private insigniaTypeRepository = AppDataSource.getRepository(InsigniaType);
|
private insigniaTypeRepository = AppDataSource.getRepository(InsigniaType);
|
||||||
private insigniaRepository = AppDataSource.getRepository(Insignia);
|
private insigniaRepository = AppDataSource.getRepository(Insignia);
|
||||||
|
|
@ -110,7 +109,7 @@ export class InsigniaTypeController extends Controller {
|
||||||
insigniaType.lastUpdatedAt = new Date();
|
insigniaType.lastUpdatedAt = new Date();
|
||||||
this.insigniaTypeRepository.merge(insigniaType, requestBody);
|
this.insigniaTypeRepository.merge(insigniaType, requestBody);
|
||||||
await this.insigniaTypeRepository.save(insigniaType, { data: request });
|
await this.insigniaTypeRepository.save(insigniaType, { data: request });
|
||||||
setLogDataDiff( request, { before, after: insigniaType });
|
setLogDataDiff(request, { before, after: insigniaType });
|
||||||
return new HttpSuccess(insigniaType.id);
|
return new HttpSuccess(insigniaType.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,7 +135,7 @@ export class InsigniaTypeController extends Controller {
|
||||||
"ไม่สามารถลบได้ เนื่องจากพบข้อมูลที่ตารางเครื่องราชอิสริยาภรณ์",
|
"ไม่สามารถลบได้ เนื่องจากพบข้อมูลที่ตารางเครื่องราชอิสริยาภรณ์",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
await this.insigniaTypeRepository.remove(delInsigniaType, {data: request});
|
await this.insigniaTypeRepository.remove(delInsigniaType, { data: request });
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class OrgChild1Controller {
|
export class OrgChild1Controller {
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
private child1Repository = AppDataSource.getRepository(OrgChild1);
|
private child1Repository = AppDataSource.getRepository(OrgChild1);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class OrgChild2Controller extends Controller {
|
export class OrgChild2Controller extends Controller {
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
private child1Repository = AppDataSource.getRepository(OrgChild1);
|
private child1Repository = AppDataSource.getRepository(OrgChild1);
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class OrgChild3Controller {
|
export class OrgChild3Controller {
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
private child2Repository = AppDataSource.getRepository(OrgChild2);
|
private child2Repository = AppDataSource.getRepository(OrgChild2);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class OrgChild4Controller extends Controller {
|
export class OrgChild4Controller extends Controller {
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
private child3Repository = AppDataSource.getRepository(OrgChild3);
|
private child3Repository = AppDataSource.getRepository(OrgChild3);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ import { AuthRole } from "../entities/AuthRole";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class OrganizationController extends Controller {
|
export class OrganizationController extends Controller {
|
||||||
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
||||||
private permissionOrgRepository = AppDataSource.getRepository(PermissionOrg);
|
private permissionOrgRepository = AppDataSource.getRepository(PermissionOrg);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import { ProfileEmployee } from "../entities/ProfileEmployee";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class OrganizationUnauthorizeController extends Controller {
|
export class OrganizationUnauthorizeController extends Controller {
|
||||||
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class PermissionOrgController extends Controller {
|
export class PermissionOrgController extends Controller {
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
private profileRepository = AppDataSource.getRepository(Profile);
|
private profileRepository = AppDataSource.getRepository(Profile);
|
||||||
|
|
@ -481,7 +480,7 @@ export class PermissionOrgController extends Controller {
|
||||||
_permissionOrg.lastUpdateFullName = request.user.name;
|
_permissionOrg.lastUpdateFullName = request.user.name;
|
||||||
_permissionOrg.createdAt = new Date();
|
_permissionOrg.createdAt = new Date();
|
||||||
_permissionOrg.lastUpdatedAt = new Date();
|
_permissionOrg.lastUpdatedAt = new Date();
|
||||||
await this.permissionOrgRepository.save(_permissionOrg, {data:request});
|
await this.permissionOrgRepository.save(_permissionOrg, { data: request });
|
||||||
setLogDataDiff(request, { before, after: _permissionOrg });
|
setLogDataDiff(request, { before, after: _permissionOrg });
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -521,7 +520,7 @@ export class PermissionOrgController extends Controller {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบสิทธิ์นี้อยู่ในระบบแล้ว");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบสิทธิ์นี้อยู่ในระบบแล้ว");
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.permissionOrgRepository.remove(_delPermissionOrg, {data:req});
|
await this.permissionOrgRepository.remove(_delPermissionOrg, { data: req });
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class PosExecutiveController extends Controller {
|
export class PosExecutiveController extends Controller {
|
||||||
private posExecutiveRepository = AppDataSource.getRepository(PosExecutive);
|
private posExecutiveRepository = AppDataSource.getRepository(PosExecutive);
|
||||||
private positionRepository = AppDataSource.getRepository(Position);
|
private positionRepository = AppDataSource.getRepository(Position);
|
||||||
|
|
@ -85,8 +84,8 @@ export class PosExecutiveController extends Controller {
|
||||||
posExecutive.lastUpdateFullName = request.user.name;
|
posExecutive.lastUpdateFullName = request.user.name;
|
||||||
posExecutive.createdAt = new Date();
|
posExecutive.createdAt = new Date();
|
||||||
posExecutive.lastUpdatedAt = new Date();
|
posExecutive.lastUpdatedAt = new Date();
|
||||||
await this.posExecutiveRepository.save(posExecutive, {data: request});
|
await this.posExecutiveRepository.save(posExecutive, { data: request });
|
||||||
setLogDataDiff(request, {before, after: posExecutive});
|
setLogDataDiff(request, { before, after: posExecutive });
|
||||||
return new HttpSuccess(posExecutive.id);
|
return new HttpSuccess(posExecutive.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,8 +146,8 @@ export class PosExecutiveController extends Controller {
|
||||||
posExecutive.lastUpdateFullName = request.user.name;
|
posExecutive.lastUpdateFullName = request.user.name;
|
||||||
posExecutive.lastUpdatedAt = new Date();
|
posExecutive.lastUpdatedAt = new Date();
|
||||||
// this.posExecutiveRepository.merge(posExecutive, requestBody);
|
// this.posExecutiveRepository.merge(posExecutive, requestBody);
|
||||||
await this.posExecutiveRepository.save(posExecutive, {data: request});
|
await this.posExecutiveRepository.save(posExecutive, { data: request });
|
||||||
setLogDataDiff(request, {before, after: posExecutive});
|
setLogDataDiff(request, { before, after: posExecutive });
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import { Not } from "typeorm";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class PosLevelController extends Controller {
|
export class PosLevelController extends Controller {
|
||||||
private posTypeRepository = AppDataSource.getRepository(PosType);
|
private posTypeRepository = AppDataSource.getRepository(PosType);
|
||||||
private posLevelRepository = AppDataSource.getRepository(PosLevel);
|
private posLevelRepository = AppDataSource.getRepository(PosLevel);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ import Extension from "../interfaces/extension";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class PosMasterActController extends Controller {
|
export class PosMasterActController extends Controller {
|
||||||
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
||||||
private posMasterActRepository = AppDataSource.getRepository(PosMasterAct);
|
private posMasterActRepository = AppDataSource.getRepository(PosMasterAct);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ import { RequestWithUser } from "../middlewares/user";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class PosTypeController extends Controller {
|
export class PosTypeController extends Controller {
|
||||||
private posTypeRepository = AppDataSource.getRepository(PosType);
|
private posTypeRepository = AppDataSource.getRepository(PosType);
|
||||||
private posLevelRepository = AppDataSource.getRepository(PosLevel);
|
private posLevelRepository = AppDataSource.getRepository(PosLevel);
|
||||||
|
|
@ -73,8 +72,8 @@ export class PosTypeController extends Controller {
|
||||||
posType.lastUpdateFullName = request.user.name;
|
posType.lastUpdateFullName = request.user.name;
|
||||||
posType.createdAt = new Date();
|
posType.createdAt = new Date();
|
||||||
posType.lastUpdatedAt = new Date();
|
posType.lastUpdatedAt = new Date();
|
||||||
await this.posTypeRepository.save(posType, {data: request});
|
await this.posTypeRepository.save(posType, { data: request });
|
||||||
setLogDataDiff(request, {before , after: posType});
|
setLogDataDiff(request, { before, after: posType });
|
||||||
return new HttpSuccess(posType);
|
return new HttpSuccess(posType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,8 +112,8 @@ export class PosTypeController extends Controller {
|
||||||
posType.lastUpdateFullName = request.user.name;
|
posType.lastUpdateFullName = request.user.name;
|
||||||
posType.lastUpdatedAt = new Date();
|
posType.lastUpdatedAt = new Date();
|
||||||
this.posTypeRepository.merge(posType, requestBody);
|
this.posTypeRepository.merge(posType, requestBody);
|
||||||
await this.posTypeRepository.save(posType, {data: request});
|
await this.posTypeRepository.save(posType, { data: request });
|
||||||
setLogDataDiff(request,{ before, after:posType });
|
setLogDataDiff(request, { before, after: posType });
|
||||||
return new HttpSuccess(posType.id);
|
return new HttpSuccess(posType.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,10 +129,10 @@ export class PosTypeController extends Controller {
|
||||||
let result: any;
|
let result: any;
|
||||||
try {
|
try {
|
||||||
result = await this.posTypeRepository.findOne({ where: { id } });
|
result = await this.posTypeRepository.findOne({ where: { id } });
|
||||||
if(!result){
|
if (!result) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประเภทตำแหน่งนี้");
|
||||||
}
|
}
|
||||||
await this.posTypeRepository.remove(result, {data: result});
|
await this.posTypeRepository.remove(result, { data: result });
|
||||||
} catch {
|
} catch {
|
||||||
throw new HttpError(
|
throw new HttpError(
|
||||||
HttpStatusCode.NOT_FOUND,
|
HttpStatusCode.NOT_FOUND,
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ import { Assign } from "../entities/Assign";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class PositionController extends Controller {
|
export class PositionController extends Controller {
|
||||||
private posExecutiveRepository = AppDataSource.getRepository(PosExecutive);
|
private posExecutiveRepository = AppDataSource.getRepository(PosExecutive);
|
||||||
private posTypeRepository = AppDataSource.getRepository(PosType);
|
private posTypeRepository = AppDataSource.getRepository(PosType);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ import { request } from "axios";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class PrefixController extends Controller {
|
export class PrefixController extends Controller {
|
||||||
private prefixRepository = AppDataSource.getRepository(Prefixe);
|
private prefixRepository = AppDataSource.getRepository(Prefixe);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import { RequestWithUser } from "../middlewares/user";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class ProvinceController extends Controller {
|
export class ProvinceController extends Controller {
|
||||||
private provinceRepository = AppDataSource.getRepository(Province);
|
private provinceRepository = AppDataSource.getRepository(Province);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import { RequestWithUser } from "../middlewares/user";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class RankController extends Controller {
|
export class RankController extends Controller {
|
||||||
private rankRepository = AppDataSource.getRepository(Rank);
|
private rankRepository = AppDataSource.getRepository(Rank);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import { request } from "axios";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class RelationshipController extends Controller {
|
export class RelationshipController extends Controller {
|
||||||
private relationshipRepository = AppDataSource.getRepository(Relationship);
|
private relationshipRepository = AppDataSource.getRepository(Relationship);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ import { RequestWithUser } from "../middlewares/user";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class ReligionController extends Controller {
|
export class ReligionController extends Controller {
|
||||||
private religionRepository = AppDataSource.getRepository(Religion);
|
private religionRepository = AppDataSource.getRepository(Religion);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import Extension from "../interfaces/extension";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class ReportController extends Controller {
|
export class ReportController extends Controller {
|
||||||
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ import { setLogDataDiff } from "../interfaces/utils";
|
||||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||||
)
|
)
|
||||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
|
||||||
export class SubDistrictController extends Controller {
|
export class SubDistrictController extends Controller {
|
||||||
private subDistrictRepository = AppDataSource.getRepository(SubDistrict);
|
private subDistrictRepository = AppDataSource.getRepository(SubDistrict);
|
||||||
private districtRepository = AppDataSource.getRepository(District);
|
private districtRepository = AppDataSource.getRepository(District);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue