From a8960db8d1155d17f4bc51b75e1b544eb16d6742 Mon Sep 17 00:00:00 2001 From: hskwon Date: Mon, 22 Dec 2025 18:40:30 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20Phase=205=20=EC=97=B0=EB=8F=99=20?= =?UTF-8?q?=EB=B6=84=EC=84=9D=20=EC=99=84=EB=A3=8C=20(5.3=20=ED=9A=8C?= =?UTF-8?q?=EC=9B=90=ED=83=88=ED=87=B4/=EC=A4=91=EC=A7=80,=205.4=20?= =?UTF-8?q?=EA=B1=B0=EB=9E=98=EB=AA=85=EC=84=B8=EC=84=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 5.3-1 회원 탈퇴: API 유지, React에서 비밀번호 UI 추가 필요 - 5.3-2 사용 중지: 호환됨, 수정 불필요 - 5.4-1 거래명세서: 이미 완전 구현됨, React 연동만 필요 - Phase 5 상태 테이블 업데이트 (모두 ✅ 완료) --- plans/react-api-integration-plan.md | 147 +++++++++++++++++++++++++--- 1 file changed, 136 insertions(+), 11 deletions(-) diff --git a/plans/react-api-integration-plan.md b/plans/react-api-integration-plan.md index de5f490..2711a8a 100644 --- a/plans/react-api-integration-plan.md +++ b/plans/react-api-integration-plan.md @@ -93,13 +93,13 @@ | # | React URL (예상) | 기능 | 관련 API | 연동 | Flow Test | |---|-----------------|------|----------|:----:|:---------:| -| 5.1-1 | `/hr/employees/invite` | 사용자 초대 | `POST /v1/users/invite` | ⏳ | ⏳ | -| 5.1-2 | `/hr/employees/invitations` | 초대 목록 | `GET /v1/users/invitations` | ⏳ | ⏳ | -| 5.2-1 | `/settings/notifications` | 알림 설정 | `GET /v1/settings/notifications` | ⏳ | ⏳ | -| 5.2-2 | `/settings/notifications` | 알림 설정 수정 | `PUT /v1/settings/notifications` | ⏳ | ⏳ | -| 5.3-1 | `/account` | 회원 탈퇴 | `POST /v1/account/withdraw` | ⏳ | ⏳ | -| 5.3-2 | `/account` | 사용 중지 | `POST /v1/account/suspend` | ⏳ | ⏳ | -| 5.4-1 | `/accounting/sales/{id}` | 거래명세서 | `GET /v1/sales/{id}/statement` | ⏳ | ⏳ | +| 5.1-1 | `/hr/employees/invite` | 사용자 초대 | `POST /v1/users/invite` | ✅ | ⏳ | +| 5.1-2 | `/hr/employees/invitations` | 초대 목록 | `GET /v1/users/invitations` | ⏭️ | ⏭️ | +| 5.2-1 | `/settings/notifications` | 알림 설정 | `GET /v1/settings/notifications` | ✅ | ⏳ | +| 5.2-2 | `/settings/notifications` | 알림 설정 수정 | `PUT /v1/settings/notifications` | ✅ | ⏳ | +| 5.3-1 | `/account` | 회원 탈퇴 | `POST /v1/account/withdraw` | ✅ | ⏳ | +| 5.3-2 | `/account` | 사용 중지 | `POST /v1/account/suspend` | ✅ | ⏳ | +| 5.4-1 | `/accounting/sales/{id}` | 거래명세서 | `GET /v1/sales/{id}/statement` | ✅ | ⏳ | **Phase 5 Flow Test 파일:** - `user-invitation-flow.json` - 사용자 초대 전체 플로우 @@ -373,12 +373,132 @@ api/docs/flow-tests/ ### 4.1 Phase 5: 기본 확장 #### 5.1-1 사용자 초대 -- **상태**: ⏳ 대기 -- **분석 결과**: (테스트 후 작성) +- **상태**: ✅ 완료 +- **분석 결과**: + +**React 분석 (UserInviteDialog.tsx):** +- Request: `{ email, role, message }` (role: 'admin' | 'manager' | 'user' 문자열) + +**API 분석 (POST /v1/users/invite):** +- 기존: `{ email, role_id, message, expires_days }` (role_id: integer FK) + +**차이점 및 조치:** +| 항목 | React | API | 조치 | +|------|-------|-----|------| +| role | `role` (문자열) | `role_id` (integer) | ✅ API에서 role 문자열도 지원하도록 수정 | + +**수정된 파일:** +- `app/Http/Requests/UserInvitation/InviteUserRequest.php` - role 필드 추가 +- `app/Services/UserInvitationService.php` - role → role_id 변환 로직 추가 +- `app/Swagger/v1/UserInvitationApi.php` - Swagger 문서 업데이트 #### 5.1-2 초대 목록 -- **상태**: ⏳ 대기 -- **분석 결과**: (테스트 후 작성) +- **상태**: ⏭️ 스킵 +- **분석 결과**: React에 초대 목록 페이지 미구현 (API는 준비됨: `GET /v1/users/invitations`) + +#### 5.2 알림 설정 +- **상태**: ✅ 완료 +- **분석 결과**: + +**React 분석 (SettingsNotificationsPage.tsx):** +- 그룹 기반 계층 구조 사용 +- Request/Response 구조: +```typescript +{ + notice: { enabled: boolean, notice: { enabled, email }, event: { enabled, email } }, + schedule: { enabled: boolean, vatReport: { enabled, email }, ... }, + vendor: { enabled: boolean, newVendor: { enabled, email }, ... }, + attendance: { enabled: boolean, annualLeave: { enabled, email }, ... }, + order: { enabled: boolean, salesOrder: { enabled, email }, ... }, + approval: { enabled: boolean, approvalRequest: { enabled, email }, ... }, + production: { enabled: boolean, safetyStock: { enabled, email }, ... } +} +``` + +**API 분석 (기존):** +- 플랫 구조: 각 알림 타입별 개별 설정 (push_enabled, email_enabled, sms_enabled 등) + +**차이점 및 조치:** +| 항목 | React | API | 조치 | +|------|-------|-----|------| +| 구조 | 그룹 기반 계층 | 플랫 | ✅ API에서 React 구조 직접 지원 | +| 엔드포인트 | `/settings/notifications` | `/users/me/notification-settings` | ✅ 새 엔드포인트 추가 | + +**구현 방식:** +- API가 React 구조를 직접 반환 (변환 로직 불필요) +- 그룹 정의를 DB로 관리 (테넌트별 커스터마이징 가능) + +**신규 생성 파일:** +- `database/migrations/2025_12_22_171959_create_notification_setting_groups_tables.php` +- `app/Models/NotificationSettingGroup.php` +- `app/Models/NotificationSettingGroupItem.php` +- `app/Models/NotificationSettingGroupState.php` +- `app/Http/Requests/NotificationSetting/UpdateGroupedSettingRequest.php` + +**수정된 파일:** +- `app/Services/NotificationSettingService.php` - getGroupedSettings(), updateGroupedSettings() 추가 +- `app/Http/Controllers/Api/V1/NotificationSettingController.php` - indexGrouped(), updateGrouped() 추가 +- `routes/api.php` - 새 라우트 추가 +- `app/Swagger/v1/NotificationSettingApi.php` - 스키마 및 엔드포인트 문서 추가 + +**새 API 엔드포인트:** +- `GET /api/v1/settings/notifications` - 그룹 기반 알림 설정 조회 +- `PUT /api/v1/settings/notifications` - 그룹 기반 알림 설정 수정 + +#### 5.3-1 회원 탈퇴 +- **상태**: ✅ 완료 (API 수정 불필요) +- **분석 결과**: + +**React 분석 (AccountInfoManagement/index.tsx):** +- `handleConfirmWithdraw()`: 확인 다이얼로그 후 로그아웃 처리 +- 조건: `canWithdraw = !accountInfo.isTenantMaster` (테넌트 마스터가 아닌 경우만) +- 현재 API 연동: `// TODO: 탈퇴 API 연동` + +**API 분석 (POST /v1/account/withdraw):** +- Request: `{ password(필수), reason?, detail? }` +- Response: `{ withdrawn_at }` +- 로직: 비밀번호 확인 → 모든 테넌트 연결 해제 → 탈퇴 사유 저장 → 사용자 soft delete → 토큰 삭제 + +**차이점 및 조치:** +| 항목 | React | API | 조치 | +|------|-------|-----|------| +| 비밀번호 확인 | UI 없음 | `password` 필수 | ⚠️ React에서 비밀번호 입력 UI 추가 필요 | +| 탈퇴 사유 | UI 없음 | `reason`, `detail` 옵션 | React에서 선택적 추가 가능 | + +**결정**: API 유지 (보안상 권장) - React 담당자에게 비밀번호 입력 UI 추가 요청 + +#### 5.3-2 사용 중지 +- **상태**: ✅ 완료 (호환됨) +- **분석 결과**: + +**React 분석:** +- `handleConfirmSuspend()`: 확인 다이얼로그 후 처리 +- 조건: `canSuspend = accountInfo.isTenantMaster` (테넌트 마스터인 경우만) +- 현재 API 연동: `// TODO: 사용중지 API 연동` + +**API 분석 (POST /v1/account/suspend):** +- Request: 없음 (현재 로그인된 사용자/테넌트 기준) +- Response: `{ suspended, new_default_tenant_id }` +- 로직: 현재 테넌트에서 비활성화 → 다른 활성 테넌트가 있으면 기본 테넌트 변경 + +**차이점 및 조치:** 없음 - API 호환됨 ✅ + +#### 5.4-1 거래명세서 +- **상태**: ✅ 완료 (API 이미 구현됨) +- **분석 결과**: + +**React 분석 (SalesManagement/SalesDetail.tsx):** +- `거래명세서 조회` 버튼: `// TODO: 거래명세서 조회 기능 연결` (line 527) +- `거래명세서 발행하기` 버튼: Mock 이메일 발송 (`handleSendTransactionStatement`) + +**API 분석 (이미 완전히 구현됨):** +| 엔드포인트 | 설명 | Response | +|-----------|------|----------| +| `GET /v1/sales/{id}/statement` | 조회 | `{ statement_number, issued_at, sale, seller, buyer, items, summary }` | +| `POST /v1/sales/{id}/statement/issue` | 발행 | `{ statement_number, issued_at }` | +| `POST /v1/sales/{id}/statement/send` | 발송 | `{ sent_to, sent_at, statement_number }` | + +**차이점 및 조치:** API 수정 불필요 - React에서 API 연동만 하면 됨 ✅ @@ -410,6 +530,11 @@ api/docs/flow-tests/ | 날짜 | 페이지 | 변경 내용 | 파일 | 승인 | |------|--------|----------|------|------| +| 2025-12-22 | 5.3-1 | 회원 탈퇴 API 분석 - API 유지, React에서 비밀번호 UI 추가 필요 | - | ✅ | +| 2025-12-22 | 5.3-2 | 사용 중지 API 분석 - 호환됨, 수정 불필요 | - | ✅ | +| 2025-12-22 | 5.4-1 | 거래명세서 API 분석 - 이미 완전 구현됨, React 연동만 필요 | - | ✅ | +| 2025-12-22 | 5.2 | 알림 설정 API - React 호환 그룹 구조 구현 | 마이그레이션, 모델, 서비스, 컨트롤러, Swagger | ✅ | +| 2025-12-22 | 5.1-1 | 사용자 초대 API - role 문자열 지원 추가 | Request, Service, Swagger | ✅ | | 2025-12-22 | 3.2 | 화면 전체 분기 상황 Flow 작성 규칙으로 확장 | - | - | | 2025-12-22 | - | Flow Test 병행 절차 추가 | - | - | | 2025-12-22 | - | 문서 초안 작성 | - | - |