'required|string|max:50', 'W0' => 'required|numeric|min:100|max:20000', 'H0' => 'required|numeric|min:100|max:20000', // 선택 입력 (기본값 있음) 'QTY' => 'nullable|integer|min:1', 'PC' => 'nullable|string|in:SCREEN,STEEL', 'GT' => 'nullable|string|in:wall,ceiling,floor', 'MP' => 'nullable|string|in:single,three', 'CT' => 'nullable|string|in:basic,smart,premium', 'WS' => 'nullable|numeric|min:0|max:500', 'INSP' => 'nullable|numeric|min:0', // 디버그 모드 (개발용) 'debug' => 'nullable|boolean', ]; } public function attributes(): array { return [ 'finished_goods_code' => __('validation.attributes.finished_goods_code'), 'W0' => __('validation.attributes.open_width'), 'H0' => __('validation.attributes.open_height'), 'QTY' => __('validation.attributes.quantity'), 'PC' => __('validation.attributes.product_category'), 'GT' => __('validation.attributes.guide_rail_type'), 'MP' => __('validation.attributes.motor_power'), 'CT' => __('validation.attributes.controller'), 'WS' => __('validation.attributes.wing_size'), 'INSP' => __('validation.attributes.inspection_fee'), ]; } public function messages(): array { return [ 'finished_goods_code.required' => __('error.finished_goods_code_required'), 'W0.required' => __('error.open_width_required'), 'W0.min' => __('error.open_width_min'), 'W0.max' => __('error.open_width_max'), 'H0.required' => __('error.open_height_required'), 'H0.min' => __('error.open_height_min'), 'H0.max' => __('error.open_height_max'), ]; } /** * 입력 변수 배열 반환 (FormulaEvaluatorService용) */ public function getInputVariables(): array { $validated = $this->validated(); return [ 'W0' => (float) $validated['W0'], 'H0' => (float) $validated['H0'], 'QTY' => (int) ($validated['QTY'] ?? 1), 'PC' => $validated['PC'] ?? 'SCREEN', 'GT' => $validated['GT'] ?? 'wall', 'MP' => $validated['MP'] ?? 'single', 'CT' => $validated['CT'] ?? 'basic', 'WS' => (float) ($validated['WS'] ?? 50), 'INSP' => (float) ($validated['INSP'] ?? 50000), ]; } }