style: Laravel Pint 코드 포맷팅 적용

- PSR-12 스타일 가이드 준수
- 302개 파일 스타일 이슈 자동 수정
- 코드 로직 변경 없음 (포맷팅만)
This commit is contained in:
2025-11-06 17:45:49 +09:00
parent 48e76432ee
commit cc206fdbed
294 changed files with 4476 additions and 2561 deletions

View File

@@ -12,10 +12,12 @@
* ========= 공용 스키마(이 파일에서 사용하는 것만 정의) =========
*
* 트리 노드 스키마 (재귀)
*
* @OA\Schema(
* schema="BomTreeNode",
* type="object",
* description="BOM 트리 한 노드(제품/자재 공통)",
*
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="type", type="string", example="PRODUCT", description="PRODUCT / MATERIAL 등"),
* @OA\Property(property="code", type="string", example="PRD-001"),
@@ -34,24 +36,29 @@
* property="children",
* type="array",
* description="자식 노드 목록(없으면 빈 배열)",
*
* @OA\Items(ref="#/components/schemas/BomTreeNode")
* )
* )
*
* BOM 카테고리 사용/추천 항목
*
* @OA\Schema(
* schema="BomCategoryStat",
* type="object",
*
* @OA\Property(property="category_id", type="integer", nullable=true, example=1),
* @OA\Property(property="category_name", type="string", example="기본"),
* @OA\Property(property="count", type="integer", example=5, description="해당 카테고리를 사용하는 BOM 항목 수(빈도)")
* )
*
* BOM 전체 교체 저장용 스키마
*
* @OA\Schema(
* schema="BomReplaceItem",
* type="object",
* required={"ref_type","ref_id","quantity"},
*
* @OA\Property(property="ref_type", type="string", enum={"MATERIAL","PRODUCT"}, example="MATERIAL", description="참조 타입"),
* @OA\Property(property="ref_id", type="integer", example=201, description="참조 ID (materials.id 또는 products.id)"),
* @OA\Property(property="quantity", type="number", format="float", example=2, description="수량(0 이상, 소수 허용)"),
@@ -62,11 +69,13 @@
* schema="BomReplaceCategory",
* type="object",
* required={"items"},
*
* @OA\Property(property="id", type="integer", nullable=true, example=1, description="프론트 임시 카테고리 ID(선택)"),
* @OA\Property(property="name", type="string", nullable=true, example="기본", description="프론트 카테고리명(선택)"),
* @OA\Property(
* property="items",
* type="array",
*
* @OA\Items(ref="#/components/schemas/BomReplaceItem")
* )
* )
@@ -75,9 +84,11 @@
* schema="BomReplaceRequest",
* type="object",
* required={"categories"},
*
* @OA\Property(
* property="categories",
* type="array",
*
* @OA\Items(ref="#/components/schemas/BomReplaceCategory")
* ),
* example={
@@ -104,6 +115,7 @@
* @OA\Schema(
* schema="BomReplaceResult",
* type="object",
*
* @OA\Property(property="deleted_count", type="integer", example=5, description="삭제된 기존 항목 수"),
* @OA\Property(property="inserted_count", type="integer", example=7, description="신규로 삽입된 항목 수")
* )
@@ -112,28 +124,35 @@ class ProductApi
{
/**
* 카테고리 목록 조회 (기존)
*
* @OA\Get(
* path="/api/v1/product/category",
* summary="제품 카테고리 목록 조회",
* description="제품 카테고리(최상위: parent_id = null) 리스트를 반환합니다.",
* tags={"Products"},
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Response(
* response=200,
* description="카테고리 목록 조회 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(
* property="data",
* type="array",
*
* @OA\Items(ref="#/components/schemas/ProductCategory")
* )
* )
* }
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
@@ -142,21 +161,26 @@ public function productCategoryIndex() {}
/**
* 제품 목록/검색
*
* @OA\Get(
* path="/api/v1/products",
* tags={"Products"},
* summary="제품 목록/검색",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(ref="#/components/parameters/Page"),
* @OA\Parameter(ref="#/components/parameters/Size"),
* @OA\Parameter(name="q", in="query", @OA\Schema(type="string"), description="코드/이름/설명 검색"),
* @OA\Parameter(name="category_id", in="query", @OA\Schema(type="integer")),
* @OA\Parameter(name="product_type", in="query", @OA\Schema(type="string", example="PRODUCT")),
* @OA\Parameter(name="active", in="query", @OA\Schema(type="integer", enum={0,1})),
*
* @OA\Response(
* response=200,
* description="조회 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/ProductPagination"))
* })
@@ -167,16 +191,21 @@ public function productsIndex() {}
/**
* 제품 생성
*
* @OA\Post(
* path="/api/v1/products",
* tags={"Products"},
* summary="제품 생성",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/ProductCreateRequest")),
*
* @OA\Response(
* response=200,
* description="생성 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Product"))
* })
@@ -187,20 +216,26 @@ public function productsStore() {}
/**
* 제품 단건
*
* @OA\Get(
* path="/api/v1/products/{id}",
* tags={"Products"},
* summary="제품 단건 조회",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="조회 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Product"))
* })
* ),
*
* @OA\Response(response=404, description="없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
@@ -208,17 +243,23 @@ public function productsShow() {}
/**
* 제품 수정
*
* @OA\Patch(
* path="/api/v1/products/{id}",
* tags={"Products"},
* summary="제품 수정",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/ProductUpdateRequest")),
*
* @OA\Response(
* response=200,
* description="수정 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Product"))
* })
@@ -229,12 +270,15 @@ public function productsUpdate() {}
/**
* 제품 삭제(soft)
*
* @OA\Delete(
* path="/api/v1/products/{id}",
* tags={"Products"},
* summary="제품 삭제(soft)",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\Response(response=200, description="삭제 성공", @OA\JsonContent(ref="#/components/schemas/ApiResponse"))
* )
*/
@@ -242,23 +286,31 @@ public function productsDestroy() {}
/**
* 제품 간편 검색(모달/드롭다운)
*
* @OA\Get(
* path="/api/v1/products/search",
* tags={"Products"},
* summary="제품 간편 검색",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="q", in="query", @OA\Schema(type="string")),
* @OA\Parameter(name="limit", in="query", @OA\Schema(type="integer"), description="기본 20"),
*
* @OA\Response(
* response=200,
* description="검색 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(
* property="data",
* type="array",
*
* @OA\Items(type="object",
*
* @OA\Property(property="id", type="integer", example=101),
* @OA\Property(property="code", type="string", example="PRD-001"),
* @OA\Property(property="name", type="string", example="스크린 모듈 KS001"),
@@ -276,18 +328,24 @@ public function productsSearch() {}
/**
* 제품 활성/비활성 토글
*
* @OA\Post(
* path="/api/v1/products/{id}/toggle",
* tags={"Products"},
* summary="제품 활성/비활성 토글",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="토글 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", type="object",
* @OA\Property(property="id", type="integer", example=101),
* @OA\Property(property="is_active", type="integer", example=0)
@@ -302,18 +360,24 @@ public function productsToggle() {}
/**
* BOM 항목 목록
*
* @OA\Get(
* path="/api/v1/products/{id}/bom/items",
* tags={"Products-BOM"},
* summary="BOM 항목 목록(제품+자재 병합)",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="조회 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/BomItem"))
* )
* })
@@ -324,19 +388,26 @@ public function bomItemsIndex() {}
/**
* BOM 대량 업서트
*
* @OA\Post(
* path="/api/v1/products/{id}/bom/items/bulk",
* tags={"Products-BOM"},
* summary="BOM 항목 대량 업서트",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/BomItemBulkUpsertRequest")),
*
* @OA\Response(
* response=200,
* description="업서트 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", type="object",
* @OA\Property(property="created", type="integer", example=2),
* @OA\Property(property="updated", type="integer", example=3)
@@ -350,18 +421,24 @@ public function bomItemsBulk() {}
/**
* BOM 단건 수정
*
* @OA\Patch(
* path="/api/v1/products/{id}/bom/items/{item}",
* tags={"Products-BOM"},
* summary="BOM 항목 단건 수정",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
* @OA\Parameter(name="item", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/BomItemUpdateRequest")),
*
* @OA\Response(
* response=200,
* description="수정 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/BomItem"))
* })
@@ -372,13 +449,16 @@ public function bomItemsUpdate() {}
/**
* BOM 단건 삭제
*
* @OA\Delete(
* path="/api/v1/products/{id}/bom/items/{item}",
* tags={"Products-BOM"},
* summary="BOM 항목 단건 삭제",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
* @OA\Parameter(name="item", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\Response(response=200, description="삭제 성공", @OA\JsonContent(ref="#/components/schemas/ApiResponse"))
* )
*/
@@ -386,13 +466,17 @@ public function bomItemsDestroy() {}
/**
* BOM 정렬 변경
*
* @OA\Post(
* path="/api/v1/products/{id}/bom/items/reorder",
* tags={"Products-BOM"},
* summary="BOM 정렬 변경",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/BomReorderRequest")),
*
* @OA\Response(response=200, description="저장 성공", @OA\JsonContent(ref="#/components/schemas/ApiResponse"))
* )
*/
@@ -400,18 +484,24 @@ public function bomItemsReorder() {}
/**
* BOM 요약(건수/합계 등)
*
* @OA\Get(
* path="/api/v1/products/{id}/bom/summary",
* tags={"Products-BOM"},
* summary="BOM 요약",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="요약 성공",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", type="object",
* @OA\Property(property="count", type="integer", example=5),
* @OA\Property(property="count_product", type="integer", example=2),
@@ -427,22 +517,30 @@ public function bomSummary() {}
/**
* BOM 유효성 검사
*
* @OA\Get(
* path="/api/v1/products/{id}/bom/validate",
* tags={"Products-BOM"},
* summary="BOM 유효성 검사",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="검증 결과",
*
* @OA\JsonContent(allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", type="object",
* @OA\Property(property="valid", type="boolean", example=false),
* @OA\Property(property="errors", type="array",
*
* @OA\Items(type="object",
*
* @OA\Property(property="id", type="integer", example=11),
* @OA\Property(property="error", type="string", example="DUPLICATE_ITEM")
* )
@@ -458,33 +556,42 @@ public function bomValidate() {}
/**
* BOM 전체 교체 저장
* 프론트에서 보낸 현재 BOM 상태로 기존 구성을 모두 삭제 후 재등록합니다.
*
* @OA\Post(
* path="/api/v1/products/{id}/bom",
* tags={"Products-BOM"},
* summary="BOM 구성 저장(구성 전체 교체)",
* description="기존 BOM을 모두 삭제하고, 전달된 categories/items 기준으로 다시 저장합니다.",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(
* name="id",
* in="path",
* required=true,
* description="상위(모델) 제품 ID",
*
* @OA\Schema(type="integer", example=123)
* ),
*
* @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/BomReplaceRequest")),
*
* @OA\Response(
* response=200,
* description="저장 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="message", type="string", example="BOM 항목이 저장되었습니다."),
* @OA\Property(property="data", ref="#/components/schemas/BomReplaceResult")
* )
* }
* )
* ),
*
* @OA\Response(response=400, description="잘못된 요청", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
@@ -497,29 +604,37 @@ public function bomReplace() {}
/**
* 제품별 사용 중인 BOM 카테고리 목록
*
* @OA\Get(
* path="/api/v1/products/{id}/bom/categories",
* tags={"Products-BOM"},
* summary="해당 제품에서 사용 중인 BOM 카테고리 목록",
* description="product_components 테이블에서 해당 제품(parent_product_id)의 카테고리(id/name)를 집계하여 반환합니다.",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(
* name="id",
* in="path",
* required=true,
* description="상위(모델) 제품 ID",
*
* @OA\Schema(type="integer", example=123)
* ),
*
* @OA\Response(
* response=200,
* description="조회 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(
* property="data",
* type="array",
*
* @OA\Items(ref="#/components/schemas/BomCategoryStat")
* )
* )
@@ -534,6 +649,7 @@ public function bomReplace() {}
* }
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
@@ -542,36 +658,46 @@ public function bomCategoriesForProduct() {}
/**
* 테넌트 전역 카테고리 추천(히스토리 기반)
*
* @OA\Get(
* path="/api/v1/products/bom/categories",
* tags={"Products-BOM"},
* summary="자주 사용된 BOM 카테고리 추천",
* description="테넌트 전체 product_components 데이터를 집계해 카테고리 사용 빈도가 높은 순으로 반환합니다. q로 부분 검색 가능합니다.",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(
* name="q",
* in="query",
* required=false,
* description="카테고리명 부분 검색",
*
* @OA\Schema(type="string", example="기")
* ),
*
* @OA\Parameter(
* name="limit",
* in="query",
* required=false,
* description="최대 항목 수(기본 20)",
*
* @OA\Schema(type="integer", example=20)
* ),
*
* @OA\Response(
* response=200,
* description="조회 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(
* property="data",
* type="array",
*
* @OA\Items(ref="#/components/schemas/BomCategoryStat")
* )
* )
@@ -587,6 +713,7 @@ public function bomCategoriesForProduct() {}
* }
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
@@ -595,27 +722,34 @@ public function bomCategoriesSuggest() {}
/**
* 제품 BOM 트리 조회
*
* @OA\Get(
* path="/api/v1/products/{id}/bom/tree",
* tags={"Products-BOM"},
* summary="제품 BOM 트리 조회(재귀)",
* description="특정 제품의 하위 구성(제품/자재)을 재귀적으로 트리 형태로 반환합니다. depth로 최대 깊이를 제한합니다(기본 10).",
* security={{"ApiKeyAuth": {}},{"BearerAuth": {}}},
*
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer", minimum=1), description="제품 ID"),
* @OA\Parameter(
* name="depth",
* in="query",
* required=false,
* description="재귀 깊이(루트=0). 기본 10",
*
* @OA\Schema(type="integer", minimum=0, maximum=50, default=10, example=5)
* ),
*
* @OA\Response(
* response=200,
* description="조회 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(
* property="data",
* type="object",
@@ -635,6 +769,7 @@ public function bomCategoriesSuggest() {}
* }
* )
* ),
*
* @OA\Response(response=400, description="잘못된 요청", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=404, description="대상 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),