Umsetzung der Warenwirtschafts-/Produktmanagement-Erweiterung gemaess Entwicklungsplan V4.0: - AP-00: Regressionsbasis fuer 5.1-Features (ProductPhase51Test) - AP-01: URL-Bugfixes B1/B2 (suppliers/packaging-items, breitere url-Spalten) - AP-04/04.1: iPad-taugliche, vereinheitlichte Tabellen-Aktionen - AP-05: Einstellungen "Allgemein" mit UST-Saetzen (tax_rates) und Lieferzeit-Vorlagen (delivery_times, inkl. Tage-Feld) - AP-06: Lieferanten um Bestellweg, Bestell-Mail/-URL und Lieferzeit erweitert - AP-07/07.1: INCI um Lieferanten-Mehrfachwahl, UST und Lieferzeit erweitert; Lieferanten-Detailansicht im Modal mit pflegbaren INCI-/Verpackungslisten - AP-08: Einkauf um UST-Snapshot, Netto/Brutto-Automatik und Duplizieren erweitert Entwicklungsplan aktualisiert: alle Klaerungspunkte (§5) vom Kunden beantwortet und in die jeweiligen APs eingearbeitet (AP-02/03/09/13/15), neues AP-18 (Hinweise-Doku unter Einstellungen) ergaenzt. Naechster Schritt eindeutig markiert: AP-09 (Produktion auf Hersteller-Rezeptur, kein Fallback, Warnung).
45 lines
1.6 KiB
PHP
45 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Inventory;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateSupplierRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, array<int, mixed>>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'name' => ['required', 'string', 'max:255'],
|
|
'url' => ['nullable', 'string', 'max:2048'],
|
|
'order_method' => ['nullable', 'in:email,online_shop'],
|
|
'order_email' => ['nullable', 'email', 'max:255'],
|
|
'order_url' => ['nullable', 'string', 'max:2048'],
|
|
'delivery_time' => ['nullable', 'string', 'max:255'],
|
|
'delivery_time_days' => ['nullable', 'integer', 'min:0', 'max:65535'],
|
|
'contact_person' => ['nullable', 'string', 'max:255'],
|
|
'email' => ['nullable', 'email', 'max:255'],
|
|
'phone' => ['nullable', 'string', 'max:100'],
|
|
'country_id' => ['required', 'integer', 'exists:countries,id'],
|
|
'notes' => ['nullable', 'string'],
|
|
'active' => ['sometimes', 'boolean'],
|
|
'supplier_category_ids' => ['nullable', 'array'],
|
|
'supplier_category_ids.*' => ['integer', 'exists:supplier_categories,id'],
|
|
];
|
|
}
|
|
|
|
protected function prepareForValidation(): void
|
|
{
|
|
$this->merge([
|
|
'active' => $this->boolean('active'),
|
|
'delivery_time_days' => $this->input('delivery_time_days', '') === '' ? null : $this->input('delivery_time_days'),
|
|
]);
|
|
}
|
|
}
|