commit9
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-30 20:02:30 +02:00
parent 6d14b4e6f0
commit c6373365bf
225 changed files with 15365 additions and 285 deletions
@@ -23,15 +23,18 @@ class StoreRequisitionRequest extends FormRequest
'needed_by' => ['required', 'date_format:Y-m-d', 'after_or_equal:today'],
'justification' => ['required', 'string', 'min:10', 'max:5000'],
'items' => ['required', 'array', 'min:1', 'max:50'],
'items.*.description' => ['required', 'string', 'max:255'],
'items.*.category' => ['required', 'string', 'max:100'],
'items.*.purchase_type' => ['required', Rule::in(['consumable', 'service', 'other', 'equipment', 'spare_part'])],
'items.*.catalogue_entry_id' => 'nullable|integer|min:1',
'items.*.catalogue_version' => 'nullable|required_with:items.*.catalogue_entry_id|integer|min:1',
'items.*.source_line_id' => 'nullable|integer|min:1',
'items.*.description' => ['required_without:items.*.catalogue_entry_id', 'string', 'max:255'],
'items.*.category' => ['required_without:items.*.catalogue_entry_id', 'string', 'max:100'],
'items.*.purchase_type' => ['required_without:items.*.catalogue_entry_id', Rule::in(['consumable', 'service', 'other', 'equipment', 'spare_part'])],
'items.*.equipment_id' => ['exclude_unless:items.*.purchase_type,spare_part', 'required', 'integer', Rule::exists('equipment', 'id')->where('tenant_id', $this->user()?->tenant_id)->where('department_id', $this->user()?->department_id)],
'items.*.spare_part_id' => ['exclude_unless:items.*.purchase_type,spare_part', 'required', 'integer', Rule::exists('spare_parts', 'id')->where('tenant_id', $this->user()?->tenant_id)],
'items.*.production_area' => 'exclude_unless:items.*.purchase_type,equipment|required|string|max:200',
'items.*.downtime_started_at' => 'exclude_unless:items.*.purchase_type,spare_part|nullable|date_format:Y-m-d\TH:i|before_or_equal:now',
'items.*.quantity' => ['required', 'numeric', 'min:0.001', 'max:1000000', 'regex:/^\d+(\.\d{1,3})?$/'],
'items.*.unit' => ['required', 'string', 'max:30'],
'items.*.unit' => ['required_without:items.*.catalogue_entry_id', 'string', 'max:30'],
'items.*.unit_price' => ['required', 'numeric', 'min:0.01', 'max:100000000', 'regex:/^\d+(\.\d{1,2})?$/'],
'items.*.tax_rate' => ['required', 'numeric', 'between:0,100', 'regex:/^\d+(\.\d{1,2})?$/'],
];