forked from admin/services_core
Giant Update
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Notification;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class SaveNotificationPreferencesRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'preferences' => ['required', 'array'],
|
||||
'preferences.*.tenant_id' => ['nullable', 'integer', 'exists:tenants,id'],
|
||||
'preferences.*.notification_event_id' => ['required', 'integer', 'exists:notification_events,id'],
|
||||
'preferences.*.notification_channel_id' => ['nullable', 'integer', 'exists:notification_channels,id'],
|
||||
'preferences.*.channel' => ['required', Rule::in(['system', 'whatsapp_official', 'whatsapp_unofficial', 'email', 'telegram'])],
|
||||
'preferences.*.enabled' => ['required', 'boolean'],
|
||||
'preferences.*.priority' => ['nullable', 'integer', 'between:1,20'],
|
||||
'preferences.*.send_delay_minutes' => ['nullable', 'integer', 'between:0,10080'],
|
||||
'preferences.*.quiet_hours_start' => ['nullable', 'date_format:H:i'],
|
||||
'preferences.*.quiet_hours_end' => ['nullable', 'date_format:H:i'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user