NewPushRequest.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace App\Notifications\Push\Prestador\Agendamento;
  3. use App\Enums\PushNotificationCategoryEnum;
  4. use App\Enums\PushNotificationTargetEnum;
  5. use App\Notifications\Push\BasePushNotification;
  6. use Illuminate\Database\Eloquent\Collection;
  7. /**
  8. * Notificação enviada quando um cliente cria
  9. * um agendamento direto para um prestador.
  10. */
  11. class NewPushRequest extends BasePushNotification
  12. {
  13. public function __construct(
  14. private readonly string $clientName,
  15. ) {}
  16. public function label(): string
  17. {
  18. return 'provider_new_schedule_request';
  19. }
  20. public function title(): string
  21. {
  22. return 'Nova solicitação';
  23. }
  24. public function body(): string
  25. {
  26. return "{$this->clientName} solicitou um novo agendamento.";
  27. }
  28. public function target(): PushNotificationTargetEnum
  29. {
  30. return PushNotificationTargetEnum::PRESTADOR;
  31. }
  32. public function category(): PushNotificationCategoryEnum
  33. {
  34. return PushNotificationCategoryEnum::AGENDA;
  35. }
  36. public function eligibleUsers(): Collection
  37. {
  38. // Não utilizado para notificações transacionais.
  39. return new Collection();
  40. }
  41. public function notificationCooldownDays(): int
  42. {
  43. return 0;
  44. }
  45. public function categoryCooldownDays(): int
  46. {
  47. return 0;
  48. }
  49. }