4
0

2 Commits a13b0d9d49 ... 514fb065a6

Autor SHA1 Mensagem Data
  Vijayakrishnan Krishnan 514fb065a6 acknowledgeAsAppointmentPro logic fix há 5 dias atrás
  Vijayakrishnan Krishnan 5c41116bde acknowledgeAsAppointmentPro logic fix há 5 dias atrás

+ 10 - 6
app/Http/Controllers/AppointmentController.php

@@ -312,6 +312,8 @@ class AppointmentController extends Controller
             $appointment = Appointment::where('uid', $uid)->first();
             $data = [
                 'uid' => $uid,
+                'currentLatestConfirmationDecisionEnum' => $appointment->latest_confirmation_decision_enum,
+                'currentLatestConfirmationDecisionMemo' => $appointment->latest_confirmation_decision_memo,
                 'currentStatus' => $appointment->status,
                 'currentStatusMemo' => $appointment->status_memo,
                 'currentRawDate' => $appointment->raw_date,
@@ -319,18 +321,20 @@ class AppointmentController extends Controller
                 'currentRawEndTime' => $appointment->raw_end_time,
                 'currentTimezone' => $appointment->timezone,
             ];
-            $response = $this->callJavaApi('/appointment/'.$action, $data);
-    
+            $response = $this->callJavaApi('/appointment/' . $action, $data);
+
             if(!$response['success']){
                 array_push($failedUids, $uid);
                 array_push($failedMessages, $response['message']);
             }
-            if(count($failedUids)){
-                return $this->fail('Some appointment(s) failed to acknowledge. ' . $failedMessages[0]);
-            }
+        }
 
-            return $this->pass();
+        if(count($failedUids)){
+            return $this->fail('Some appointment(s) failed to acknowledge. ' . $failedMessages[0]);
         }
+
+        return $this->pass('Completed');
+
     }
 
 }

+ 11 - 1
resources/views/app/mcp/dashboard/notifications.blade.php

@@ -118,6 +118,16 @@ $apptsPending = [
                             <td>
                                 <form url="/api/appointment/acknowledgeDecisionAsAppointmentPro" discardable>
                                     <input type="hidden" name="uid" value="{{$appt->uid}}">
+                                    <input type="hidden" name="currentLatestConfirmationDecisionEnum" value="{{$appt->latest_confirmation_decision_enum}}">
+                                    @if($appt->latest_confirmation_decision_memo)
+                                        <input type="hidden" name="currentLatestConfirmationDecisionMemo" value="{{$appt->latest_confirmation_decision_memo}}">
+                                    @endif
+                                    <input type="hidden" name="currentStatus" value="{{$appt->status}}">
+                                    <input type="hidden" name="currentStatusMemo" value="{{$appt->statusMemo}}">
+                                    <input type="hidden" name="currentRawDate" value="{{$appt->raw_date}}">
+                                    <input type="hidden" name="currentRawStartTime" value="{{$appt->raw_start_time}}">
+                                    <input type="hidden" name="currentRawEndTime" value="{{$appt->raw_end_time}}">
+                                    <input type="hidden" name="currentTimezone" value="{{$appt->timezone}}">
                                     <button submit class="bg-transparent border-0 p-0 text-primary">Ack.</button>
                                 </form>
                             </td>
@@ -180,7 +190,7 @@ $apptsPending = [
 
                     $.post('/acknowledge-as-appointment-pro', {uids: UIDS, action: action}, function(response){
                         if(response.success){
-                            toastr.success();
+                            toastr.success('Completed');
                             location.reload();
                         }else{
                             toastr.error(response.message);