refactor: [docs] 팀별 폴더 구조 재편 (공유/개발/프론트/기획)
- 개발팀 전용 폴더 dev/ 생성 (standards, guides, quickstart, changes, deploys, data, history, dev_plans 이동) - 프론트엔드 전용 폴더 frontend/ 생성 (api/ → frontend/api-specs/) - 기획팀 폴더 requests/ 생성 - plans/ → dev/dev_plans/ 이름 변경 - README.md 신규 (사람용 안내), INDEX.md 재작성 (Claude Code용) - resources.md 신규 (노션 링크용, assets/brochure 이관 예정) - CURRENT_WORKS.md 삭제, TODO.md → dev/ 이동 - 전체 참조 경로 업데이트 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
75
dev/changes/20260122_card_transaction_dashboard_api.md
Normal file
75
dev/changes/20260122_card_transaction_dashboard_api.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# 변경 내용 요약
|
||||
|
||||
**날짜:** 2026-01-22
|
||||
**작업자:** Claude Code
|
||||
**계획 문서:** docs/dev_plans/card-management-section-plan.md
|
||||
**Phase:** 1.1 카드 거래 대시보드 API 개발
|
||||
|
||||
## 📋 변경 개요
|
||||
CEO 대시보드 카드/가지급금 관리 섹션(cm1)의 모달 팝업용 카드 거래 대시보드 API 엔드포인트 신규 추가.
|
||||
기존 summary API를 확장하여 월별 추이, 사용자별 비율, 최근 거래 목록을 포함한 상세 데이터 제공.
|
||||
|
||||
## 📁 수정된 파일
|
||||
- `api/app/Services/CardTransactionService.php` - dashboard() 메서드 및 헬퍼 메서드 추가
|
||||
- `api/app/Http/Controllers/Api/V1/CardTransactionController.php` - dashboard() 액션 추가
|
||||
- `api/routes/api.php` - /dashboard 라우트 등록
|
||||
- `api/app/Swagger/v1/CardTransactionApi.php` - 대시보드 스키마 및 엔드포인트 문서화
|
||||
|
||||
## 🔧 상세 변경 사항
|
||||
|
||||
### 1. CardTransactionService.php
|
||||
**신규 메서드:**
|
||||
- `dashboard()` - 대시보드 전체 데이터 반환
|
||||
- `getMonthTotal()` - 특정 기간 카드 사용액 합계 (private)
|
||||
- `getMonthlyTrend()` - 최근 N개월 월별 추이 (private)
|
||||
- `getUserRatio()` - 사용자별 카드 사용 비율 (private)
|
||||
- `getRecentTransactions()` - 최근 거래 목록 (private)
|
||||
|
||||
**응답 구조:**
|
||||
```php
|
||||
[
|
||||
'summary' => [
|
||||
'current_month_total' => float,
|
||||
'previous_month_total' => float,
|
||||
'change_rate' => float,
|
||||
'unprocessed_count' => int,
|
||||
],
|
||||
'monthly_trend' => [...],
|
||||
'user_ratio' => [...],
|
||||
'recent_transactions' => [...],
|
||||
]
|
||||
```
|
||||
|
||||
### 2. CardTransactionController.php
|
||||
**신규 액션:**
|
||||
```php
|
||||
public function dashboard(): JsonResponse
|
||||
```
|
||||
|
||||
### 3. api/routes/api.php
|
||||
**신규 라우트:**
|
||||
```php
|
||||
Route::get('/dashboard', [CardTransactionController::class, 'dashboard'])
|
||||
->name('v1.card-transactions.dashboard');
|
||||
```
|
||||
|
||||
### 4. CardTransactionApi.php (Swagger)
|
||||
**신규 스키마:**
|
||||
- `CardTransactionDashboard` - 대시보드 응답 전체 구조
|
||||
|
||||
**신규 엔드포인트:**
|
||||
- `GET /api/v1/card-transactions/dashboard`
|
||||
|
||||
## ✅ 테스트 체크리스트
|
||||
- [x] Pint 코드 스타일 검증 통과
|
||||
- [x] 라우트 등록 확인 (php artisan route:list)
|
||||
- [x] Swagger 문서 생성 완료
|
||||
- [ ] API 호출 테스트 (Swagger UI)
|
||||
- [ ] 프론트엔드 연동 테스트
|
||||
|
||||
## ⚠️ 배포 시 주의사항
|
||||
특이사항 없음 (DB 스키마 변경 없음)
|
||||
|
||||
## 🔗 관련 문서
|
||||
- 계획 문서: `docs/dev_plans/card-management-section-plan.md`
|
||||
- 기존 API 문서: `api/app/Swagger/v1/CardTransactionApi.php`
|
||||
Reference in New Issue
Block a user