- DB 연결: 로컬/Docker 환경 오버라이딩 설정 (.env) - 테넌트 위젯: redirect 버그 수정 (TenantSelectorWidget) - 통계 위젯: 사용자/제품/자재/주문 카드 추가 (StatsOverviewWidget) - 리소스 한국어화: Product, Material 모델 레이블 추가 - 대시보드: 위젯 등록 및 캐시 최적화 🤖 Generated with [Claude Code](https://claude.ai/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
63 lines
2.1 KiB
PHP
63 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api\V1\BomConditionRule;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class CreateBomConditionRuleRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'name' => ['required', 'string', 'max:100'],
|
|
'ref_type' => ['required', 'string', 'in:MATERIAL,PRODUCT'],
|
|
'ref_id' => ['required', 'integer', 'min:1'],
|
|
'condition_expression' => ['required', 'string', 'max:1000'],
|
|
'quantity_expression' => ['nullable', 'string', 'max:500'],
|
|
'waste_rate_expression' => ['nullable', 'string', 'max:500'],
|
|
'description' => ['nullable', 'string', 'max:500'],
|
|
'priority' => ['integer', 'min:0'],
|
|
'is_active' => ['boolean'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get custom attribute names for validator errors.
|
|
*/
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'name' => __('validation.attributes.rule_name'),
|
|
'ref_type' => __('validation.attributes.ref_type'),
|
|
'ref_id' => __('validation.attributes.ref_id'),
|
|
'condition_expression' => __('validation.attributes.condition_expression'),
|
|
'quantity_expression' => __('validation.attributes.quantity_expression'),
|
|
'waste_rate_expression' => __('validation.attributes.waste_rate_expression'),
|
|
'description' => __('validation.attributes.description'),
|
|
'priority' => __('validation.attributes.priority'),
|
|
'is_active' => __('validation.attributes.is_active'),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Prepare the data for validation.
|
|
*/
|
|
protected function prepareForValidation(): void
|
|
{
|
|
$this->merge([
|
|
'is_active' => $this->boolean('is_active', true),
|
|
'priority' => $this->integer('priority', 0),
|
|
]);
|
|
}
|
|
} |