- Bill 모델: V8 확장 필드 54개 추가 (증권종류, 할인, 배서, 추심, 개서, 부도 등) - Bill 상태: 수취/발행 어음·수표별 세분화된 상태 체계 - BillService: assignV8Fields/syncInstallments 헬퍼 추출, instrument_type/medium 필터 - BillInstallment: type/counterparty 필드 추가 - Loan 모델: holding/used/disposed 상태 + metadata(JSON) 필드 추가 - LoanService: 상품권 카테고리 지원 (summary 상태별 집계, store 기본상태 holding) - FormRequest: V8 확장 필드 검증 규칙 추가 - 마이그레이션: bills V8 필드 + loans metadata 컬럼 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
61 lines
2.0 KiB
PHP
61 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Loan;
|
|
|
|
use App\Http\Requests\Traits\HasPagination;
|
|
use App\Models\Tenants\Loan;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class LoanIndexRequest extends FormRequest
|
|
{
|
|
use HasPagination;
|
|
|
|
/**
|
|
* 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' => ['nullable', 'integer', 'exists:users,id'],
|
|
'status' => ['nullable', 'string', Rule::in(Loan::STATUSES)],
|
|
'category' => ['nullable', 'string', Rule::in(Loan::CATEGORIES)],
|
|
'start_date' => ['nullable', 'date', 'date_format:Y-m-d'],
|
|
'end_date' => ['nullable', 'date', 'date_format:Y-m-d', 'after_or_equal:start_date'],
|
|
'search' => ['nullable', 'string', 'max:100'],
|
|
'sort_by' => ['nullable', 'string', Rule::in(['loan_date', 'amount', 'status', 'created_at'])],
|
|
'sort_dir' => ['nullable', 'string', Rule::in(['asc', 'desc'])],
|
|
'per_page' => ['nullable', 'integer', 'min:1'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the validation attribute names.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'user_id' => __('validation.attributes.user_id'),
|
|
'status' => __('validation.attributes.status'),
|
|
'start_date' => __('validation.attributes.start_date'),
|
|
'end_date' => __('validation.attributes.end_date'),
|
|
'search' => __('validation.attributes.search'),
|
|
'sort_by' => __('validation.attributes.sort_by'),
|
|
'sort_dir' => __('validation.attributes.sort_dir'),
|
|
'per_page' => __('validation.attributes.per_page'),
|
|
];
|
|
}
|
|
}
|