Files
sam-api/app/Swagger/v1/LoanApi.php
권혁성 f089843e1e feat: 세금 시뮬레이션 API 개발 (Phase 1.3)
- LoanService에 taxSimulation() 메서드 추가
- LoanController에 taxSimulation() 액션 추가
- GET /api/v1/loans/tax-simulation 라우트 등록
- Swagger LoanTaxSimulation 스키마 및 엔드포인트 문서화
- 법인세/소득세 비교 분석 데이터 제공

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-22 22:47:59 +09:00

646 lines
32 KiB
PHP

<?php
namespace App\Swagger\v1;
/**
* @OA\Tag(name="Loans", description="가지급금 관리")
*
* @OA\Schema(
* schema="Loan",
* 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=1, description="수령자 ID"),
* @OA\Property(property="loan_date", type="string", format="date", example="2025-01-15", description="지급일"),
* @OA\Property(property="amount", type="number", format="float", example=5000000, description="가지급금액"),
* @OA\Property(property="purpose", type="string", example="출장 경비", nullable=true, description="사용 목적"),
* @OA\Property(property="settlement_date", type="string", format="date", example="2025-02-15", nullable=true, description="정산일"),
* @OA\Property(property="settlement_amount", type="number", format="float", example=5000000, nullable=true, description="정산금액"),
* @OA\Property(property="status", type="string", enum={"outstanding","settled","partial"}, example="outstanding", description="상태 (미정산/정산완료/부분정산)"),
* @OA\Property(property="status_label", type="string", example="미정산", description="상태 레이블"),
* @OA\Property(property="outstanding_amount", type="number", format="float", example=5000000, description="미정산 잔액"),
* @OA\Property(property="elapsed_days", type="integer", example=30, description="경과일수"),
* @OA\Property(property="withdrawal_id", type="integer", example=1, nullable=true, description="연결된 출금 ID"),
* @OA\Property(property="user", type="object", nullable=true,
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="name", type="string", example="홍길동"),
* @OA\Property(property="email", type="string", example="hong@example.com"),
* description="수령자 정보"
* ),
* @OA\Property(property="withdrawal", type="object", nullable=true,
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="withdrawal_date", type="string", format="date"),
* @OA\Property(property="amount", type="number", format="float"),
* description="연결된 출금 정보"
* ),
* @OA\Property(property="creator", type="object", nullable=true,
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="name", type="string", example="관리자"),
* description="생성자 정보"
* ),
* @OA\Property(property="created_by", type="integer", example=1, nullable=true, description="생성자 ID"),
* @OA\Property(property="updated_by", type="integer", example=1, nullable=true, description="수정자 ID"),
* @OA\Property(property="created_at", type="string", format="date-time"),
* @OA\Property(property="updated_at", type="string", format="date-time")
* )
*
* @OA\Schema(
* schema="LoanCreateRequest",
* type="object",
* required={"user_id","loan_date","amount"},
* description="가지급금 등록 요청",
*
* @OA\Property(property="user_id", type="integer", example=1, description="수령자 ID"),
* @OA\Property(property="loan_date", type="string", format="date", example="2025-01-15", description="지급일"),
* @OA\Property(property="amount", type="number", format="float", example=5000000, description="가지급금액"),
* @OA\Property(property="purpose", type="string", example="출장 경비", maxLength=1000, nullable=true, description="사용 목적"),
* @OA\Property(property="withdrawal_id", type="integer", example=1, nullable=true, description="연결할 출금 ID")
* )
*
* @OA\Schema(
* schema="LoanUpdateRequest",
* type="object",
* description="가지급금 수정 요청 (미정산 상태만 수정 가능)",
*
* @OA\Property(property="user_id", type="integer", example=1, description="수령자 ID"),
* @OA\Property(property="loan_date", type="string", format="date", example="2025-01-15", description="지급일"),
* @OA\Property(property="amount", type="number", format="float", example=5000000, description="가지급금액"),
* @OA\Property(property="purpose", type="string", example="출장 경비", maxLength=1000, nullable=true, description="사용 목적"),
* @OA\Property(property="withdrawal_id", type="integer", example=1, nullable=true, description="연결할 출금 ID")
* )
*
* @OA\Schema(
* schema="LoanSettleRequest",
* type="object",
* required={"settlement_date","settlement_amount"},
* description="가지급금 정산 요청",
*
* @OA\Property(property="settlement_date", type="string", format="date", example="2025-02-15", description="정산일"),
* @OA\Property(property="settlement_amount", type="number", format="float", example=5000000, minimum=0.01, description="정산금액")
* )
*
* @OA\Schema(
* schema="LoanSummary",
* type="object",
* description="가지급금 요약",
*
* @OA\Property(property="total_count", type="integer", example=10, description="전체 건수"),
* @OA\Property(property="outstanding_count", type="integer", example=5, description="미정산 건수"),
* @OA\Property(property="settled_count", type="integer", example=3, description="정산완료 건수"),
* @OA\Property(property="partial_count", type="integer", example=2, description="부분정산 건수"),
* @OA\Property(property="total_amount", type="number", format="float", example=50000000, description="총 가지급금액"),
* @OA\Property(property="total_settled", type="number", format="float", example=30000000, description="총 정산금액"),
* @OA\Property(property="total_outstanding", type="number", format="float", example=20000000, description="총 미정산액")
* )
*
* @OA\Schema(
* schema="LoanInterestCalculation",
* type="object",
* description="인정이자 계산 결과",
*
* @OA\Property(property="year", type="integer", example=2025, description="계산 연도"),
* @OA\Property(property="interest_rate", type="number", format="float", example=4.6, description="인정이자율 (%)"),
* @OA\Property(property="base_date", type="string", format="date", example="2025-12-31", description="기준일"),
* @OA\Property(property="summary", type="object",
* @OA\Property(property="total_balance", type="number", format="float", example=50000000, description="총 미정산 잔액"),
* @OA\Property(property="total_recognized_interest", type="number", format="float", example=2300000, description="총 인정이자"),
* @OA\Property(property="total_corporate_tax", type="number", format="float", example=437000, description="법인세 추가 (19%)"),
* @OA\Property(property="total_income_tax", type="number", format="float", example=805000, description="소득세 추가 (35%)"),
* @OA\Property(property="total_local_tax", type="number", format="float", example=80500, description="지방소득세 (10%)"),
* @OA\Property(property="total_tax", type="number", format="float", example=1322500, description="총 세금"),
* description="요약"
* ),
* @OA\Property(property="details", type="array",
*
* @OA\Items(
*
* @OA\Property(property="loan_id", type="integer", example=1),
* @OA\Property(property="user", type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="name", type="string", example="홍길동"),
* @OA\Property(property="email", type="string", example="hong@example.com")
* ),
* @OA\Property(property="loan_date", type="string", format="date", example="2025-01-15"),
* @OA\Property(property="amount", type="number", format="float", example=5000000),
* @OA\Property(property="settlement_amount", type="number", format="float", example=0),
* @OA\Property(property="outstanding_amount", type="number", format="float", example=5000000),
* @OA\Property(property="elapsed_days", type="integer", example=350),
* @OA\Property(property="interest_rate", type="number", format="float", example=4.6),
* @OA\Property(property="recognized_interest", type="number", format="float", example=220548),
* @OA\Property(property="corporate_tax", type="number", format="float", example=41904),
* @OA\Property(property="income_tax", type="number", format="float", example=77192),
* @OA\Property(property="local_tax", type="number", format="float", example=7719),
* @OA\Property(property="total_tax", type="number", format="float", example=126815)
* ),
* description="상세 내역"
* )
* )
*
* @OA\Schema(
* schema="LoanInterestReport",
* type="object",
* description="연간 인정이자 리포트",
*
* @OA\Property(property="year", type="integer", example=2025, description="연도"),
* @OA\Property(property="interest_rate", type="number", format="float", example=4.6, description="인정이자율 (%)"),
* @OA\Property(property="users", type="array",
*
* @OA\Items(
*
* @OA\Property(property="user", type="object",
* @OA\Property(property="id", type="integer", example=1),
* @OA\Property(property="name", type="string", example="홍길동"),
* @OA\Property(property="email", type="string", example="hong@example.com")
* ),
* @OA\Property(property="loan_count", type="integer", example=3, description="가지급금 건수"),
* @OA\Property(property="total_amount", type="number", format="float", example=15000000, description="총 가지급금액"),
* @OA\Property(property="total_settled", type="number", format="float", example=5000000, description="총 정산금액"),
* @OA\Property(property="total_outstanding", type="number", format="float", example=10000000, description="총 미정산액"),
* @OA\Property(property="recognized_interest", type="number", format="float", example=460000, description="인정이자"),
* @OA\Property(property="total_tax", type="number", format="float", example=265000, description="총 세금")
* ),
* description="사용자별 내역"
* ),
* @OA\Property(property="grand_total", type="object",
* @OA\Property(property="total_amount", type="number", format="float", example=50000000),
* @OA\Property(property="total_outstanding", type="number", format="float", example=30000000),
* @OA\Property(property="recognized_interest", type="number", format="float", example=1380000),
* @OA\Property(property="total_tax", type="number", format="float", example=795000),
* description="전체 합계"
* )
* )
*
* @OA\Schema(
* schema="LoanDashboard",
* type="object",
* description="가지급금 대시보드 응답",
*
* @OA\Property(property="summary", type="object",
* @OA\Property(property="total_outstanding", type="number", format="float", example=20000000, description="미정산 가지급금 총액"),
* @OA\Property(property="recognized_interest", type="number", format="float", example=920000, description="인정이자 (연 4.6%)"),
* @OA\Property(property="outstanding_count", type="integer", example=5, description="미정산 건수"),
* description="요약 정보"
* ),
* @OA\Property(property="loans", type="array",
*
* @OA\Items(
*
* @OA\Property(property="id", type="integer", example=1, description="가지급금 ID"),
* @OA\Property(property="loan_date", type="string", format="date", example="2025-01-15", description="지급일"),
* @OA\Property(property="user_name", type="string", example="홍길동", description="수령자명"),
* @OA\Property(property="category", type="string", example="카드", enum={"카드","계좌"}, description="구분"),
* @OA\Property(property="amount", type="number", format="float", example=5000000, description="금액"),
* @OA\Property(property="status", type="string", example="outstanding", enum={"outstanding","settled","partial"}, description="상태"),
* @OA\Property(property="content", type="string", example="출장 경비", description="내용/목적")
* ),
* description="최근 가지급금 목록 (미정산 우선, 최대 10건)"
* )
* )
*
* @OA\Schema(
* schema="LoanTaxSimulation",
* type="object",
* description="세금 시뮬레이션 응답",
*
* @OA\Property(property="year", type="integer", example=2026, description="시뮬레이션 연도"),
* @OA\Property(property="loan_summary", type="object",
* @OA\Property(property="total_outstanding", type="number", format="float", example=20000000, description="가지급금 잔액"),
* @OA\Property(property="recognized_interest", type="number", format="float", example=920000, description="인정이자"),
* @OA\Property(property="interest_rate", type="number", format="float", example=4.6, description="이자율 (%)"),
* description="가지급금 요약"
* ),
* @OA\Property(property="corporate_tax", type="object",
* @OA\Property(property="without_loan", type="object",
* @OA\Property(property="taxable_income", type="number", format="float", example=0),
* @OA\Property(property="tax_amount", type="number", format="float", example=0),
* description="가지급금 없을 때"
* ),
* @OA\Property(property="with_loan", type="object",
* @OA\Property(property="taxable_income", type="number", format="float", example=920000),
* @OA\Property(property="tax_amount", type="number", format="float", example=174800),
* description="가지급금 있을 때"
* ),
* @OA\Property(property="difference", type="number", format="float", example=174800, description="차이 (가중액)"),
* @OA\Property(property="rate_info", type="string", example="법인세 19% 적용", description="적용 세율 정보"),
* description="법인세 비교"
* ),
* @OA\Property(property="income_tax", type="object",
* @OA\Property(property="without_loan", type="object",
* @OA\Property(property="taxable_income", type="number", format="float", example=0),
* @OA\Property(property="tax_rate", type="string", example="0%"),
* @OA\Property(property="tax_amount", type="number", format="float", example=0),
* description="가지급금 없을 때"
* ),
* @OA\Property(property="with_loan", type="object",
* @OA\Property(property="taxable_income", type="number", format="float", example=920000),
* @OA\Property(property="tax_rate", type="string", example="35%"),
* @OA\Property(property="tax_amount", type="number", format="float", example=354200),
* description="가지급금 있을 때"
* ),
* @OA\Property(property="difference", type="number", format="float", example=354200, description="차이"),
* @OA\Property(property="breakdown", type="object",
* @OA\Property(property="income_tax", type="number", format="float", example=322000, description="소득세"),
* @OA\Property(property="local_tax", type="number", format="float", example=32200, description="지방소득세"),
* @OA\Property(property="insurance", type="number", format="float", example=82800, description="4대보험 추정"),
* description="세부 내역"
* ),
* description="종합소득세 비교"
* )
* )
*/
class LoanApi
{
/**
* @OA\Get(
* path="/api/v1/loans",
* tags={"Loans"},
* 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={"outstanding","settled","partial"})),
* @OA\Parameter(name="start_date", in="query", description="시작일 (지급일 기준)", @OA\Schema(type="string", format="date")),
* @OA\Parameter(name="end_date", in="query", description="종료일 (지급일 기준)", @OA\Schema(type="string", format="date")),
* @OA\Parameter(name="search", in="query", description="검색어 (수령자명, 목적)", @OA\Schema(type="string", maxLength=100)),
* @OA\Parameter(name="sort_by", in="query", description="정렬 기준", @OA\Schema(type="string", enum={"loan_date","amount","status","created_at"}, default="loan_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/Loan")),
* @OA\Property(property="per_page", type="integer", example=20),
* @OA\Property(property="total", type="integer", example=30)
* )
* )
* }
* )
* ),
*
* @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\Post(
* path="/api/v1/loans",
* tags={"Loans"},
* summary="가지급금 등록",
* description="새로운 가지급금을 등록합니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\RequestBody(
* required=true,
*
* @OA\JsonContent(ref="#/components/schemas/LoanCreateRequest")
* ),
*
* @OA\Response(
* response=201,
* description="등록 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/Loan")
* )
* }
* )
* ),
*
* @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\Get(
* path="/api/v1/loans/summary",
* tags={"Loans"},
* summary="가지급금 요약 조회",
* description="가지급금 요약 정보를 조회합니다. 특정 사용자 지정 시 해당 사용자만 집계합니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="user_id", in="query", description="수령자 ID (미지정 시 전체)", @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/LoanSummary")
* )
* }
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function summary() {}
/**
* @OA\Get(
* path="/api/v1/loans/dashboard",
* tags={"Loans"},
* summary="가지급금 대시보드 조회",
* description="CEO 대시보드 카드/가지급금 관리 섹션(cm2) 모달용 데이터를 조회합니다. 요약 정보와 최근 가지급금 목록을 반환합니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Response(
* response=200,
* description="조회 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/LoanDashboard")
* )
* }
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function dashboard() {}
/**
* @OA\Get(
* path="/api/v1/loans/tax-simulation",
* tags={"Loans"},
* summary="세금 시뮬레이션",
* description="가지급금으로 인한 법인세/소득세 추가 부담을 시뮬레이션합니다. CEO 대시보드 카드/가지급금 관리 섹션(cm2)용.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="year", in="query", required=true, description="시뮬레이션 연도", @OA\Schema(type="integer", example=2026, minimum=2000, maximum=2100)),
*
* @OA\Response(
* response=200,
* description="시뮬레이션 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/LoanTaxSimulation")
* )
* }
* )
* ),
*
* @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 taxSimulation() {}
/**
* @OA\Post(
* path="/api/v1/loans/calculate-interest",
* tags={"Loans"},
* summary="인정이자 계산",
* description="미정산 가지급금에 대한 인정이자를 계산합니다. 법인세/소득세/지방소득세가 자동 계산됩니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\RequestBody(
* required=true,
*
* @OA\JsonContent(
* required={"year"},
*
* @OA\Property(property="year", type="integer", example=2025, minimum=2000, maximum=2100, description="계산 연도"),
* @OA\Property(property="user_id", type="integer", example=1, nullable=true, description="특정 사용자 ID (미지정 시 전체)")
* )
* ),
*
* @OA\Response(
* response=200,
* description="계산 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/LoanInterestCalculation")
* )
* }
* )
* ),
*
* @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 calculateInterest() {}
/**
* @OA\Get(
* path="/api/v1/loans/interest-report/{year}",
* tags={"Loans"},
* summary="인정이자 연간 리포트",
* description="특정 연도의 인정이자 리포트를 사용자별로 조회합니다.",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="year", in="path", required=true, description="연도", @OA\Schema(type="integer", example=2025)),
*
* @OA\Response(
* response=200,
* description="조회 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/LoanInterestReport")
* )
* }
* )
* ),
*
* @OA\Response(response=401, description="인증 실패", @OA\JsonContent(ref="#/components/schemas/ErrorResponse")),
* @OA\Response(response=500, description="서버 에러", @OA\JsonContent(ref="#/components/schemas/ErrorResponse"))
* )
*/
public function interestReport() {}
/**
* @OA\Get(
* path="/api/v1/loans/{id}",
* tags={"Loans"},
* 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(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/Loan")
* )
* }
* )
* ),
*
* @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\Put(
* path="/api/v1/loans/{id}",
* tags={"Loans"},
* summary="가지급금 수정",
* description="가지급금 정보를 수정합니다. 미정산(outstanding) 상태에서만 수정 가능합니다.",
* 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/LoanUpdateRequest")
* ),
*
* @OA\Response(
* response=200,
* description="수정 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/Loan")
* )
* }
* )
* ),
*
* @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/loans/{id}",
* tags={"Loans"},
* summary="가지급금 삭제",
* description="가지급금을 삭제합니다. 미정산(outstanding) 상태에서만 삭제 가능합니다. (Soft Delete)",
* security={{"ApiKeyAuth":{}},{"BearerAuth":{}}},
*
* @OA\Parameter(name="id", in="path", required=true, description="가지급금 ID", @OA\Schema(type="integer")),
*
* @OA\Response(
* response=200,
* description="삭제 성공",
*
* @OA\JsonContent(ref="#/components/schemas/ApiResponse")
* ),
*
* @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/loans/{id}/settle",
* tags={"Loans"},
* summary="가지급금 정산",
* description="가지급금을 정산합니다. 미정산(outstanding) 또는 부분정산(partial) 상태에서만 가능합니다. 부분 정산 시 누적됩니다.",
* 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/LoanSettleRequest")
* ),
*
* @OA\Response(
* response=200,
* description="정산 성공",
*
* @OA\JsonContent(
* allOf={
*
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
*
* @OA\Property(property="data", ref="#/components/schemas/Loan")
* )
* }
* )
* ),
*
* @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 settle() {}
}