'sometimes|string|in:PRODUCT,MATERIAL', 'item_id' => 'sometimes|integer', 'client_group_id' => 'nullable|integer', // 원가 정보 'purchase_price' => 'nullable|numeric|min:0', 'processing_cost' => 'nullable|numeric|min:0', 'loss_rate' => 'nullable|numeric|min:0|max:100', // 판매가 정보 'margin_rate' => 'nullable|numeric|min:0|max:100', 'sales_price' => 'nullable|numeric|min:0', 'rounding_rule' => ['nullable', Rule::in(['round', 'ceil', 'floor'])], 'rounding_unit' => ['nullable', Rule::in([1, 10, 100, 1000])], // 메타 정보 'supplier' => 'nullable|string|max:255', 'effective_from' => 'sometimes|date', 'effective_to' => 'nullable|date|after_or_equal:effective_from', 'note' => 'nullable|string|max:1000', // 상태 'status' => ['nullable', Rule::in(['draft', 'active', 'inactive'])], // 변경 사유 (리비전 기록용) 'change_reason' => 'nullable|string|max:500', ]; } public function messages(): array { return [ 'effective_to.after_or_equal' => __('error.pricing.effective_to_must_be_after_from'), ]; } }