<?php

namespace App\Swagger\v1;

/**
 * @OA\Tag(name="Leaves", description="휴가 관리 (HR)")
 *
 * @OA\Schema(
 *     schema="Leave",
 *     type="object",
 *     description="휴가 정보",
 *
 *     @OA\Property(property="id", type="integer", example=1, description="휴가 ID"),
 *     @OA\Property(property="tenant_id", type="integer", example=1, description="테넌트 ID"),
 *     @OA\Property(property="user_id", type="integer", example=10, description="신청자 ID"),
 *     @OA\Property(property="leave_type", type="string", enum={"annual","half_am","half_pm","sick","family","maternity","parental"}, example="annual", description="휴가 유형"),
 *     @OA\Property(property="start_date", type="string", format="date", example="2024-01-15", description="시작일"),
 *     @OA\Property(property="end_date", type="string", format="date", example="2024-01-17", description="종료일"),
 *     @OA\Property(property="days", type="number", format="float", example=3.0, description="사용일수"),
 *     @OA\Property(property="reason", type="string", example="개인 사유", nullable=true, description="휴가 사유"),
 *     @OA\Property(property="status", type="string", enum={"pending","approved","rejected","cancelled"}, example="pending", description="상태"),
 *     @OA\Property(property="approved_by", type="integer", example=5, nullable=true, description="승인자 ID"),
 *     @OA\Property(property="approved_at", type="string", format="date-time", example="2024-01-14T10:00:00Z", nullable=true, description="승인/반려 일시"),
 *     @OA\Property(property="reject_reason", type="string", example="인원 부족", nullable=true, description="반려 사유"),
 *     @OA\Property(property="user", type="object", nullable=true, description="신청자 정보",
 *         @OA\Property(property="id", type="integer", example=10),
 *         @OA\Property(property="name", type="string", example="홍길동"),
 *         @OA\Property(property="email", type="string", example="hong@company.com")
 *     ),
 *     @OA\Property(property="approver", type="object", nullable=true, description="승인자 정보",
 *         @OA\Property(property="id", type="integer", example=5),
 *         @OA\Property(property="name", type="string", example="김부장")
 *     ),
 *     @OA\Property(property="created_at", type="string", format="date-time", example="2024-01-13T09:00:00Z"),
 *     @OA\Property(property="updated_at", type="string", format="date-time", example="2024-01-14T10:00:00Z")
 * )
 *
 * @OA\Schema(
 *     schema="LeaveCreateRequest",
 *     type="object",
 *     required={"leave_type", "start_date", "end_date", "days"},
 *     description="휴가 신청 요청",
 *
 *     @OA\Property(property="leave_type", type="string", enum={"annual","half_am","half_pm","sick","family","maternity","parental"}, example="annual", description="휴가 유형"),
 *     @OA\Property(property="start_date", type="string", format="date", example="2024-01-15", description="시작일"),
 *     @OA\Property(property="end_date", type="string", format="date", example="2024-01-17", description="종료일"),
 *     @OA\Property(property="days", type="number", format="float", example=3.0, minimum=0.5, maximum=365, description="사용일수"),
 *     @OA\Property(property="reason", type="string", example="개인 사유", description="휴가 사유")
 * )
 *
 * @OA\Schema(
 *     schema="LeaveUpdateRequest",
 *     type="object",
 *     description="휴가 수정 요청",
 *
 *     @OA\Property(property="leave_type", type="string", enum={"annual","half_am","half_pm","sick","family","maternity","parental"}, example="annual", description="휴가 유형"),
 *     @OA\Property(property="start_date", type="string", format="date", example="2024-01-15", description="시작일"),
 *     @OA\Property(property="end_date", type="string", format="date", example="2024-01-17", description="종료일"),
 *     @OA\Property(property="days", type="number", format="float", example=3.0, description="사용일수"),
 *     @OA\Property(property="reason", type="string", example="개인 사유", description="휴가 사유")
 * )
 *
 * @OA\Schema(
 *     schema="LeaveBalance",
 *     type="object",
 *     description="휴가 잔여일수 정보",
 *
 *     @OA\Property(property="id", type="integer", example=1, description="ID"),
 *     @OA\Property(property="tenant_id", type="integer", example=1, description="테넌트 ID"),
 *     @OA\Property(property="user_id", type="integer", example=10, description="사용자 ID"),
 *     @OA\Property(property="year", type="integer", example=2024, description="연도"),
 *     @OA\Property(property="total_days", type="number", format="float", example=15.0, description="연간 부여일수"),
 *     @OA\Property(property="used_days", type="number", format="float", example=5.0, description="사용일수"),
 *     @OA\Property(property="remaining_days", type="number", format="float", example=10.0, description="잔여일수"),
 *     @OA\Property(property="user", type="object", nullable=true, description="사용자 정보",
 *         @OA\Property(property="id", type="integer", example=10),
 *         @OA\Property(property="name", type="string", example="홍길동")
 *     )
 * )
 *
 * @OA\Schema(
 *     schema="LeaveBalanceSetRequest",
 *     type="object",
 *     required={"user_id", "year", "total_days"},
 *     description="휴가 잔여일수 설정 요청",
 *
 *     @OA\Property(property="user_id", type="integer", example=10, description="사용자 ID"),
 *     @OA\Property(property="year", type="integer", example=2024, minimum=2020, maximum=2099, description="연도"),
 *     @OA\Property(property="total_days", type="number", format="float", example=15.0, minimum=0, maximum=365, description="연간 부여일수")
 * )
 */
