Files
sam-api/app/Http/Requests/Loan/LoanIndexRequest.php
권혁성 7246ac003f fix(WEB): 수주 페이지 필드 매핑 및 제품-부품 트리 구조 개선
- ApiClient 인터페이스: representative → manager_name, contact_person 변경
- transformApiToFrontend: client.representative → client.manager_name 수정
- ApiOrderItem에 floor_code, symbol_code 필드 추가 (제품-부품 매핑)
- ApiOrder에 options 타입 정의 추가
- ApiQuote에 calculation_inputs 타입 정의 추가
- 수주 상세 페이지 제품-부품 트리 구조 UI 개선
2026-01-20 16:14:46 +09:00

60 lines
1.9 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)],
'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'),
];
}
}