44 lines
1.6 KiB
PHP
44 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\PaymentIncident;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StorePaymentIncidentRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'title' => ['required', 'string', 'max:255'],
|
|
'description' => ['nullable', 'string'],
|
|
'notes' => ['nullable', 'string'],
|
|
'provider' => ['required', 'in:payone,paypal,other'], // stripe,mollie aktuell nicht aktiv
|
|
'type' => ['required', 'in:outage,ipn_error,payment_failure,slow_response,other'],
|
|
'severity' => ['required', 'in:low,medium,high,critical'],
|
|
'affected_orders' => ['nullable', 'integer', 'min:0'],
|
|
'affected_revenue' => ['nullable', 'numeric', 'min:0'],
|
|
'ticket_number' => ['nullable', 'string', 'max:100'],
|
|
'detected_at' => ['required', 'date'],
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'title.required' => 'Bitte einen Titel angeben.',
|
|
'provider.required' => 'Bitte einen Anbieter auswählen.',
|
|
'provider.in' => 'Ungültiger Anbieter.',
|
|
'type.required' => 'Bitte einen Incident-Typ auswählen.',
|
|
'type.in' => 'Ungültiger Incident-Typ.',
|
|
'severity.required' => 'Bitte eine Schwere angeben.',
|
|
'severity.in' => 'Ungültige Schwere.',
|
|
'detected_at.required' => 'Bitte ein Erkennungsdatum angeben.',
|
|
'detected_at.date' => 'Ungültiges Datum.',
|
|
];
|
|
}
|
|
}
|