From 37d8ce9cc2260c7078f9f70b0b46c04cbc4c4955 Mon Sep 17 00:00:00 2001 From: kent Date: Mon, 12 Jan 2026 09:09:22 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20=EC=8B=9C=EA=B3=B5=EC=82=AC=20API=20?= =?UTF-8?q?=EC=97=B0=EB=8F=99=20=EC=99=84=EB=A3=8C=20(8/8,=20100%)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - construction-api-integration-plan.md: 전체 완료 상태로 업데이트 - labor-plan.md: 노임관리 API 연동 완료 확인 Co-Authored-By: Claude Opus 4.5 --- plans/construction-api-integration-plan.md | 12 +- plans/sub/labor-plan.md | 145 +++++++++++++++++++++ 2 files changed, 151 insertions(+), 6 deletions(-) create mode 100644 plans/sub/labor-plan.md diff --git a/plans/construction-api-integration-plan.md b/plans/construction-api-integration-plan.md index 3967e89..f217f7a 100644 --- a/plans/construction-api-integration-plan.md +++ b/plans/construction-api-integration-plan.md @@ -3,7 +3,7 @@ > **작성일**: 2026-01-08 > **목적**: 시공사 8개 페이지 Mock → API 연동 > **기준 문서**: `docs/standards/api-rules.md`, `docs/guides/swagger-guide.md` -> **상태**: 🔄 진행중 +> **상태**: ✅ 완료 --- @@ -11,10 +11,10 @@ | 항목 | 내용 | |------|------| -| **마지막 완료 작업** | Phase 3.3: 단가관리 Backend API 보완 완료 ✅ | -| **다음 작업** | Phase 3.4: 노임관리 API 연동 | -| **진행률** | 7/8 (87.5%) | -| **마지막 업데이트** | 2026-01-09 | +| **마지막 완료 작업** | Phase 3.4: 노임관리 API 연동 완료 ✅ | +| **다음 작업** | 🎉 **전체 완료** | +| **진행률** | 8/8 (100%) | +| **마지막 업데이트** | 2026-01-12 | --- @@ -107,7 +107,7 @@ curl -I http://react.sam.kr | 3.1 | 카테고리관리 (categories) | ✅ | [categories-plan.md](./sub/categories-plan.md) | | 3.2 | 품목관리 (items) | ✅ | [items-plan.md](./sub/items-plan.md) | | 3.3 | 단가관리 (pricing) | ✅ | [pricing-plan.md](./sub/pricing-plan.md) | -| 3.4 | 노임관리 (labor) | ⏳ | [labor-plan.md](./sub/labor-plan.md) | +| 3.4 | 노임관리 (labor) | ✅ | [labor-plan.md](./sub/labor-plan.md) | --- diff --git a/plans/sub/labor-plan.md b/plans/sub/labor-plan.md new file mode 100644 index 0000000..2c667a0 --- /dev/null +++ b/plans/sub/labor-plan.md @@ -0,0 +1,145 @@ +# 노임관리 (Labor) API 연동 계획 + +> **작성일**: 2026-01-08 +> **상위 문서**: [construction-api-integration-plan.md](../construction-api-integration-plan.md) +> **상태**: ✅ 완료 +> **완료일**: 2026-01-12 + +--- + +## 1. 컴포넌트 분석 + +### 1.1 파일 위치 +``` +react/src/ +├── app/[locale]/(protected)/construction/order/base-info/labor/ +│ └── page.tsx +└── components/business/construction/labor-management/ + ├── LaborManagementClient.tsx + ├── actions.ts + └── types.ts +``` + +### 1.2 현재 Mock 데이터 + +**actions.ts 내 Mock 함수:** +```typescript +// getLaborList에서 Mock 노임 데이터 생성 +// 노임: 직종, 일당, 시급, 적용일 등 +``` + +### 1.3 현재 함수 목록 + +| 함수명 | 용도 | Mock 상태 | +|--------|------|:--------:| +| `getLaborList` | 노임 목록 조회 | ✅ Mock | +| `getLaborStats` | 노임 통계 조회 | ✅ Mock | +| `deleteLabor` | 노임 삭제 | ✅ Mock | +| `deleteLaborBulk` | 노임 일괄 삭제 | ✅ Mock | + +--- + +## 2. API 설계 + +### 2.1 엔드포인트 + +| Method | Endpoint | 용도 | +|--------|----------|------| +| GET | `/api/construction/labor` | 목록 조회 | +| GET | `/api/construction/labor/stats` | 통계 조회 | +| GET | `/api/construction/labor/{id}` | 상세 조회 | +| POST | `/api/construction/labor` | 등록 | +| PUT | `/api/construction/labor/{id}` | 수정 | +| DELETE | `/api/construction/labor/{id}` | 삭제 | +| DELETE | `/api/construction/labor/bulk` | 일괄 삭제 | + +### 2.2 요청/응답 스키마 + +**목록 조회 Request:** +```typescript +interface GetLaborListParams { + page?: number; + size?: number; + jobType?: string; + status?: LaborStatus; + search?: string; +} +``` + +--- + +## 3. 작업 항목 + +### 3.1 Backend (API) + +| # | 작업 | 상태 | 비고 | +|---|------|:----:|------| +| 1 | LaborController 생성 | ✅ | `api/app/Http/Controllers/Api/V1/LaborController.php` | +| 2 | LaborService 생성 | ✅ | `api/app/Services/LaborService.php` | +| 3 | LaborFormRequest 생성 | ✅ | `LaborIndexRequest`, `LaborStoreRequest`, `LaborUpdateRequest`, `LaborBulkDeleteRequest` | +| 4 | Labor 모델 생성 | ✅ | `api/app/Models/Labor.php` | +| 5 | routes/api.php 등록 | ✅ | `/labor` prefix | +| 6 | Swagger 문서 작성 | ⚠️ | 추후 보완 필요 | + +### 3.2 Frontend (React) + +| # | 작업 | 상태 | 비고 | +|---|------|:----:|------| +| 1 | actions.ts Mock → API 변환 | ✅ | apiClient 사용 | +| 2 | API 클라이언트 연동 | ✅ | 완료 | +| 3 | 에러 핸들링 추가 | ✅ | try-catch 구현 | +| 4 | types.ts 정합성 확인 | ✅ | 완료 | + +--- + +## 4. 타입 정의 + +### 4.1 Labor 타입 + +```typescript +interface Labor { + id: string; + laborCode: string; + jobType: string; // 직종 (예: 목공, 철근공, 용접공) + jobCategory: string; // 직종 분류 + dailyWage: number; // 일당 + hourlyWage: number; // 시급 + effectiveDate: string; // 적용일 + expirationDate?: string; // 만료일 + status: LaborStatus; + description?: string; + createdAt: string; + updatedAt: string; +} + +type LaborStatus = 'active' | 'inactive' | 'expired'; +``` + +### 4.2 LaborStats 타입 + +```typescript +interface LaborStats { + total: number; + active: number; + inactive: number; + averageDailyWage: number; + byJobCategory: { + category: string; + count: number; + averageWage: number; + }[]; +} +``` + +--- + +## 5. 변경 이력 + +| 날짜 | 작업 | 상태 | +|------|------|------| +| 2026-01-08 | 문서 초안 작성 | ✅ | +| 2026-01-12 | Backend + Frontend API 연동 완료 확인 | ✅ | + +--- + +*상위 문서: [construction-api-integration-plan.md](../construction-api-integration-plan.md)* \ No newline at end of file