docs: Phase 3.4 CommonCodeService 완료 문서 업데이트 및 코드 포맷 정리

- PRISMA_TO_RAW_QUERY_MIGRATION_PLAN.md 업데이트
  - CommonCodeService (10개) 완료 표시
  - Phase 3 진행률 반영
- commonCodeService.ts 코드 포맷 정리

Phase 3 진행률: 64/162 (39.5%)
전체 진행률: 315/444 (70.9%)
This commit is contained in:
kjs 2025-10-01 10:58:11 +09:00
parent 296340351f
commit 34295d6afa
2 changed files with 24 additions and 9 deletions

View File

@ -125,7 +125,7 @@ backend-node/ (루트)
- `multilangService.ts` (0개) - ✅ **전환 완료** (Phase 3.1)
- `batchService.ts` (0개) - ✅ **전환 완료** (Phase 3.2)
- `componentStandardService.ts` (0개) - ✅ **전환 완료** (Phase 3.3)
- `commonCodeService.ts` (15개) - 코드 관리, 계층 구조
- `commonCodeService.ts` (0개) - ✅ **전환 완료** (Phase 3.4)
- `dataflowDiagramService.ts` (12개) - 다이어그램 관리 ⭐ 신규 발견
- `collectionService.ts` (11개) - 컬렉션 관리
- `layoutService.ts` (10개) - 레이아웃 관리
@ -1156,12 +1156,20 @@ describe("Performance Benchmarks", () => {
- [x] SQL 인젝션 방지 (정렬 컬럼 검증)
- [x] TypeScript 컴파일 성공
- [x] Prisma import 완전 제거
- [x] **CommonCodeService 전환 (10개)****완료** (Phase 3.4)
- [x] 10개 Prisma 호출 전환 완료 (코드 카테고리 및 코드 CRUD)
- [x] 동적 WHERE 조건 생성 (ILIKE 검색, OR 조건)
- [x] 동적 UPDATE 쿼리 (변경된 필드만 업데이트)
- [x] IN 절 동적 파라미터 바인딩 (reorderCodes)
- [x] 트랜잭션 처리 (순서 변경)
- [x] 동적 SQL 쿼리 생성 (중복 검사)
- [x] TypeScript 컴파일 성공
- [x] Prisma import 완전 제거
- [ ] 배치 관련 서비스 전환 (26개) ⭐ 대규모 신규 발견
- [ ] BatchExternalDbService (8개)
- [ ] BatchExecutionLogService (7개), BatchManagementService (5개)
- [ ] BatchSchedulerService (4개)
- [ ] 표준 관리 서비스 전환 (25개)
- [ ] CommonCodeService (15개)
- [ ] 표준 관리 서비스 전환 (10개)
- [ ] LayoutService (10개)
- [ ] 데이터플로우 관련 서비스 (18개) ⭐ 신규 발견
- [ ] DataflowDiagramService (12개), DataflowControlService (6개)

View File

@ -220,9 +220,12 @@ export class CommonCodeService {
try {
// 디버깅: 받은 데이터 로그
logger.info(`카테고리 수정 데이터:`, { categoryCode, data });
// 동적 UPDATE 쿼리 생성
const updateFields: string[] = ["updated_by = $1", "updated_date = NOW()"];
const updateFields: string[] = [
"updated_by = $1",
"updated_date = NOW()",
];
const values: any[] = [updatedBy];
let paramIndex = 2;
@ -335,9 +338,12 @@ export class CommonCodeService {
try {
// 디버깅: 받은 데이터 로그
logger.info(`코드 수정 데이터:`, { categoryCode, codeValue, data });
// 동적 UPDATE 쿼리 생성
const updateFields: string[] = ["updated_by = $1", "updated_date = NOW()"];
const updateFields: string[] = [
"updated_by = $1",
"updated_date = NOW()",
];
const values: any[] = [updatedBy];
let paramIndex = 2;
@ -445,7 +451,7 @@ export class CommonCodeService {
// 먼저 존재하는 코드들을 확인
const codeValues = codes.map((c) => c.codeValue);
const placeholders = codeValues.map((_, i) => `$${i + 2}`).join(", ");
const existingCodes = await query<{ code_value: string }>(
`SELECT code_value FROM code_info
WHERE code_category = $1 AND code_value IN (${placeholders})`,
@ -613,7 +619,8 @@ export class CommonCodeService {
}
// SQL 쿼리 생성
let sql = "SELECT code_value FROM code_info WHERE code_category = $1 AND ";
let sql =
"SELECT code_value FROM code_info WHERE code_category = $1 AND ";
const values: any[] = [categoryCode];
let paramIndex = 2;