瀏覽代碼

Appointment overhaul (wip)

Vijayakrishnan 3 年之前
父節點
當前提交
c79f70cb48

+ 6 - 12
app/Http/Controllers/GuestController.php

@@ -58,10 +58,8 @@ class GuestController extends Controller
         $appointment = Appointment::where('uid', $appointmentUid)->first();
         abort_if(!count($appointment->confirmationRequests), 404, 'No confirmation requests on this appointment.');
         abort_if(!$appointment, 404, 'Invalid url');
-        abort_if($appointment->status == 'CANCELLED', 404, 'Appointment has been cancelled');
-        abort_if($appointment->status == 'COMPLETED', 404, 'Appointment has been completed'); 
-        abort_if($appointment->status == 'ABANDONED', 404, 'Appointment has been abandoned');
-       
+        abort_if($appointment->status == 'COMPLETED', 404, 'Appointment has been completed');
+
        return view('app.guest.appointment-confirmation', compact('appointment'));
     }
 
@@ -70,22 +68,18 @@ class GuestController extends Controller
         $appointment = Appointment::where('uid', $appointmentUid)->first();
         abort_if(!count($appointment->confirmationRequests), 404, 'No confirmation requests on this appointment.');
         abort_if(!$appointment, 404, 'Invalid url');
-        abort_if($appointment->status == 'CANCELLED', 404, 'Appointment has been cancelled');
-        abort_if($appointment->status == 'COMPLETED', 404, 'Appointment has been completed'); 
-        abort_if($appointment->status == 'ABANDONED', 404, 'Appointment has been abandoned');
+        abort_if($appointment->status == 'COMPLETED', 404, 'Appointment has been completed');
 
         $decision = $request->get('decision');
         $memo = $request->get('memo');
         $response = null;
         $data = [
             'uid' => $appointment->uid,
-            'memo' => $memo
+            'memo' => $memo,
+            'confirmationDecisionEnum' => ($decision == 'REJECT' ? 'CANCELLED' : 'CONFIRMED')
         ];
 
-        $url = '/appointment/confirmationDecisionAccept';
-        if($decision == 'REJECT'){
-            $url = '/appointment/confirmationDecisionReject';
-        }
+        $url = '/appointment/putConfirmationDecision';
 
         $response = $this->calljava($request, $url, $data);
 

+ 1 - 1
resources/views/app/guest/appointment-confirmation.blade.php

@@ -29,7 +29,7 @@
                         <p class="mb-2 text-secondary font-weight-bold">Appointment status history</p>
                         <div class="bg-light px-2 pt-2 border rounded mb-3">
                             @foreach($appointment->confirmationDecisions as $decision)
-                                <div class="mb-2"><b>{{$decision->accepted_or_rejected_or_waived}}</b> on <b>{{friendlier_date_time($decision->created_at)}}</b>
+                                <div class="mb-2"><b>{{$decision->decision_enum}}</b> on <b>{{friendlier_date_time($decision->created_at)}}</b>
                                     @if($decision->session && $decision->session->pro)
                                         by <b>{{$decision->session->pro->displayName()}}</b>
                                     @elseif($decision->session && $decision->session->client)

+ 1 - 1
resources/views/app/patient/partials/appointment-confirmation-history.blade.php

@@ -24,7 +24,7 @@ $cDecisions = $appointment->confirmationDecisions;
     <p class="my-2"><b>Decisions</b></p>
     @foreach($cDecisions as $cDecision)
         <div class="bg-light p-1 my-1 border border">
-            <b class="{{$cDecision->accepted_or_rejected_or_waived === 'ACCEPTED' ? 'text-success' : 'text-warning-mellow'}}">{{$cDecision->accepted_or_rejected_or_waived}}</b> on {{ friendly_date_time($cDecision->created_at) }}
+            <b class="{{$cDecision->decision_enum === 'CONFIRMED' ? 'text-success' : 'text-warning-mellow'}}">{{$cDecision->decision_enum}}</b> on {{ friendly_date_time($cDecision->created_at) }}
             @if($cDecision->memo)
                 <div class="text-sm">
                     <i>{{$cDecision->memo}}</i>

+ 6 - 6
resources/views/app/patient/partials/appointment-confirmation.blade.php

@@ -7,14 +7,14 @@
             </div>
         @endif
         @if($appointment->latest_confirmation_decision_at)
-            @if($appointment->latestConfirmationDecision->accepted_or_rejected_or_waived === 'ACCEPTED')
+            @if($appointment->latestConfirmationDecision->decision_enum === 'CONFIRMED')
                 <div class="text-nowrap">
-                    <b class="text-success">{{ucwords($appointment->latestConfirmationDecision->accepted_or_rejected_or_waived)}}</b>
+                    <b class="text-success">{{ucwords($appointment->latestConfirmationDecision->decision_enum)}}</b>
                     <span class="text-secondary ml-1">on {{friendlier_date_time(convertToTimezone($appointment->latest_confirmation_decision_at, 'US/Eastern'))}}</span>
                 </div>
-            @elseif($appointment->latestConfirmationDecision->accepted_or_rejected_or_waived === 'REJECTED')
+            @elseif($appointment->latestConfirmationDecision->decision_enum === 'CANCELLED')
                 <div class="text-nowrap">
-                    <b class="text-warning-mellow">{{ucwords($appointment->latestConfirmationDecision->accepted_or_rejected_or_waived)}}</b>
+                    <b class="text-warning-mellow">{{ucwords($appointment->latestConfirmationDecision->decision_enum)}}</b>
                     <span class="text-secondary ml-1">on {{friendlier_date_time(convertToTimezone($appointment->latest_confirmation_decision_at, 'US/Eastern'))}}</span>
                 </div>
                 <div>
@@ -22,9 +22,9 @@
                         Re-schedule
                     </a>
                 </div>
-            @elseif($appointment->latestConfirmationDecision->accepted_or_rejected_or_waived === 'WAIVED')
+            @elseif($appointment->latestConfirmationDecision->decision_enum === 'WAIVED')
                 <div class="text-nowrap">
-                    <b class="text-warning-mellow">{{ucwords($appointment->latestConfirmationDecision->accepted_or_rejected_or_waived)}}</b>
+                    <b class="text-warning-mellow">{{ucwords($appointment->latestConfirmationDecision->decision_enum)}}</b>
                     <span class="text-secondary ml-1">on {{friendlier_date_time(convertToTimezone($appointment->latest_confirmation_decision_at, 'US/Eastern'))}}</span>
                 </div>
             @endif

+ 0 - 3
resources/views/layouts/guest_template.blade.php

@@ -65,9 +65,6 @@
 
         </div>
 
-        <a href="#" class="stag_rhs_toggle d-none d-md-block text-white" title="Toggle Video Pane">
-            <i class="fa fa-arrow-right"></i>
-        </a>
     </nav>
 
     <main role="main" class="stag-content px-0">