- loans 테이블 마이그레이션 추가 - Loan 모델 (인정이자 계산, 세금 계산 로직) - LoanService (CRUD, 정산, 인정이자 계산/리포트) - LoanController, FormRequest 5개 - 9개 API 라우트 등록 - i18n 키 추가 (validation)
43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Loan;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class LoanSettleRequest 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 [
|
|
'settlement_date' => ['required', 'date', 'date_format:Y-m-d'],
|
|
'settlement_amount' => ['required', 'numeric', 'min:0.01', 'max:999999999999.99'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the validation attribute names.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'settlement_date' => __('validation.attributes.settlement_date'),
|
|
'settlement_amount' => __('validation.attributes.settlement_amount'),
|
|
];
|
|
}
|
|
}
|