Files
sam-api/app/Http/Requests/Bidding/BiddingStoreRequest.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

57 lines
2.0 KiB
PHP

<?php
namespace App\Http\Requests\Bidding;
use App\Models\Bidding\Bidding;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class BiddingStoreRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
// 견적 연결 (선택사항)
'quote_id' => ['nullable', 'integer', 'exists:quotes,id'],
// 거래처/현장
'client_id' => ['nullable', 'integer'],
'client_name' => ['nullable', 'string', 'max:100'],
'project_name' => ['required', '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'],
// 상태 (기본값: waiting)
'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'],
];
}
public function messages(): array
{
return [
'project_name.required' => __('validation.required', ['attribute' => '현장명']),
'quote_id.exists' => __('validation.exists', ['attribute' => '견적']),
];
}
}