feat: 거래처 통계 및 일괄삭제 API 추가 (Phase 2.2)

- ClientService: stats(), bulkDestroy() 메서드 추가
- ClientController: stats(), bulkDestroy() 액션 추가
- routes/api.php: /clients/stats, /clients/bulk 라우트 추가
- 악성채권 보유 거래처 통계 계산 (BadDebt 연계)
- 주문 있는 거래처는 삭제 건너뜀

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-01-09 16:46:25 +09:00
parent 00f57ce244
commit da2eddead4
3 changed files with 93 additions and 1 deletions

View File

@@ -921,6 +921,8 @@
// Clients (거래처 관리)
Route::prefix('clients')->group(function () {
Route::get('/stats', [ClientController::class, 'stats'])->name('v1.clients.stats'); // 통계
Route::delete('/bulk', [ClientController::class, 'bulkDestroy'])->name('v1.clients.bulk-destroy'); // 일괄 삭제
Route::get('', [ClientController::class, 'index'])->name('v1.clients.index'); // 목록
Route::post('', [ClientController::class, 'store'])->name('v1.clients.store'); // 생성
Route::get('/{id}', [ClientController::class, 'show'])->whereNumber('id')->name('v1.clients.show'); // 단건