2025-11-11 11:30:17 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Swagger\v1;
|
|
|
|
|
|
|
|
|
|
/**
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Tag(name="Items", description="품목 관리 (Product CRUD)")
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="Item",
|
|
|
|
|
* type="object",
|
2025-11-17 11:22:49 +09:00
|
|
|
* required={"id","code","name","product_type","unit"},
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
|
|
|
|
* @OA\Property(property="id", type="integer", example=1),
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Property(property="code", type="string", example="P-001"),
|
|
|
|
|
* @OA\Property(property="name", type="string", example="스크린 제품 A"),
|
|
|
|
|
* @OA\Property(property="product_type", type="string", example="FG", description="FG,PT,SM,RM,CS"),
|
|
|
|
|
* @OA\Property(property="unit", type="string", example="EA"),
|
|
|
|
|
* @OA\Property(property="category_id", type="integer", nullable=true, example=1),
|
|
|
|
|
* @OA\Property(property="description", type="string", nullable=true, example="제품 설명"),
|
|
|
|
|
* @OA\Property(property="is_sellable", type="boolean", example=true),
|
|
|
|
|
* @OA\Property(property="is_purchasable", type="boolean", example=false),
|
|
|
|
|
* @OA\Property(property="is_producible", type="boolean", example=false),
|
|
|
|
|
* @OA\Property(property="safety_stock", type="integer", nullable=true, example=10),
|
|
|
|
|
* @OA\Property(property="lead_time", type="integer", nullable=true, example=7),
|
|
|
|
|
* @OA\Property(property="is_variable_size", type="boolean", example=false),
|
|
|
|
|
* @OA\Property(property="product_category", type="string", nullable=true, example="SCREEN"),
|
|
|
|
|
* @OA\Property(property="part_type", type="string", nullable=true, example="ASSEMBLY"),
|
|
|
|
|
* @OA\Property(
|
|
|
|
|
* property="attributes",
|
|
|
|
|
* type="object",
|
|
|
|
|
* nullable=true,
|
|
|
|
|
* description="동적 속성 (JSON)",
|
|
|
|
|
* example={"color": "black", "weight": 5.5}
|
|
|
|
|
* ),
|
|
|
|
|
* @OA\Property(property="created_at", type="string", example="2025-11-14 10:00:00"),
|
|
|
|
|
* @OA\Property(property="updated_at", type="string", example="2025-11-14 10:10:00")
|
2025-11-11 11:30:17 +09:00
|
|
|
* )
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
2025-11-17 11:22:49 +09:00
|
|
|
* schema="ItemCreateRequest",
|
2025-11-11 11:30:17 +09:00
|
|
|
* type="object",
|
2025-11-17 11:22:49 +09:00
|
|
|
* required={"code","name","product_type","unit"},
|
|
|
|
|
*
|
|
|
|
|
* @OA\Property(property="code", type="string", maxLength=50, example="P-001"),
|
|
|
|
|
* @OA\Property(property="name", type="string", maxLength=255, example="스크린 제품 A"),
|
|
|
|
|
* @OA\Property(property="product_type", type="string", example="FG", description="FG,PT,SM,RM,CS"),
|
|
|
|
|
* @OA\Property(property="unit", type="string", maxLength=20, example="EA"),
|
|
|
|
|
* @OA\Property(property="category_id", type="integer", nullable=true, example=1),
|
|
|
|
|
* @OA\Property(property="description", type="string", nullable=true, example="제품 설명"),
|
|
|
|
|
* @OA\Property(property="is_sellable", type="boolean", nullable=true, example=true),
|
|
|
|
|
* @OA\Property(property="is_purchasable", type="boolean", nullable=true, example=false),
|
|
|
|
|
* @OA\Property(property="is_producible", type="boolean", nullable=true, example=false),
|
|
|
|
|
* @OA\Property(property="safety_stock", type="integer", nullable=true, example=10),
|
|
|
|
|
* @OA\Property(property="lead_time", type="integer", nullable=true, example=7),
|
|
|
|
|
* @OA\Property(property="is_variable_size", type="boolean", nullable=true, example=false),
|
|
|
|
|
* @OA\Property(property="product_category", type="string", nullable=true, example="SCREEN"),
|
|
|
|
|
* @OA\Property(property="part_type", type="string", nullable=true, example="ASSEMBLY"),
|
|
|
|
|
* @OA\Property(
|
|
|
|
|
* property="attributes",
|
|
|
|
|
* type="object",
|
|
|
|
|
* nullable=true,
|
|
|
|
|
* description="동적 속성 (JSON)"
|
|
|
|
|
* )
|
2025-11-11 11:30:17 +09:00
|
|
|
* )
|
|
|
|
|
*
|
|
|
|
|
* @OA\Schema(
|
2025-11-17 11:22:49 +09:00
|
|
|
* schema="ItemUpdateRequest",
|
2025-11-11 11:30:17 +09:00
|
|
|
* type="object",
|
|
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Property(property="code", type="string", maxLength=50, example="P-001"),
|
|
|
|
|
* @OA\Property(property="name", type="string", maxLength=255, example="스크린 제품 A"),
|
|
|
|
|
* @OA\Property(property="product_type", type="string", example="FG", description="FG,PT,SM,RM,CS"),
|
|
|
|
|
* @OA\Property(property="unit", type="string", maxLength=20, example="EA"),
|
|
|
|
|
* @OA\Property(property="category_id", type="integer", nullable=true, example=1),
|
|
|
|
|
* @OA\Property(property="description", type="string", nullable=true, example="제품 설명"),
|
|
|
|
|
* @OA\Property(property="is_sellable", type="boolean", nullable=true, example=true),
|
|
|
|
|
* @OA\Property(property="is_purchasable", type="boolean", nullable=true, example=false),
|
|
|
|
|
* @OA\Property(property="is_producible", type="boolean", nullable=true, example=false),
|
|
|
|
|
* @OA\Property(property="safety_stock", type="integer", nullable=true, example=10),
|
|
|
|
|
* @OA\Property(property="lead_time", type="integer", nullable=true, example=7),
|
|
|
|
|
* @OA\Property(property="is_variable_size", type="boolean", nullable=true, example=false),
|
|
|
|
|
* @OA\Property(property="product_category", type="string", nullable=true, example="SCREEN"),
|
|
|
|
|
* @OA\Property(property="part_type", type="string", nullable=true, example="ASSEMBLY"),
|
2025-11-11 11:30:17 +09:00
|
|
|
* @OA\Property(
|
2025-11-17 11:22:49 +09:00
|
|
|
* property="attributes",
|
|
|
|
|
* type="object",
|
|
|
|
|
* nullable=true,
|
|
|
|
|
* description="동적 속성 (JSON)"
|
|
|
|
|
* )
|
2025-11-11 11:30:17 +09:00
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
class ItemsApi
|
|
|
|
|
{
|
|
|
|
|
/**
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Post(
|
2025-11-11 11:30:17 +09:00
|
|
|
* path="/api/v1/items",
|
|
|
|
|
* tags={"Items"},
|
2025-11-17 11:22:49 +09:00
|
|
|
* summary="품목 생성",
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\RequestBody(
|
|
|
|
|
* required=true,
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\JsonContent(ref="#/components/schemas/ItemCreateRequest")
|
2025-11-11 11:30:17 +09:00
|
|
|
* ),
|
|
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="성공",
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\JsonContent(
|
|
|
|
|
* type="object",
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Property(property="success", type="boolean", example=true),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="품목이 등록되었습니다."),
|
|
|
|
|
* @OA\Property(property="data", ref="#/components/schemas/Item")
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function store() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/api/v1/items/code/{code}",
|
|
|
|
|
* tags={"Items"},
|
|
|
|
|
* summary="품목 코드로 상세 조회",
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Parameter(name="code", in="path", required=true, @OA\Schema(type="string"), example="P-001"),
|
|
|
|
|
* @OA\Parameter(name="include_bom", in="query", @OA\Schema(type="boolean"), example=false),
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
2025-11-17 11:22:49 +09:00
|
|
|
* description="성공",
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
|
|
|
|
* @OA\JsonContent(
|
2025-11-17 11:22:49 +09:00
|
|
|
* type="object",
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Property(property="success", type="boolean", example=true),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="품목을 조회했습니다."),
|
|
|
|
|
* @OA\Property(property="data", ref="#/components/schemas/Item")
|
2025-11-11 11:30:17 +09:00
|
|
|
* )
|
2025-11-17 11:22:49 +09:00
|
|
|
* )
|
2025-11-11 11:30:17 +09:00
|
|
|
* )
|
|
|
|
|
*/
|
2025-11-17 11:22:49 +09:00
|
|
|
public function showByCode() {}
|
2025-11-11 11:30:17 +09:00
|
|
|
|
|
|
|
|
/**
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Put(
|
|
|
|
|
* path="/api/v1/items/{code}",
|
2025-11-11 11:30:17 +09:00
|
|
|
* tags={"Items"},
|
2025-11-17 11:22:49 +09:00
|
|
|
* summary="품목 수정",
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Parameter(name="code", in="path", required=true, @OA\Schema(type="string"), example="P-001"),
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\RequestBody(
|
2025-11-11 11:30:17 +09:00
|
|
|
* required=true,
|
|
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\JsonContent(ref="#/components/schemas/ItemUpdateRequest")
|
2025-11-11 11:30:17 +09:00
|
|
|
* ),
|
|
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
|
|
|
|
* description="성공",
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\JsonContent(
|
|
|
|
|
* type="object",
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Property(property="success", type="boolean", example=true),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="품목이 수정되었습니다."),
|
|
|
|
|
* @OA\Property(property="data", ref="#/components/schemas/Item")
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function update() {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Delete(
|
|
|
|
|
* path="/api/v1/items/{code}",
|
|
|
|
|
* tags={"Items"},
|
|
|
|
|
* summary="품목 삭제",
|
|
|
|
|
* security={{"ApiKeyAuth": {}, "BearerAuth": {}}},
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Parameter(name="code", in="path", required=true, @OA\Schema(type="string"), example="P-001"),
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response=200,
|
2025-11-17 11:22:49 +09:00
|
|
|
* description="성공",
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
|
|
|
|
* @OA\JsonContent(
|
2025-11-17 11:22:49 +09:00
|
|
|
* type="object",
|
2025-11-11 11:30:17 +09:00
|
|
|
*
|
2025-11-17 11:22:49 +09:00
|
|
|
* @OA\Property(property="success", type="boolean", example=true),
|
|
|
|
|
* @OA\Property(property="message", type="string", example="품목이 삭제되었습니다."),
|
|
|
|
|
* @OA\Property(property="data", type="string", example="success")
|
|
|
|
|
* )
|
|
|
|
|
* )
|
2025-11-11 11:30:17 +09:00
|
|
|
* )
|
|
|
|
|
*/
|
2025-11-17 11:22:49 +09:00
|
|
|
public function destroy() {}
|
|
|
|
|
}
|