공통코드,REST API 회사별 분리

This commit is contained in:
kjs
2025-10-28 11:54:44 +09:00
parent 25f6217433
commit c333a9fd9d
6 changed files with 195 additions and 54 deletions

View File

@@ -461,12 +461,13 @@ export class CommonCodeController {
}
/**
* 카테고리 중복 검사
* 카테고리 중복 검사 (회사별)
* GET /api/common-codes/categories/check-duplicate?field=categoryCode&value=USER_STATUS&excludeCode=OLD_CODE
*/
async checkCategoryDuplicate(req: AuthenticatedRequest, res: Response) {
try {
const { field, value, excludeCode } = req.query;
const userCompanyCode = req.user?.companyCode;
// 입력값 검증
if (!field || !value) {
@@ -488,7 +489,8 @@ export class CommonCodeController {
const result = await this.commonCodeService.checkCategoryDuplicate(
field as "categoryCode" | "categoryName" | "categoryNameEng",
value as string,
excludeCode as string
excludeCode as string,
userCompanyCode
);
return res.json({
@@ -511,13 +513,14 @@ export class CommonCodeController {
}
/**
* 코드 중복 검사
* 코드 중복 검사 (회사별)
* GET /api/common-codes/categories/:categoryCode/codes/check-duplicate?field=codeValue&value=ACTIVE&excludeCode=OLD_CODE
*/
async checkCodeDuplicate(req: AuthenticatedRequest, res: Response) {
try {
const { categoryCode } = req.params;
const { field, value, excludeCode } = req.query;
const userCompanyCode = req.user?.companyCode;
// 입력값 검증
if (!field || !value) {
@@ -540,7 +543,8 @@ export class CommonCodeController {
categoryCode,
field as "codeValue" | "codeName" | "codeNameEng",
value as string,
excludeCode as string
excludeCode as string,
userCompanyCode
);
return res.json({