PrestadorAceitouPush.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace App\Notifications\Push\Cliente\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 ao cliente quando um prestador aceita seu agendamento
  9. * (agendamento padrão) ou envia uma proposta para um pedido sob medida.
  10. */
  11. class PrestadorAceitouPush extends BasePushNotification
  12. {
  13. public function __construct(
  14. private readonly string $providerName,
  15. private readonly bool $isProposal = false,
  16. ) {}
  17. public function label(): string
  18. {
  19. return 'client_provider_accepted';
  20. }
  21. public function title(): string
  22. {
  23. return $this->isProposal
  24. ? 'Nova proposta recebida'
  25. : 'Prestador confirmado! 🎉';
  26. }
  27. public function body(): string
  28. {
  29. return $this->isProposal
  30. ? "{$this->providerName} enviou uma proposta para o seu pedido sob medida."
  31. : "{$this->providerName} aceitou seu agendamento.";
  32. }
  33. public function target(): PushNotificationTargetEnum
  34. {
  35. return PushNotificationTargetEnum::CLIENTE;
  36. }
  37. public function category(): PushNotificationCategoryEnum
  38. {
  39. return PushNotificationCategoryEnum::AGENDA;
  40. }
  41. public function eligibleUsers(): Collection
  42. {
  43. return new Collection();
  44. }
  45. public function notificationCooldownDays(): int
  46. {
  47. return 0;
  48. }
  49. public function categoryCooldownDays(): int
  50. {
  51. return 0;
  52. }
  53. }