- 작업지시 계획 문서 업데이트 - MES 통합 분석, 서버 컴포넌트 감사 계획 추가 - 수주관리, 인수인계서 API 연동 변경 이력 추가 - sub/ 하위 계획 문서들 추가 (카테고리, 계약, 품목, 단가 등) Co-Authored-By: Claude <noreply@anthropic.com>
153 lines
3.6 KiB
Markdown
153 lines
3.6 KiB
Markdown
# 발주관리 (Order Management) API 연동 계획
|
|
|
|
> **작성일**: 2026-01-08
|
|
> **상위 문서**: [construction-api-integration-plan.md](../construction-api-integration-plan.md)
|
|
> **상태**: ⏳ 대기
|
|
|
|
---
|
|
|
|
## 1. 컴포넌트 분석
|
|
|
|
### 1.1 파일 위치
|
|
```
|
|
react/src/
|
|
├── app/[locale]/(protected)/construction/order/order-management/
|
|
│ └── page.tsx
|
|
└── components/business/construction/order-management/
|
|
├── OrderManagementClient.tsx
|
|
├── actions.ts
|
|
└── types.ts
|
|
```
|
|
|
|
### 1.2 현재 Mock 데이터
|
|
|
|
**actions.ts 내 generateMockOrders:**
|
|
```typescript
|
|
function generateMockOrders(count: number): Order[] {
|
|
// 50개의 Mock 발주 데이터 생성
|
|
// 결정론적 Mock 데이터 (index 기반 선택)
|
|
const partners = ['삼성물산', '현대건설', '대우건설', ...];
|
|
const sites = ['강남 오피스텔', '송파 주상복합', ...];
|
|
const statuses = ['pending', 'approved', 'in_progress', 'completed', 'cancelled'];
|
|
}
|
|
```
|
|
|
|
### 1.3 현재 함수 목록
|
|
|
|
| 함수명 | 용도 | Mock 상태 |
|
|
|--------|------|:--------:|
|
|
| `getOrderList` | 발주 목록 조회 | ✅ Mock |
|
|
| `getOrderStats` | 발주 통계 조회 | ✅ Mock |
|
|
| `deleteOrder` | 발주 삭제 | ✅ Mock |
|
|
| `deleteOrders` | 발주 일괄 삭제 | ✅ Mock |
|
|
| `updateOrderStatus` | 발주 상태 변경 | ✅ Mock |
|
|
|
|
---
|
|
|
|
## 2. API 설계
|
|
|
|
### 2.1 엔드포인트
|
|
|
|
| Method | Endpoint | 용도 |
|
|
|--------|----------|------|
|
|
| GET | `/api/construction/orders` | 목록 조회 |
|
|
| GET | `/api/construction/orders/stats` | 통계 조회 |
|
|
| GET | `/api/construction/orders/{id}` | 상세 조회 |
|
|
| POST | `/api/construction/orders` | 등록 |
|
|
| PUT | `/api/construction/orders/{id}` | 수정 |
|
|
| PATCH | `/api/construction/orders/{id}/status` | 상태 변경 |
|
|
| DELETE | `/api/construction/orders/{id}` | 삭제 |
|
|
| DELETE | `/api/construction/orders/bulk` | 일괄 삭제 |
|
|
|
|
### 2.2 요청/응답 스키마
|
|
|
|
**목록 조회 Request:**
|
|
```typescript
|
|
interface GetOrderListParams {
|
|
page?: number;
|
|
size?: number;
|
|
startDate?: string;
|
|
endDate?: string;
|
|
siteId?: string;
|
|
partnerId?: string;
|
|
status?: OrderStatus;
|
|
search?: string;
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## 3. 작업 항목
|
|
|
|
### 3.1 Backend (API)
|
|
|
|
| # | 작업 | 상태 | 비고 |
|
|
|---|------|:----:|------|
|
|
| 1 | OrderController 생성 | ⏳ | |
|
|
| 2 | OrderService 생성 | ⏳ | |
|
|
| 3 | OrderFormRequest 생성 | ⏳ | |
|
|
| 4 | Order 모델 생성 | ⏳ | |
|
|
| 5 | routes/api.php 등록 | ⏳ | |
|
|
| 6 | Swagger 문서 작성 | ⏳ | |
|
|
|
|
### 3.2 Frontend (React)
|
|
|
|
| # | 작업 | 상태 | 비고 |
|
|
|---|------|:----:|------|
|
|
| 1 | actions.ts Mock → API 변환 | ⏳ | |
|
|
| 2 | API 클라이언트 연동 | ⏳ | |
|
|
| 3 | 에러 핸들링 추가 | ⏳ | |
|
|
| 4 | types.ts 정합성 확인 | ⏳ | |
|
|
|
|
---
|
|
|
|
## 4. 타입 정의
|
|
|
|
### 4.1 Order 타입
|
|
|
|
```typescript
|
|
interface Order {
|
|
id: string;
|
|
orderNumber: string;
|
|
siteId: string;
|
|
siteName: string;
|
|
partnerId: string;
|
|
partnerName: string;
|
|
title: string;
|
|
description?: string;
|
|
totalAmount: number;
|
|
status: OrderStatus;
|
|
orderDate: string;
|
|
deliveryDate?: string;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
}
|
|
|
|
type OrderStatus = 'pending' | 'approved' | 'in_progress' | 'completed' | 'cancelled';
|
|
```
|
|
|
|
### 4.2 OrderStats 타입
|
|
|
|
```typescript
|
|
interface OrderStats {
|
|
total: number;
|
|
pending: number;
|
|
approved: number;
|
|
inProgress: number;
|
|
completed: number;
|
|
cancelled: number;
|
|
totalAmount: number;
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## 5. 변경 이력
|
|
|
|
| 날짜 | 작업 | 상태 |
|
|
|------|------|------|
|
|
| 2026-01-08 | 문서 초안 작성 | ✅ |
|
|
|
|
---
|
|
|
|
*상위 문서: [construction-api-integration-plan.md](../construction-api-integration-plan.md)* |