Przeglądaj źródła

feat: :sparkles: feat (modulo-de-notificação) Foi ajustado o modulo de notificação

Criado o modulo de notificação tanto da parte do cliente quanto na parte do prestador para poder mostra as listagens na dashboard de ambos

fase:dev | origin:escopo
kayo henrique 3 tygodni temu
rodzic
commit
14baeafa3a

+ 1 - 0
app/Http/Resources/DashboardClienteResource.php

@@ -24,6 +24,7 @@ class DashboardClienteResource extends JsonResource
             'providersClose'      => $this['providersClose'],
             'schedulesProposals'  => $this['schedulesProposals'],
             'todaySchedules'      => $this['todaySchedules'],
+            'notifications' => $this['notifications'],
             'has_payment_methods' => $this['has_payment_methods'],
         ];
     }

+ 1 - 0
app/Http/Resources/DashboardPrestadorResource.php

@@ -22,6 +22,7 @@ class DashboardPrestadorResource extends JsonResource
             'solicitations'  => $this['solicitations'],
             'nextSchedules'  => $this['nextSchedules'],
             'opportunities'  => $this['opportunities'],
+            'notifications' => $this['notifications'],
         ];
     }
 }

+ 21 - 1
app/Services/DashboardService.php

@@ -251,6 +251,16 @@ class DashboardService
             'providersClose'      => $providersClose,
             'todaySchedules'      => $todaySchedules,
             'schedulesProposals'  => $schedulesProposals,
+            'notifications' => [
+                [
+                    'id' => 1,
+                    'title' => 'Serviço agendado!',
+                    'description' => 'Diária confirmada com Marina, 04/11 das 09h30 às 17h30 esse e o cliente',
+                    'time' => 'Há 2 minutos',
+                    'read' => false,
+                    'avatar' => '/icons/avatar.svg'
+                ]
+            ],
             'has_payment_methods' => $hasPaymentMethods,
         ];
     }
@@ -284,7 +294,7 @@ class DashboardService
             ->pluck('speciality_id')
             ->all();
 
-        $specialities = $allSpecialities->map(fn ($sp) => [
+        $specialities = $allSpecialities->map(fn($sp) => [
             'id'             => $sp->id,
             'description'    => $sp->description,
             'has_speciality' => in_array($sp->id, $providerSpecialityIds),
@@ -455,6 +465,16 @@ class DashboardService
             'todayServices'  => $todayServices,
             'nextSchedules'  => $nextSchedules,
             'opportunities'  => $opportunities,
+            'notifications' => [
+                [
+                    'id' => 1,
+                    'title' => 'Serviço agendado!',
+                    'description' => 'Diária confirmada com Marina, 04/11 das 09h30 às 17h30, esse e o prestador',
+                    'time' => 'Há 2 minutos',
+                    'read' => false,
+                    'avatar' => '/icons/avatar.svg'
+                ]
+            ],
         ];
     }
 }