Files
sam-api/app/Http/Requests/Api/V1/BomConditionRule/UpdateBomConditionRuleRequest.php
kent bf8036a64b feat: DB 연결 오버라이딩 및 대시보드 통계 위젯 추가
- DB 연결: 로컬/Docker 환경 오버라이딩 설정 (.env)
- 테넌트 위젯: redirect 버그 수정 (TenantSelectorWidget)
- 통계 위젯: 사용자/제품/자재/주문 카드 추가 (StatsOverviewWidget)
- 리소스 한국어화: Product, Material 모델 레이블 추가
- 대시보드: 위젯 등록 및 캐시 최적화

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 23:31:14 +09:00

66 lines
2.2 KiB
PHP

<?php
namespace App\Http\Requests\Api\V1\BomConditionRule;
use Illuminate\Foundation\Http\FormRequest;
class UpdateBomConditionRuleRequest 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' => ['sometimes', 'string', 'max:100'],
'ref_type' => ['sometimes', 'string', 'in:MATERIAL,PRODUCT'],
'ref_id' => ['sometimes', 'integer', 'min:1'],
'condition_expression' => ['sometimes', 'string', 'max:1000'],
'quantity_expression' => ['nullable', 'string', 'max:500'],
'waste_rate_expression' => ['nullable', 'string', 'max:500'],
'description' => ['nullable', 'string', 'max:500'],
'priority' => ['sometimes', 'integer', 'min:0'],
'is_active' => ['sometimes', '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
{
if ($this->has('is_active')) {
$this->merge(['is_active' => $this->boolean('is_active')]);
}
if ($this->has('priority')) {
$this->merge(['priority' => $this->integer('priority')]);
}
}
}