50 lines
1.7 KiB
PHP
50 lines
1.7 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\V1\CondolenceExpense;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class StoreCondolenceExpenseRequest extends FormRequest
|
||
|
|
{
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'event_date' => ['nullable', 'date'],
|
||
|
|
'expense_date' => ['nullable', 'date'],
|
||
|
|
'partner_name' => ['required', 'string', 'max:100'],
|
||
|
|
'description' => ['nullable', 'string', 'max:200'],
|
||
|
|
'category' => ['required', 'string', 'in:congratulation,condolence'],
|
||
|
|
'has_cash' => ['nullable', 'boolean'],
|
||
|
|
'cash_method' => ['required_if:has_cash,true', 'nullable', 'string', 'in:cash,transfer,card'],
|
||
|
|
'cash_amount' => ['required_if:has_cash,true', 'nullable', 'integer', 'min:0'],
|
||
|
|
'has_gift' => ['nullable', 'boolean'],
|
||
|
|
'gift_type' => ['nullable', 'string', 'max:50'],
|
||
|
|
'gift_amount' => ['required_if:has_gift,true', 'nullable', 'integer', 'min:0'],
|
||
|
|
'memo' => ['nullable', 'string'],
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function attributes(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'event_date' => '경조사일자',
|
||
|
|
'expense_date' => '지출일자',
|
||
|
|
'partner_name' => '거래처명',
|
||
|
|
'description' => '내역',
|
||
|
|
'category' => '구분',
|
||
|
|
'has_cash' => '부조금 여부',
|
||
|
|
'cash_method' => '지출방법',
|
||
|
|
'cash_amount' => '부조금액',
|
||
|
|
'has_gift' => '선물 여부',
|
||
|
|
'gift_type' => '선물종류',
|
||
|
|
'gift_amount' => '선물금액',
|
||
|
|
'memo' => '비고',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|