| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace App\Notifications\Push\Cliente\EducativoConversao;
- use App\Enums\PushNotificationCategoryEnum;
- use App\Enums\PushNotificationTargetEnum;
- use App\Models\User;
- use App\Notifications\Push\BasePushNotification;
- use Illuminate\Database\Eloquent\Collection;
- class EducativoConversao2Push extends BasePushNotification
- {
- public function label(): string
- {
- return 'cliente_educ_conversao_2';
- }
- public function title(): string
- {
- return 'Quer mais chances de aceite?';
- }
- public function body(): string
- {
- return 'Pedidos Sob Medida aumentam a rapidez na confirmação.';
- }
- public function target(): PushNotificationTargetEnum
- {
- return PushNotificationTargetEnum::CLIENTE;
- }
- public function category(): PushNotificationCategoryEnum
- {
- return PushNotificationCategoryEnum::EDUCATIVO_CONVERSAO;
- }
- public function notificationCooldownDays(): int
- {
- return 28;
- }
- public function categoryCooldownDays(): int
- {
- return 14;
- }
- public function eligibleUsers(): Collection
- {
- return User::whereHas('client')
- ->where('registration_complete', true)
- ->where(function ($query) {
- $query->whereDoesntHave('client.schedules', fn ($q) => $q->where('schedule_type', 'custom'))
- ->orWhereDoesntHave('client.schedules', fn ($q) => $q->where('schedule_type', 'custom')
- ->where('created_at', '>=', now()->subDays(30)));
- })
- ->get();
- }
- }
|