|
|
@@ -0,0 +1,60 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Notifications\Push\Prestador\Agendamento;
|
|
|
+
|
|
|
+use App\Enums\PushNotificationCategoryEnum;
|
|
|
+use App\Enums\PushNotificationTargetEnum;
|
|
|
+use App\Notifications\Push\BasePushNotification;
|
|
|
+use Illuminate\Database\Eloquent\Collection;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Notificação enviada quando um cliente cria
|
|
|
+ * um agendamento direto para um prestador.
|
|
|
+ */
|
|
|
+class NewPushRequest extends BasePushNotification
|
|
|
+{
|
|
|
+ public function __construct(
|
|
|
+ private readonly string $clientName,
|
|
|
+ ) {}
|
|
|
+
|
|
|
+ public function label(): string
|
|
|
+ {
|
|
|
+ return 'provider_new_schedule_request';
|
|
|
+ }
|
|
|
+
|
|
|
+ public function title(): string
|
|
|
+ {
|
|
|
+ return 'Nova solicitação';
|
|
|
+ }
|
|
|
+
|
|
|
+ public function body(): string
|
|
|
+ {
|
|
|
+ return "{$this->clientName} solicitou um novo agendamento.";
|
|
|
+ }
|
|
|
+
|
|
|
+ public function target(): PushNotificationTargetEnum
|
|
|
+ {
|
|
|
+ return PushNotificationTargetEnum::PRESTADOR;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function category(): PushNotificationCategoryEnum
|
|
|
+ {
|
|
|
+ return PushNotificationCategoryEnum::AGENDA;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function eligibleUsers(): Collection
|
|
|
+ {
|
|
|
+ // Não utilizado para notificações transacionais.
|
|
|
+ return new Collection();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function notificationCooldownDays(): int
|
|
|
+ {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function categoryCooldownDays(): int
|
|
|
+ {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+}
|