class LeaveApi
{
    /**
     * @OA\Get(
     *     path="/api/v1/leaves",
     *     tags={"Leaves"},
     *     summary="휴가 목록 조회",
     *     description="필터/검색/페이지네이션으로 휴가 목록을 조회합니다.",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\Parameter(name="user_id", in="query", description="사용자 ID 필터", @OA\Schema(type="integer")),
     *     @OA\Parameter(name="status", in="query", description="상태 필터", @OA\Schema(type="string", enum={"pending","approved","rejected","cancelled"})),
     *     @OA\Parameter(name="leave_type", in="query", description="휴가 유형 필터", @OA\Schema(type="string", enum={"annual","half_am","half_pm","sick","family","maternity","parental"})),
     *     @OA\Parameter(name="date_from", in="query", description="시작일 이후", @OA\Schema(type="string", format="date")),
     *     @OA\Parameter(name="date_to", in="query", description="종료일 이전", @OA\Schema(type="string", format="date")),
     *     @OA\Parameter(name="year", in="query", description="연도 필터", @OA\Schema(type="integer")),
     *     @OA\Parameter(name="sort_by", in="query", description="정렬 기준", @OA\Schema(type="string", enum={"start_date","created_at","status"}, default="start_date")),
     *     @OA\Parameter(name="sort_dir", in="query", description="정렬 방향", @OA\Schema(type="string", enum={"asc","desc"}, default="desc")),
     *     @OA\Parameter(ref="#/components/parameters/Page"),
     *     @OA\Parameter(ref="#/components/parameters/Size"),
     *
     *     @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="current_page", type="integer", example=1),
     *                         @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/Leave")),
     *                         @OA\Property(property="per_page", type="integer", example=20),
     *                         @OA\Property(property="total", type="integer", example=50)
     *                     )
     *                 )
     *             }
     *         )
     *     ),
     *
     *     @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=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function index() {}

    /**
     * @OA\Get(
     *     path="/api/v1/leaves/{id}",
     *     tags={"Leaves"},
     *     summary="휴가 상세 조회",
     *     description="ID 기준 휴가 상세 정보를 조회합니다.",
     *     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(
     *             allOf={
     *
     *                 @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *                 @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Leave"))
     *             }
     *         )
     *     ),
     *
     *     @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
     *     @OA\Response(response=404, description="휴가를 찾을 수 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
     *     @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function show() {}

    /**
     * @OA\Post(
     *     path="/api/v1/leaves",
     *     tags={"Leaves"},
     *     summary="휴가 신청",
     *     description="새 휴가를 신청합니다. 잔여일수를 초과하거나 기간이 중복되면 실패합니다.",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\RequestBody(
     *         required=true,
     *
     *         @OA\JsonContent(ref="#/components/schemas/LeaveCreateRequest")
     *     ),
     *
     *     @OA\Response(
     *         response=201,
     *         description="신청 성공",
     *
     *         @OA\JsonContent(
     *             allOf={
     *
     *                 @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *                 @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Leave"))
     *             }
     *         )
     *     ),
     *
     *     @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=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function store() {}

    /**
     * @OA\Patch(
     *     path="/api/v1/leaves/{id}",
     *     tags={"Leaves"},
     *     summary="휴가 수정",
     *     description="대기 상태의 휴가만 수정 가능합니다.",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\Parameter(name="id", in="path", required=true, description="휴가 ID", @OA\Schema(type="integer")),
     *
     *     @OA\RequestBody(
     *         required=true,
     *
     *         @OA\JsonContent(ref="#/components/schemas/LeaveUpdateRequest")
     *     ),
     *
     *     @OA\Response(
     *         response=200,
     *         description="수정 성공",
     *
     *         @OA\JsonContent(
     *             allOf={
     *
     *                 @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *                 @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Leave"))
     *             }
     *         )
     *     ),
     *
     *     @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")),
     *     @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function update() {}

    /**
     * @OA\Delete(
     *     path="/api/v1/leaves/{id}",
     *     tags={"Leaves"},
     *     summary="휴가 삭제",
     *     description="대기 상태의 휴가만 삭제 가능합니다 (소프트 삭제).",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\Parameter(name="id", in="path", required=true, description="휴가 ID", @OA\Schema(type="integer")),
     *
     *     @OA\Response(
     *         response=200,
     *         description="삭제 성공",
     *
     *         @OA\JsonContent(
     *
     *             @OA\Property(property="success", type="boolean", example=true),
     *             @OA\Property(property="message", type="string", example="삭제 완료"),
     *             @OA\Property(property="data", type="boolean", example=true)
     *         )
     *     ),
     *
     *     @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")),
     *     @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function destroy() {}

    /**
     * @OA\Post(
     *     path="/api/v1/leaves/{id}/approve",
     *     tags={"Leaves"},
     *     summary="휴가 승인",
     *     description="대기 상태의 휴가를 승인합니다. 승인 시 잔여일수가 차감됩니다.",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\Parameter(name="id", in="path", required=true, description="휴가 ID", @OA\Schema(type="integer")),
     *
     *     @OA\RequestBody(
     *         required=false,
     *
     *         @OA\JsonContent(
     *             type="object",
     *
     *             @OA\Property(property="comment", type="string", example="승인합니다.", description="승인 코멘트")
     *         )
     *     ),
     *
     *     @OA\Response(
     *         response=200,
     *         description="승인 성공",
     *
     *         @OA\JsonContent(
     *             allOf={
     *
     *                 @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *                 @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Leave"))
     *             }
     *         )
     *     ),
     *
     *     @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")),
     *     @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function approve() {}

    /**
     * @OA\Post(
     *     path="/api/v1/leaves/{id}/reject",
     *     tags={"Leaves"},
     *     summary="휴가 반려",
     *     description="대기 상태의 휴가를 반려합니다.",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\Parameter(name="id", in="path", required=true, description="휴가 ID", @OA\Schema(type="integer")),
     *
     *     @OA\RequestBody(
     *         required=true,
     *
     *         @OA\JsonContent(
     *             type="object",
     *             required={"reason"},
     *
     *             @OA\Property(property="reason", type="string", example="인원 부족으로 반려합니다.", description="반려 사유")
     *         )
     *     ),
     *
     *     @OA\Response(
     *         response=200,
     *         description="반려 성공",
     *
     *         @OA\JsonContent(
     *             allOf={
     *
     *                 @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *                 @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Leave"))
     *             }
     *         )
     *     ),
     *
     *     @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")),
     *     @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function reject() {}

    /**
     * @OA\Post(
     *     path="/api/v1/leaves/{id}/cancel",
     *     tags={"Leaves"},
     *     summary="휴가 취소",
     *     description="승인된 휴가를 취소합니다. 취소 시 잔여일수가 복구됩니다.",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\Parameter(name="id", in="path", required=true, description="휴가 ID", @OA\Schema(type="integer")),
     *
     *     @OA\RequestBody(
     *         required=false,
     *
     *         @OA\JsonContent(
     *             type="object",
     *
     *             @OA\Property(property="reason", type="string", example="일정 변경으로 취소합니다.", description="취소 사유")
     *         )
     *     ),
     *
     *     @OA\Response(
     *         response=200,
     *         description="취소 성공",
     *
     *         @OA\JsonContent(
     *             allOf={
     *
     *                 @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *                 @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/Leave"))
     *             }
     *         )
     *     ),
     *
     *     @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")),
     *     @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function cancel() {}

    /**
     * @OA\Get(
     *     path="/api/v1/leaves/balance",
     *     tags={"Leaves"},
     *     summary="내 잔여 휴가 조회",
     *     description="로그인한 사용자의 잔여 휴가를 조회합니다.",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\Parameter(name="year", in="query", description="연도 (미지정시 현재 연도)", @OA\Schema(type="integer", example=2024)),
     *
     *     @OA\Response(
     *         response=200,
     *         description="조회 성공",
     *
     *         @OA\JsonContent(
     *             allOf={
     *
     *                 @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *                 @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/LeaveBalance"))
     *             }
     *         )
     *     ),
     *
     *     @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
     *     @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function balance() {}

    /**
     * @OA\Get(
     *     path="/api/v1/leaves/balance/{userId}",
     *     tags={"Leaves"},
     *     summary="특정 사용자 잔여 휴가 조회",
     *     description="특정 사용자의 잔여 휴가를 조회합니다 (관리자 전용).",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\Parameter(name="userId", in="path", required=true, description="사용자 ID", @OA\Schema(type="integer", example=10)),
     *     @OA\Parameter(name="year", in="query", description="연도 (미지정시 현재 연도)", @OA\Schema(type="integer", example=2024)),
     *
     *     @OA\Response(
     *         response=200,
     *         description="조회 성공",
     *
     *         @OA\JsonContent(
     *             allOf={
     *
     *                 @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *                 @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/LeaveBalance"))
     *             }
     *         )
     *     ),
     *
     *     @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
     *     @OA\Response(response=403, description="권한 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
     *     @OA\Response(response=404, description="사용자를 찾을 수 없음", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
     *     @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function userBalance() {}

    /**
     * @OA\Put(
     *     path="/api/v1/leaves/balance",
     *     tags={"Leaves"},
     *     summary="잔여 휴가 설정",
     *     description="특정 사용자의 연간 휴가일수를 설정합니다 (관리자 전용).",
     *     security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
     *
     *     @OA\RequestBody(
     *         required=true,
     *
     *         @OA\JsonContent(ref="#/components/schemas/LeaveBalanceSetRequest")
     *     ),
     *
     *     @OA\Response(
     *         response=200,
     *         description="설정 성공",
     *
     *         @OA\JsonContent(
     *             allOf={
     *
     *                 @OA\Schema(ref="#/components/schemas/ApiResponse"),
     *                 @OA\Schema(@OA\Property(property="data", ref="#/components/schemas/LeaveBalance"))
     *             }
     *         )
     *     ),
     *
     *     @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")),
     *     @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
     * )
     */
    public function setBalance() {}
}
