feat: ClientGroup 및 Pricing API 완성 및 Swagger 문서 작성

- ClientGroupService 구현: 고객 그룹 관리 비즈니스 로직 (CRUD + toggle)
- ClientGroupController 구현: 6개 REST API 엔드포인트
- PricingController 구현: 5개 가격 관리 API 엔드포인트
- routes/api.php에 client-groups, pricing 라우트 등록
- ClientGroupApi.php Swagger 문서 작성 (OpenAPI 3.0)
- PricingApi.php Swagger 문서 작성 (OpenAPI 3.0)
- l5-swagger 재생성 완료

추가된 파일:
- app/Services/ClientGroupService.php
- app/Http/Controllers/Api/V1/ClientGroupController.php
- app/Http/Controllers/Api/V1/PricingController.php
- app/Swagger/v1/ClientGroupApi.php
- app/Swagger/v1/PricingApi.php

수정된 파일:
- routes/api.php (라우트 11개 추가)
- CURRENT_WORKS.md (작업 내용 문서화)

API 엔드포인트:
- GET/POST/PUT/DELETE /api/v1/client-groups
- GET/POST /api/v1/pricing (show, bulk, upsert 포함)
This commit is contained in:
2025-10-13 22:06:42 +09:00
parent a6b06be61d
commit b6f36cc967
7 changed files with 966 additions and 1 deletions

View File

@@ -27,7 +27,8 @@
use App\Http\Controllers\Api\V1\CategoryTemplateController;
use App\Http\Controllers\Api\V1\ClassificationController;
use App\Http\Controllers\Api\V1\ClientController;
use App\Http\Controllers\Api\V1\ClientGroupController;
use App\Http\Controllers\Api\V1\PricingController;
// 설계 전용 (디자인 네임스페이스)
use App\Http\Controllers\Api\V1\Design\DesignModelController as DesignModelController;
@@ -292,6 +293,25 @@
Route::patch ('/{id}/toggle', [ClientController::class, 'toggle'])->whereNumber('id')->name('v1.clients.toggle'); // 활성/비활성
});
// Client Groups (고객 그룹 관리)
Route::prefix('client-groups')->group(function () {
Route::get ('', [ClientGroupController::class, 'index'])->name('v1.client-groups.index'); // 목록
Route::post ('', [ClientGroupController::class, 'store'])->name('v1.client-groups.store'); // 생성
Route::get ('/{id}', [ClientGroupController::class, 'show'])->whereNumber('id')->name('v1.client-groups.show'); // 단건
Route::put ('/{id}', [ClientGroupController::class, 'update'])->whereNumber('id')->name('v1.client-groups.update'); // 수정
Route::delete('/{id}', [ClientGroupController::class, 'destroy'])->whereNumber('id')->name('v1.client-groups.destroy'); // 삭제
Route::patch ('/{id}/toggle', [ClientGroupController::class, 'toggle'])->whereNumber('id')->name('v1.client-groups.toggle'); // 활성/비활성
});
// Pricing (가격 이력 관리)
Route::prefix('pricing')->group(function () {
Route::get ('', [PricingController::class, 'index'])->name('v1.pricing.index'); // 목록
Route::get ('/show', [PricingController::class, 'show'])->name('v1.pricing.show'); // 단일 항목 가격 조회
Route::post ('/bulk', [PricingController::class, 'bulk'])->name('v1.pricing.bulk'); // 여러 항목 일괄 조회
Route::post ('/upsert', [PricingController::class, 'upsert'])->name('v1.pricing.upsert'); // 가격 등록/수정
Route::delete('/{id}', [PricingController::class, 'destroy'])->whereNumber('id')->name('v1.pricing.destroy'); // 삭제
});
// Products & Materials (제품/자재 통합 관리)
Route::prefix('products')->group(function (){