diff --git a/app/Http/Controllers/Api/V1/CommonController.php b/app/Http/Controllers/Api/V1/CommonController.php index 6887263..fa7478e 100644 --- a/app/Http/Controllers/Api/V1/CommonController.php +++ b/app/Http/Controllers/Api/V1/CommonController.php @@ -3,17 +3,235 @@ namespace App\Http\Controllers\Api\V1; use App\Helpers\ApiResponse; +use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; +/** + * @OA\Tag( + * name="Settings - Common Codes", + * description="공통 코드 관리 API" + * ) + */ class CommonController { + /** + * @OA\Get( + * path="/api/v1/settings/common/code", + * summary="공통 코드 조회", + * description="테넌트의 활성화된 공통 코드 목록을 조회합니다.", + * tags={"Settings - Common Codes"}, + * security={{"ApiKeyAuth": {}}}, + * @OA\Response( + * response=200, + * description="공통 코드 조회 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="공통코드"), + * @OA\Property( + * property="data", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property(property="code_group", type="string", example="product_type"), + * @OA\Property(property="code", type="string", example="PRODUCT"), + * @OA\Property(property="name", type="string", example="제품"), + * @OA\Property(property="description", type="string", example="완제품"), + * @OA\Property(property="is_active", type="boolean", example=true) + * ) + * ) + * ) + * ) + * ) + */ public static function getComeCode() { return ApiResponse::handle(function () { - DB::table('common_codes') + return DB::table('common_codes') ->select(['code_group', 'code', 'name', 'description', 'is_active']) ->where('tenant_id', app('tenant_id')) ->get(); }, '공통코드'); } + + /** + * @OA\Get( + * path="/api/v1/settings/common", + * summary="공통 코드 목록 조회", + * description="전체 공통 코드 목록을 조회합니다.", + * tags={"Settings - Common Codes"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Response( + * response=200, + * description="공통 코드 목록 조회 성공" + * ) + * ) + */ + public function list(Request $request) + { + return ApiResponse::handle(function () use ($request) { + // Service implementation needed + return []; + }, __('message.fetched')); + } + + /** + * @OA\Get( + * path="/api/v1/settings/common/{group}", + * summary="특정 그룹 공통 코드 조회", + * description="특정 그룹의 공통 코드 목록을 조회합니다.", + * tags={"Settings - Common Codes"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="group", + * in="path", + * required=true, + * description="코드 그룹", + * @OA\Schema(type="string", example="product_type") + * ), + * @OA\Response( + * response=200, + * description="그룹 코드 조회 성공" + * ) + * ) + */ + public function index(Request $request, string $group) + { + return ApiResponse::handle(function () use ($group) { + // Service implementation needed + return []; + }, __('message.fetched')); + } + + /** + * @OA\Post( + * path="/api/v1/settings/common", + * summary="공통 코드 생성", + * description="새로운 공통 코드를 생성합니다.", + * tags={"Settings - Common Codes"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\RequestBody( + * required=true, + * @OA\JsonContent( + * type="object", + * @OA\Property(property="code_group", type="string", example="product_type"), + * @OA\Property(property="code", type="string", example="SERVICE"), + * @OA\Property(property="name", type="string", example="서비스"), + * @OA\Property(property="description", type="string", example="서비스 상품") + * ) + * ), + * @OA\Response( + * response=201, + * description="공통 코드 생성 성공" + * ), + * @OA\Response( + * response=409, + * description="중복된 공통 코드", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="중복된 공통 코드가 존재합니다.") + * ) + * ), + * @OA\Response( + * response=422, + * description="유효성 검사 실패", + * @OA\JsonContent(ref="#/components/schemas/ErrorResponse") + * ) + * ) + */ + public function store(Request $request) + { + return ApiResponse::handle(function () use ($request) { + // Service implementation needed + return []; + }, __('message.settings.common_code_saved')); + } + + /** + * @OA\Patch( + * path="/api/v1/settings/common/{id}", + * summary="공통 코드 수정", + * description="기존 공통 코드를 수정합니다.", + * tags={"Settings - Common Codes"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="id", + * in="path", + * required=true, + * description="공통 코드 ID", + * @OA\Schema(type="integer", example=1) + * ), + * @OA\RequestBody( + * required=true, + * @OA\JsonContent( + * type="object", + * @OA\Property(property="name", type="string", example="수정된 이름"), + * @OA\Property(property="description", type="string", example="수정된 설명") + * ) + * ), + * @OA\Response( + * response=200, + * description="공통 코드 수정 성공" + * ), + * @OA\Response( + * response=404, + * description="공통 코드를 찾을 수 없음", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="해당 공통 코드를 찾을 수 없습니다.") + * ) + * ), + * @OA\Response( + * response=422, + * description="유효성 검사 실패", + * @OA\JsonContent(ref="#/components/schemas/ErrorResponse") + * ) + * ) + */ + public function update(Request $request, int $id) + { + return ApiResponse::handle(function () use ($request, $id) { + // Service implementation needed + return []; + }, __('message.updated')); + } + + /** + * @OA\Delete( + * path="/api/v1/settings/common/{id}", + * summary="공통 코드 삭제", + * description="공통 코드를 삭제합니다.", + * tags={"Settings - Common Codes"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="id", + * in="path", + * required=true, + * description="공통 코드 ID", + * @OA\Schema(type="integer", example=1) + * ), + * @OA\Response( + * response=200, + * description="공통 코드 삭제 성공" + * ), + * @OA\Response( + * response=404, + * description="공통 코드를 찾을 수 없음", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="해당 공통 코드를 찾을 수 없습니다.") + * ) + * ) + * ) + */ + public function destroy(Request $request, int $id) + { + return ApiResponse::handle(function () use ($id) { + // Service implementation needed + return []; + }, __('message.deleted')); + } } diff --git a/app/Http/Controllers/Api/V1/FileController.php b/app/Http/Controllers/Api/V1/FileController.php index d2ff365..fec325d 100644 --- a/app/Http/Controllers/Api/V1/FileController.php +++ b/app/Http/Controllers/Api/V1/FileController.php @@ -7,9 +7,85 @@ use App\Services\FileService; use App\Helpers\ApiResponse; +/** + * @OA\Tag( + * name="Files", + * description="파일 관리 API" + * ) + */ class FileController extends Controller { - // 파일 업로드 + /** + * @OA\Post( + * path="/api/v1/file/upload", + * summary="파일 업로드", + * description="파일을 업로드합니다.", + * tags={"Files"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\RequestBody( + * required=true, + * @OA\MediaType( + * mediaType="multipart/form-data", + * @OA\Schema( + * type="object", + * @OA\Property( + * property="files[]", + * type="array", + * @OA\Items(type="string", format="binary"), + * description="업로드할 파일들" + * ) + * ) + * ) + * ), + * @OA\Response( + * response=201, + * description="파일 업로드 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="파일 업로드"), + * @OA\Property( + * property="data", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property(property="id", type="integer", example=1), + * @OA\Property(property="filename", type="string", example="document.pdf"), + * @OA\Property(property="path", type="string", example="/uploads/tenant/1/document.pdf"), + * @OA\Property(property="size", type="integer", example=1024) + * ) + * ) + * ) + * ), + * @OA\Response( + * response=400, + * description="파일 업로드 실패", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="파일 업로드에 실패했습니다.") + * ) + * ), + * @OA\Response( + * response=413, + * description="파일 크기 초과", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="파일 크기가 너무 큽니다.") + * ) + * ), + * @OA\Response( + * response=415, + * description="지원하지 않는 파일 형식", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="허용되지 않는 파일 형식입니다.") + * ) + * ) + * ) + */ public function upload(Request $request) { return ApiResponse::handle(function () use ($request) { @@ -17,7 +93,55 @@ public function upload(Request $request) }, '파일 업로드'); } - // 파일 목록 조회 + /** + * @OA\Get( + * path="/api/v1/file/list", + * summary="파일 목록 조회", + * description="파일 목록을 조회합니다.", + * tags={"Files"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="page", + * in="query", + * description="페이지 번호", + * @OA\Schema(type="integer", example=1) + * ), + * @OA\Parameter( + * name="size", + * in="query", + * description="페이지 크기", + * @OA\Schema(type="integer", example=10) + * ), + * @OA\Response( + * response=200, + * description="파일 목록 조회 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="파일 목록조회"), + * @OA\Property( + * property="data", + * type="object", + * @OA\Property(property="current_page", type="integer", example=1), + * @OA\Property(property="per_page", type="integer", example=10), + * @OA\Property(property="total", type="integer", example=25), + * @OA\Property( + * property="data", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property(property="id", type="integer", example=1), + * @OA\Property(property="filename", type="string", example="document.pdf"), + * @OA\Property(property="path", type="string", example="/uploads/tenant/1/document.pdf"), + * @OA\Property(property="size", type="integer", example=1024), + * @OA\Property(property="uploaded_at", type="string", format="date-time") + * ) + * ) + * ) + * ) + * ) + * ) + */ public function list(Request $request) { return ApiResponse::handle(function () use ($request) { @@ -25,7 +149,45 @@ public function list(Request $request) }, '파일 목록조회'); } - // 파일 삭제 + /** + * @OA\Delete( + * path="/api/v1/file/delete", + * summary="파일 삭제", + * description="파일을 삭제합니다.", + * tags={"Files"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\RequestBody( + * required=true, + * @OA\JsonContent( + * type="object", + * @OA\Property( + * property="file_ids", + * type="array", + * @OA\Items(type="integer"), + * example={1, 2, 3} + * ) + * ) + * ), + * @OA\Response( + * response=200, + * description="파일 삭제 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="파일 삭제") + * ) + * ), + * @OA\Response( + * response=404, + * description="파일을 찾을 수 없음", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="파일을 찾을 수 없습니다.") + * ) + * ) + * ) + */ public function delete(Request $request) { return ApiResponse::handle(function () use ($request) { @@ -33,7 +195,50 @@ public function delete(Request $request) }, '파일 삭제'); } - // 파일 정보 조회 (단건) + /** + * @OA\Get( + * path="/api/v1/file/find", + * summary="파일 정보 조회", + * description="특정 파일의 정보를 조회합니다.", + * tags={"Files"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="file_id", + * in="query", + * required=true, + * description="파일 ID", + * @OA\Schema(type="integer", example=1) + * ), + * @OA\Response( + * response=200, + * description="파일 정보 조회 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="파일 정보 조회"), + * @OA\Property( + * property="data", + * type="object", + * @OA\Property(property="id", type="integer", example=1), + * @OA\Property(property="filename", type="string", example="document.pdf"), + * @OA\Property(property="path", type="string", example="/uploads/tenant/1/document.pdf"), + * @OA\Property(property="size", type="integer", example=1024), + * @OA\Property(property="mime_type", type="string", example="application/pdf"), + * @OA\Property(property="uploaded_at", type="string", format="date-time") + * ) + * ) + * ), + * @OA\Response( + * response=404, + * description="파일을 찾을 수 없음", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="파일을 찾을 수 없습니다.") + * ) + * ) + * ) + */ public function findFile(Request $request) { return ApiResponse::handle(function () use ($request) { diff --git a/app/Http/Controllers/Api/V1/MaterialController.php b/app/Http/Controllers/Api/V1/MaterialController.php index 0a96d90..c2ba290 100644 --- a/app/Http/Controllers/Api/V1/MaterialController.php +++ b/app/Http/Controllers/Api/V1/MaterialController.php @@ -7,47 +7,272 @@ use App\Services\MaterialService; use App\Helpers\ApiResponse; +/** + * @OA\Tag( + * name="Products & Materials - Materials", + * description="자재 관리 API (Products 그룹 내 통합)" + * ) + */ class MaterialController extends Controller { - public function __construct(private MaterialService $service) {} + /** + * @OA\Get( + * path="/api/v1/products/materials", + * summary="자재 목록 조회", + * description="테넌트의 자재 목록을 조회합니다. (Products & Materials 통합 관리)", + * tags={"Products & Materials - Materials"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="page", + * in="query", + * description="페이지 번호", + * @OA\Schema(type="integer", example=1) + * ), + * @OA\Parameter( + * name="size", + * in="query", + * description="페이지 크기", + * @OA\Schema(type="integer", example=10) + * ), + * @OA\Parameter( + * name="q", + * in="query", + * description="검색어 (자재명, 코드)", + * @OA\Schema(type="string", example="스틸") + * ), + * @OA\Response( + * response=200, + * description="자재 목록 조회 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="조회 성공"), + * @OA\Property( + * property="data", + * type="object", + * @OA\Property(property="current_page", type="integer", example=1), + * @OA\Property(property="per_page", type="integer", example=10), + * @OA\Property(property="total", type="integer", example=25), + * @OA\Property( + * property="data", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property(property="id", type="integer", example=1), + * @OA\Property(property="material_code", type="string", example="MAT001"), + * @OA\Property(property="name", type="string", example="스틸파이프 10mm"), + * @OA\Property(property="specification", type="string", example="직경 10mm, 두께 2mm"), + * @OA\Property(property="unit", type="string", example="개"), + * @OA\Property(property="is_active", type="boolean", example=true) + * ) + * ) + * ) + * ) + * ) + * ) + */ public function index(Request $request) { return ApiResponse::handle(function () use ($request) { return $this->service->getMaterials($request->all()); - }, '제품 목록 조회'); + }, __('message.materials.fetched')); } - + /** + * @OA\Post( + * path="/api/v1/products/materials", + * summary="자재 등록", + * description="새로운 자재를 등록합니다.", + * tags={"Products & Materials - Materials"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\RequestBody( + * required=true, + * @OA\JsonContent( + * type="object", + * @OA\Property(property="material_code", type="string", example="MAT002"), + * @OA\Property(property="name", type="string", example="알루미늄 프로파일"), + * @OA\Property(property="specification", type="string", example="20x20x2mm"), + * @OA\Property(property="unit", type="string", example="m"), + * @OA\Property(property="description", type="string", example="알루미늄 프로파일 20x20") + * ) + * ), + * @OA\Response( + * response=201, + * description="자재 등록 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="자재가 등록되었습니다."), + * @OA\Property( + * property="data", + * type="object", + * @OA\Property(property="id", type="integer", example=2) + * ) + * ) + * ), + * @OA\Response( + * response=409, + * description="중복된 자재 코드", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="중복된 자재 코드입니다.") + * ) + * ), + * @OA\Response( + * response=422, + * description="유효성 검사 실패", + * @OA\JsonContent(ref="#/components/schemas/ErrorResponse") + * ) + * ) + */ public function store(Request $request) { return ApiResponse::handle(function () use ($request) { return $this->service->setMaterial($request->all()); - }, '제품 등록'); + }, __('message.materials.created')); } - + /** + * @OA\Get( + * path="/api/v1/products/materials/{id}", + * summary="자재 상세 조회", + * description="특정 자재의 상세 정보를 조회합니다.", + * tags={"Products & Materials - Materials"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="id", + * in="path", + * required=true, + * description="자재 ID", + * @OA\Schema(type="integer", example=1) + * ), + * @OA\Response( + * response=200, + * description="자재 상세 조회 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="조회 성공"), + * @OA\Property( + * property="data", + * type="object", + * @OA\Property(property="id", type="integer", example=1), + * @OA\Property(property="material_code", type="string", example="MAT001"), + * @OA\Property(property="name", type="string", example="스틸파이프 10mm"), + * @OA\Property(property="specification", type="string", example="직경 10mm, 두께 2mm"), + * @OA\Property(property="unit", type="string", example="개"), + * @OA\Property(property="description", type="string", example="스틸 파이프"), + * @OA\Property(property="is_active", type="boolean", example=true), + * @OA\Property(property="created_at", type="string", format="date-time"), + * @OA\Property(property="updated_at", type="string", format="date-time") + * ) + * ) + * ), + * @OA\Response( + * response=404, + * description="자재 정보를 찾을 수 없음", + * @OA\JsonContent(ref="#/components/schemas/ErrorResponse") + * ) + * ) + */ public function show(Request $request, int $id) { return ApiResponse::handle(function () use ($id) { return $this->service->getMaterial($id); - }, '특정제품 상세 조회'); + }, __('message.fetched')); } - + /** + * @OA\Patch( + * path="/api/v1/products/materials/{id}", + * summary="자재 수정", + * description="기존 자재 정보를 수정합니다.", + * tags={"Products & Materials - Materials"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="id", + * in="path", + * required=true, + * description="자재 ID", + * @OA\Schema(type="integer", example=1) + * ), + * @OA\RequestBody( + * required=true, + * @OA\JsonContent( + * type="object", + * @OA\Property(property="name", type="string", example="스틸파이프 12mm"), + * @OA\Property(property="specification", type="string", example="직경 12mm, 두께 2mm"), + * @OA\Property(property="description", type="string", example="수정된 스틸 파이프") + * ) + * ), + * @OA\Response( + * response=200, + * description="자재 수정 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="자재가 수정되었습니다.") + * ) + * ) + * ) + */ public function update(Request $request, int $id) { - return ApiResponse::handle(function () use ($id) { - return $this->service->updateMaterial($id); - }, '제품 수정'); + return ApiResponse::handle(function () use ($request, $id) { + return $this->service->updateMaterial($id, $request->all()); + }, __('message.materials.updated')); } - + /** + * @OA\Delete( + * path="/api/v1/products/materials/{id}", + * summary="자재 삭제", + * description="자재를 소프트 삭제합니다. 사용 중인 자재는 삭제할 수 없습니다.", + * tags={"Products & Materials - Materials"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="id", + * in="path", + * required=true, + * description="자재 ID", + * @OA\Schema(type="integer", example=1) + * ), + * @OA\Response( + * response=200, + * description="자재 삭제 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="자재가 삭제되었습니다.") + * ) + * ), + * @OA\Response( + * response=409, + * description="사용 중인 자재는 삭제 불가", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="사용 중인 자재는 삭제할 수 없습니다.") + * ) + * ), + * @OA\Response( + * response=404, + * description="자재 정보를 찾을 수 없음", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="자재 정보를 찾을 수 없습니다.") + * ) + * ) + * ) + */ public function destroy(Request $request, int $id) { return ApiResponse::handle(function () use ($id) { return $this->service->destroyMaterial($id); - }, '제품 삭제'); + }, __('message.materials.deleted')); } } diff --git a/app/Http/Controllers/Api/V1/TenantFieldSettingController.php b/app/Http/Controllers/Api/V1/TenantFieldSettingController.php index 83ec8e8..cbc5c70 100644 --- a/app/Http/Controllers/Api/V1/TenantFieldSettingController.php +++ b/app/Http/Controllers/Api/V1/TenantFieldSettingController.php @@ -7,9 +7,42 @@ use App\Services\TenantFieldSettingService; use App\Helpers\ApiResponse; +/** + * @OA\Tag( + * name="Settings - Fields", + * description="테넌트 필드 설정 관리 API" + * ) + */ class TenantFieldSettingController extends Controller { - // GET /v1/fields + /** + * @OA\Get( + * path="/api/v1/settings/fields", + * summary="테넌트 필드 설정 목록 조회", + * description="전역 + 테넌트별 병합된 필드 설정 효과값을 조회합니다.", + * tags={"Settings - Fields"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Response( + * response=200, + * description="필드 설정 목록 조회 성공", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=true), + * @OA\Property(property="message", type="string", example="조회 성공"), + * @OA\Property( + * property="data", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property(property="field_key", type="string", example="product_name_required"), + * @OA\Property(property="field_value", type="string", example="true"), + * @OA\Property(property="source", type="string", example="tenant", description="global 또는 tenant") + * ) + * ) + * ) + * ) + * ) + */ public function index(Request $request) { return ApiResponse::handle(function () use ($request) { @@ -17,7 +50,49 @@ public function index(Request $request) }, '테넌트 필드 효과값 목록 조회'); } - // PUT /v1/fields/bulk + /** + * @OA\Put( + * path="/api/v1/settings/fields/bulk", + * summary="테넌트 필드 설정 대량 저장", + * description="여러 필드 설정을 트랜잭션으로 일괄 저장합니다.", + * tags={"Settings - Fields"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\RequestBody( + * required=true, + * @OA\JsonContent( + * type="object", + * @OA\Property( + * property="fields", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property(property="field_key", type="string", example="product_name_required"), + * @OA\Property(property="field_value", type="string", example="true") + * ) + * ) + * ) + * ), + * @OA\Response( + * response=200, + * description="대량 저장 성공", + * @OA\JsonContent(ref="#/components/schemas/ApiResponse") + * ), + * @OA\Response( + * response=400, + * description="유효하지 않은 필드 타입", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="유효하지 않은 필드 타입입니다.") + * ) + * ), + * @OA\Response( + * response=422, + * description="유효성 검사 실패", + * @OA\JsonContent(ref="#/components/schemas/ErrorResponse") + * ) + * ) + */ public function bulkUpsert(Request $request) { return ApiResponse::handle(function () use ($request) { @@ -25,7 +100,52 @@ public function bulkUpsert(Request $request) }, '테넌트 필드 설정 대량 저장'); } - // PATCH /v1/fields/{key} + /** + * @OA\Patch( + * path="/api/v1/settings/fields/{key}", + * summary="테넌트 필드 설정 단건 수정", + * description="특정 필드 설정을 개별적으로 수정합니다.", + * tags={"Settings - Fields"}, + * security={{"ApiKeyAuth": {}, "BearerAuth": {}}}, + * @OA\Parameter( + * name="key", + * in="path", + * required=true, + * description="필드 키", + * @OA\Schema(type="string", example="product_name_required") + * ), + * @OA\RequestBody( + * required=true, + * @OA\JsonContent( + * type="object", + * @OA\Property(property="field_value", type="string", example="false") + * ) + * ), + * @OA\Response( + * response=200, + * description="필드 설정 수정 성공", + * @OA\JsonContent(ref="#/components/schemas/ApiResponse") + * ), + * @OA\Response( + * response=404, + * description="필드 설정을 찾을 수 없음", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="해당 필드 설정을 찾을 수 없습니다.") + * ) + * ), + * @OA\Response( + * response=400, + * description="유효하지 않은 필드 타입", + * @OA\JsonContent( + * type="object", + * @OA\Property(property="success", type="boolean", example=false), + * @OA\Property(property="message", type="string", example="유효하지 않은 필드 타입입니다.") + * ) + * ) + * ) + */ public function updateOne(Request $request, string $key) { return ApiResponse::handle(function () use ($request, $key) { diff --git a/app/Swagger/v1/BomApi.php b/app/Swagger/v1/BomApi.php deleted file mode 100644 index 5a4b6d8..0000000 --- a/app/Swagger/v1/BomApi.php +++ /dev/null @@ -1,6 +0,0 @@ -