<?php

namespace App\Swagger\v1;

/**
 * @OA\Tag(name="ClientGroup", description="고객 그룹 관리")
 *
 * @OA\Schema(
 *   schema="ClientGroup",
 *   type="object",
 *   required={"id","group_code","group_name","price_rate"},
 *
 *   @OA\Property(property="id", type="integer", example=1),
 *   @OA\Property(property="tenant_id", type="integer", example=1),
 *   @OA\Property(property="group_code", type="string", example="VIP"),
 *   @OA\Property(property="group_name", type="string", example="VIP 고객"),
 *   @OA\Property(property="price_rate", type="number", format="decimal", example=0.9, description="가격 배율 (1.0=기준가, 0.9=90%, 1.1=110%)"),
 *   @OA\Property(property="is_active", type="boolean", example=true),
 *   @OA\Property(property="created_at", type="string", example="2025-10-01 12:00:00"),
 *   @OA\Property(property="updated_at", type="string", example="2025-10-01 12:00:00")
 * )
 *
 * @OA\Schema(
 *   schema="ClientGroupPagination",
 *   type="object",
 *
 *   @OA\Property(property="current_page", type="integer", example=1),
 *   @OA\Property(
 *     property="data",
 *     type="array",
 *
 *     @OA\Items(ref="#/components/schemas/ClientGroup")
 *   ),
 *
 *   @OA\Property(property="first_page_url", type="string", example="/api/v1/client-groups?page=1"),
 *   @OA\Property(property="from", type="integer", example=1),
 *   @OA\Property(property="last_page", type="integer", example=3),
 *   @OA\Property(property="last_page_url", type="string", example="/api/v1/client-groups?page=3"),
 *   @OA\Property(
 *     property="links",
 *     type="array",
 *
 *     @OA\Items(type="object",
 *
 *       @OA\Property(property="url", type="string", nullable=true, example=null),
 *       @OA\Property(property="label", type="string", example="&laquo; Previous"),
 *       @OA\Property(property="active", type="boolean", example=false)
 *     )
 *   ),
 *   @OA\Property(property="next_page_url", type="string", nullable=true, example="/api/v1/client-groups?page=2"),
 *   @OA\Property(property="path", type="string", example="/api/v1/client-groups"),
 *   @OA\Property(property="per_page", type="integer", example=20),
 *   @OA\Property(property="prev_page_url", type="string", nullable=true, example=null),
 *   @OA\Property(property="to", type="integer", example=20),
 *   @OA\Property(property="total", type="integer", example=50)
 * )
 *
 * @OA\Schema(
 *   schema="ClientGroupCreateRequest",
 *   type="object",
 *   required={"group_code","group_name","price_rate"},
 *
 *   @OA\Property(property="group_code", type="string", maxLength=30, example="VIP", description="그룹 코드"),
 *   @OA\Property(property="group_name", type="string", maxLength=100, example="VIP 고객", description="그룹명"),
 *   @OA\Property(property="price_rate", type="number", format="decimal", example=0.9, description="가격 배율 (1.0=기준가)"),
 *   @OA\Property(property="is_active", type="boolean", example=true, description="활성 여부")
 * )
 *
 * @OA\Schema(
 *   schema="ClientGroupUpdateRequest",
 *   type="object",
 *
 *   @OA\Property(property="group_code", type="string", maxLength=30),
 *   @OA\Property(property="group_name", type="string", maxLength=100),
 *   @OA\Property(property="price_rate", type="number", format="decimal"),
 *   @OA\Property(property="is_active", type="boolean")
 * )
 */
class ClientGroupApi
{
    /**
     * @OA\Get(
     *   path="/api/v1/client-groups",
     *   tags={"ClientGroup"},
     *   summary="고객 그룹 목록",
     *   security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *   @OA\Parameter(name="page", in="query", @OA\Schema(type="integer", example=1)),
     *   @OA\Parameter(name="size", in="query", @OA\Schema(type="integer", example=20)),
     *   @OA\Parameter(name="q", in="query", description="그룹 코드/이름 검색", @OA\Schema(type="string")),
     *   @OA\Parameter(name="only_active", in="query", @OA\Schema(type="boolean")),
     *
     *   @OA\Response(response=200, description="조회 성공",
     *
     *     @OA\JsonContent(allOf={
     *
     *       @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *       @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/ClientGroupPagination"))
     *     })
     *   ),
     *
     *   @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function index() {}

    /**
     * @OA\Get(
     *   path="/api/v1/client-groups/{id}",
     *   tags={"ClientGroup"},
     *   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/ClientGroup"))
     *     })
     *   ),
     *
     *   @OA\Response(response=404, description="데이터 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function show() {}

    /**
     * @OA\Post(
     *   path="/api/v1/client-groups",
     *   tags={"ClientGroup"},
     *   summary="고객 그룹 생성",
     *   description="고객 그룹을 생성합니다. 같은 group_code로 이전에 삭제된 그룹이 있으면 자동으로 복원하고 새 데이터로 업데이트합니다.",
     *   security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *   @OA\RequestBody(required=true, @OA\JsonContent(ref="#/components/schemas/ClientGroupCreateRequest")),
     *
     *   @OA\Response(response=200, description="생성 성공 (또는 삭제된 데이터 복원)",
     *
     *     @OA\JsonContent(allOf={
     *
     *       @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *       @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/ClientGroup"))
     *     })
     *   ),
     *
     *   @OA\Response(response=400, description="검증 실패 또는 중복 코드", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function store() {}

    /**
     * @OA\Put(
     *   path="/api/v1/client-groups/{id}",
     *   tags={"ClientGroup"},
     *   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/ClientGroupUpdateRequest")),
     *
     *   @OA\Response(response=200, description="수정 성공",
     *
     *     @OA\JsonContent(allOf={
     *
     *       @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *       @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/ClientGroup"))
     *     })
     *   )
     * )
     */
    public function update() {}

    /**
     * @OA\Delete(
     *   path="/api/v1/client-groups/{id}",
     *   tags={"ClientGroup"},
     *   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"))
     * )
     */
    public function destroy() {}

    /**
     * @OA\Patch(
     *   path="/api/v1/client-groups/{id}/toggle",
     *   tags={"ClientGroup"},
     *   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/ClientGroup"))
     *     })
     *   )
     * )
     */
    public function toggle() {}
}
