'required|string|max:50', 'name' => 'required|string|max:255', 'product_type' => 'required|string|in:FG,PT,SM,RM,CS', 'unit' => 'required|string|max:20', // 선택 필드 'category_id' => 'nullable|integer|exists:categories,id', 'description' => 'nullable|string', // 플래그 'is_sellable' => 'nullable|boolean', 'is_purchasable' => 'nullable|boolean', 'is_producible' => 'nullable|boolean', // 하이브리드 고정 필드 'safety_stock' => 'nullable|integer|min:0', 'lead_time' => 'nullable|integer|min:0', 'is_variable_size' => 'nullable|boolean', 'product_category' => 'nullable|string|max:20', 'part_type' => 'nullable|string|max:20', // 동적 필드 (JSON) 'attributes' => 'nullable|array', // Material 전용 필드 'material_code' => 'nullable|string|max:50', 'item_name' => 'nullable|string|max:255', 'specification' => 'nullable|string|max:255', 'is_inspection' => 'nullable|string|in:Y,N', 'search_tag' => 'nullable|string|max:255', 'remarks' => 'nullable|string', 'options' => 'nullable|array', ]; } public function messages(): array { return [ 'code.required' => '품목코드는 필수입니다.', 'code.max' => '품목코드는 50자 이내로 입력하세요.', 'code.unique' => '이미 사용 중인 품목코드입니다.', 'name.required' => '품목명은 필수입니다.', 'name.max' => '품목명은 255자 이내로 입력하세요.', 'product_type.required' => '품목 유형은 필수입니다.', 'product_type.in' => '품목 유형은 FG, PT, SM, RM, CS 중 하나여야 합니다.', 'unit.required' => '단위는 필수입니다.', 'unit.max' => '단위는 20자 이내로 입력하세요.', 'category_id.exists' => '존재하지 않는 카테고리입니다.', 'safety_stock.min' => '안전재고는 0 이상이어야 합니다.', 'lead_time.min' => '리드타임은 0 이상이어야 합니다.', ]; } }