Procházet zdrojové kódy

feat: :sparkles: feat (agendamentos-associado) criado agendamentos no layout associado

foi criado o fluxo de agendamentos no layout associado, com possibilidade de criar e ver o historico de agendamentos

fase:dev | origin:escopo
Gustavo Zanatta před 3 týdny
rodič
revize
3eb1b4aef3

+ 1 - 1
app/Http/Resources/AppointmentResource.php

@@ -20,7 +20,7 @@ class AppointmentResource extends JsonResource
             'partner_agreement_service_id' => $this->partner_agreement_service_id,
             'partner_agreement_service'    => $this->whenLoaded('partnerAgreementService', fn() => new PartnerAgreementServiceResource($this->partnerAgreementService)),
             'date'                         => $this->date?->format('Y-m-d'),
-            'time'                         => $this->time,
+            'time'                         => Carbon::parse($this->time)->format('H:i'),
             'observations'                 => $this->observations,
             'requested_at'                 => $this->requested_at?->format('Y-m-d H:i:s'),
             'status'                       => $this->status,

+ 6 - 1
database/seeders/PermissionSeeder.php

@@ -173,12 +173,17 @@ class PermissionSeeder extends Seeder
                         "bits" => Permission::CRUD,
                         "children" => [],
                     ],
-
                     [
                        "scope" => "associado.loja",
                         "description" => "Loja do Associado",
                         "bits" => Permission::VIEW,
                         "children" => [], 
+                    ],
+                    [
+                       "scope" => "associado.agendamento",
+                        "description" => "Agendamento do Associado",
+                        "bits" => Permission::VIEW,
+                        "children" => [], 
                     ]
                 ],
             ],

+ 5 - 3
database/seeders/UserTypePermissionSeeder.php

@@ -38,15 +38,17 @@ class UserTypePermissionSeeder extends Seeder
                         ['scope' => 'associado.convenio',     'bits' => Permission::VIEW | Permission::MENU],
                         ['scope' => 'associado.dependente',   'bits' => Permission::VIEW | Permission::ADD | Permission::EDIT | Permission::DELETE | Permission::MENU],
                         ['scope' => 'notificacao',            'bits' => Permission::VIEW | Permission::MENU],
-                        ['scope' => 'agendamento',            'bits' => Permission::VIEW | Permission::ADD | Permission::EDIT],
+                        ['scope' => 'associado.agendamento',  'bits' => Permission::VIEW | Permission::ADD | Permission::EDIT | Permission::MENU],
+                        ['scope' => 'agendamento',            'bits' => Permission::VIEW | Permission::ADD | Permission::EDIT | Permission::MENU],
                         ['scope' => 'config.user',            'bits' => Permission::VIEW | Permission::EDIT],
                         ['scope' => 'parceiro.convenio',      'bits' => Permission::VIEW],
+                        ['scope' => 'parceiro.servico',       'bits' => Permission::VIEW],
                         ['scope' => 'loja.item',              'bits' => Permission::VIEW],
-                        ['scope' => 'associado.loja', 'bits' => Permission::VIEW | Permission::MENU ],
+                        ['scope' => 'associado.loja',         'bits' => Permission::VIEW | Permission::MENU ],
                         ['scope' => 'categoria',              'bits' => Permission::VIEW],
                         ['scope' => 'config.position',        'bits' => Permission::VIEW],
                         ['scope' => 'config.sector',          'bits' => Permission::VIEW],
-                        ['scope' => 'dashboard',            'bits' => Permission::VIEW | Permission::MENU],
+                        ['scope' => 'dashboard',              'bits' => Permission::VIEW | Permission::MENU],
                     ];
                     break;
 

+ 1 - 1
routes/authRoutes/appointment.php

@@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Route;
 Route::controller(AppointmentController::class)->prefix('appointment')->group(function () {
     Route::get('/', 'index')->middleware('permission:agendamento,view');
 
-    Route::get('/my', 'myAppointments')->middleware('permission:agendamento,view');
+    Route::get('/my', 'myAppointments')->middleware('permission:associado.agendamento,view');
 
     Route::post('/', 'store')->middleware('permission:agendamento,add');