Files
sam-api/app/Http/Requests/Bidding/BiddingUpdateRequest.php

47 lines
1.6 KiB
PHP
Raw Normal View History

<?php
namespace App\Http\Requests\Bidding;
use App\Models\Bidding\Bidding;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class BiddingUpdateRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
// 거래처/현장
'client_id' => ['nullable', 'integer'],
'client_name' => ['nullable', 'string', 'max:100'],
'project_name' => ['nullable', 'string', 'max:200'],
// 입찰 정보
'bidding_date' => ['nullable', 'date'],
'bid_date' => ['nullable', 'date'],
'submission_date' => ['nullable', 'date'],
'confirm_date' => ['nullable', 'date'],
'total_count' => ['nullable', 'integer', 'min:0'],
'bidding_amount' => ['nullable', 'numeric', 'min:0'],
// 상태
'status' => ['nullable', 'string', Rule::in(Bidding::STATUSES)],
// 입찰자
'bidder_id' => ['nullable', 'integer'],
'bidder_name' => ['nullable', 'string', 'max:50'],
// 공사기간
'construction_start_date' => ['nullable', 'date'],
'construction_end_date' => ['nullable', 'date', 'after_or_equal:construction_start_date'],
'vat_type' => ['nullable', 'string', Rule::in(Bidding::VAT_TYPES)],
// 비고
'remarks' => ['nullable', 'string'],
// 견적 데이터 스냅샷
'expense_items' => ['nullable', 'array'],
'estimate_detail_items' => ['nullable', 'array'],
];
}
}