- StoreRequest/UpdateRequest에 order_ids 검증 추가 - UpdateRequest에 locations 검증 추가 (시공규격, 변경사유, 검사데이터) - QualityDocumentLocation에 inspection_data(JSON) fillable/cast 추가 - QualityDocumentService store()에 syncOrders 연동 - QualityDocumentService update()에 syncOrders + updateLocations 연동 - inspection_data 컬럼 추가 migration 신규 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.8 KiB
PHP
45 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Quality;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class QualityDocumentUpdateRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'site_name' => ['sometimes', 'string', 'max:200'],
|
|
'client_id' => ['nullable', 'integer', 'exists:clients,id'],
|
|
'inspector_id' => ['nullable', 'integer', 'exists:users,id'],
|
|
'received_date' => ['nullable', 'date'],
|
|
'options' => ['nullable', 'array'],
|
|
'options.manager' => ['nullable', 'array'],
|
|
'options.manager.name' => ['nullable', 'string', 'max:50'],
|
|
'options.manager.phone' => ['nullable', 'string', 'max:30'],
|
|
'options.inspection' => ['nullable', 'array'],
|
|
'options.inspection.request_date' => ['nullable', 'date'],
|
|
'options.inspection.start_date' => ['nullable', 'date'],
|
|
'options.inspection.end_date' => ['nullable', 'date'],
|
|
'options.site_address' => ['nullable', 'array'],
|
|
'options.construction_site' => ['nullable', 'array'],
|
|
'options.material_distributor' => ['nullable', 'array'],
|
|
'options.contractor' => ['nullable', 'array'],
|
|
'options.supervisor' => ['nullable', 'array'],
|
|
'order_ids' => ['nullable', 'array'],
|
|
'order_ids.*' => ['integer', 'exists:orders,id'],
|
|
'locations' => ['nullable', 'array'],
|
|
'locations.*.id' => ['required', 'integer'],
|
|
'locations.*.post_width' => ['nullable', 'integer'],
|
|
'locations.*.post_height' => ['nullable', 'integer'],
|
|
'locations.*.change_reason' => ['nullable', 'string', 'max:500'],
|
|
'locations.*.inspection_data' => ['nullable', 'array'],
|
|
];
|
|
}
|
|
}
|