Files
sam-api/app/Http/Requests/Loan/LoanUpdateRequest.php
권혁성 1df34b2fa9 feat: [재무] 어음 V8 + 상품권 접대비 연동 + 일반전표/계정과목 API
- Bill 확장 필드 (V8), Loan 상품권 카테고리/접대비 자동 연동
- GeneralJournalEntry CRUD, AccountSubject API
- 접대비/복리후생비 날짜 필터, 매출채권 soft delete 제외
- 바로빌 연동 API 엔드포인트 추가
- 부가세 상세 조회 API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 02:58:55 +09:00

65 lines
2.5 KiB
PHP

<?php
namespace App\Http\Requests\Loan;
use App\Models\Tenants\Loan;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class LoanUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'user_id' => ['sometimes', 'integer', 'exists:users,id'],
'loan_date' => ['sometimes', 'date', 'date_format:Y-m-d'],
'amount' => ['sometimes', 'numeric', 'min:0', 'max:999999999999.99'],
'purpose' => ['nullable', 'string', 'max:1000'],
'withdrawal_id' => ['nullable', 'integer', 'exists:withdrawals,id'],
'category' => ['sometimes', 'string', Rule::in(Loan::CATEGORIES)],
'status' => ['sometimes', 'string', Rule::in(Loan::STATUSES)],
'settlement_date' => ['nullable', 'date', 'date_format:Y-m-d'],
'metadata' => ['nullable', 'array'],
'metadata.serial_number' => ['nullable', 'string', 'max:100'],
'metadata.cert_name' => ['nullable', 'string', 'max:200'],
'metadata.vendor_id' => ['nullable', 'string', 'max:50'],
'metadata.vendor_name' => ['nullable', 'string', 'max:200'],
'metadata.purchase_purpose' => ['nullable', 'string', 'max:50'],
'metadata.entertainment_expense' => ['nullable', 'string', 'max:50'],
'metadata.recipient_name' => ['nullable', 'string', 'max:100'],
'metadata.recipient_organization' => ['nullable', 'string', 'max:200'],
'metadata.usage_description' => ['nullable', 'string', 'max:1000'],
'metadata.memo' => ['nullable', 'string', 'max:2000'],
];
}
/**
* Get the validation attribute names.
*
* @return array<string, string>
*/
public function attributes(): array
{
return [
'user_id' => __('validation.attributes.user_id'),
'loan_date' => __('validation.attributes.loan_date'),
'amount' => __('validation.attributes.amount'),
'purpose' => __('validation.attributes.purpose'),
'withdrawal_id' => __('validation.attributes.withdrawal_id'),
];
}
}