|
@@ -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);
|
|
|
|