- 모델 6개: Equipment, EquipmentInspection, EquipmentInspectionDetail, EquipmentInspectionTemplate, EquipmentRepair, EquipmentProcess - InspectionCycle Enum: 6주기(일/주/월/격월/분기/반기) 날짜 해석 - 서비스 4개: EquipmentService, EquipmentInspectionService, EquipmentRepairService, EquipmentPhotoService - 컨트롤러 4개: CRUD + 점검 토글/결과 설정/메모/초기화 + 템플릿 관리 + 수리이력 + 사진 - FormRequest 6개: 설비등록/수정, 수리이력, 점검템플릿, 토글, 메모 - 라우트 26개: equipment prefix 하위 RESTful 엔드포인트 - i18n 메시지: message.equipment.*, error.equipment.* - 마이그레이션: equipments/equipment_repairs options JSON 컬럼 추가
42 lines
1.4 KiB
PHP
42 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V1\Equipment;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreEquipmentRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'equipment_code' => 'required|string|max:50',
|
|
'name' => 'required|string|max:100',
|
|
'equipment_type' => 'nullable|string|max:50',
|
|
'specification' => 'nullable|string|max:200',
|
|
'manufacturer' => 'nullable|string|max:100',
|
|
'model_name' => 'nullable|string|max:100',
|
|
'serial_no' => 'nullable|string|max:100',
|
|
'location' => 'nullable|string|max:100',
|
|
'production_line' => 'nullable|string|max:50',
|
|
'purchase_date' => 'nullable|date',
|
|
'install_date' => 'nullable|date',
|
|
'purchase_price' => 'nullable|numeric|min:0',
|
|
'useful_life' => 'nullable|integer|min:0',
|
|
'status' => 'nullable|in:active,idle,disposed',
|
|
'disposed_date' => 'nullable|date',
|
|
'manager_id' => 'nullable|integer|exists:users,id',
|
|
'sub_manager_id' => 'nullable|integer|exists:users,id',
|
|
'photo_path' => 'nullable|string|max:500',
|
|
'memo' => 'nullable|string',
|
|
'options' => 'nullable|array',
|
|
'is_active' => 'nullable|boolean',
|
|
'sort_order' => 'nullable|integer|min:0',
|
|
];
|
|
}
|
|
}
|