feat(appointment): ensure existing profile name is used over modal input for patient name
This commit is contained in:
@@ -123,7 +123,11 @@ class MyAppointmentsController extends BaseController
|
||||
if (isset($data['deposit_amount_rials'])) {
|
||||
$appointment->setDepositAmountRials((int) $data['deposit_amount_rials']);
|
||||
}
|
||||
$appointment->setPatientName($patientName);
|
||||
// The resolver returns the patient keyed on national code, so its profile
|
||||
// name is the real identity. Snapshot that (not the free-typed modal name)
|
||||
// so the appointment never diverges from an existing profile; fall back to
|
||||
// the entered name only for a brand-new patient without a stored name.
|
||||
$appointment->setPatientName($patient->getRealName() ?: $patientName);
|
||||
$appointment->setPatientMobile($mobile);
|
||||
|
||||
if ($isReserve) {
|
||||
|
||||
Reference in New Issue
Block a user