feat(appointment): real for-another-patient form and booking payload
Replace the mock for-another button with a real toggle: switching keeps the user's own data, clears the form to editable patient fields (phone becomes an input, adds علت مراجعه), and can switch back. SubmitData now sends for_self plus patient_* only when booking for someone else, skips the self-profile PATCH/POST in that case, stores the booking expires_at, and surfaces a clearer 409 message. Thread appointmentExpiresAt through the wizard to the payment step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,8 @@ function Container({
|
||||
setSelectedDate,
|
||||
appointmentId,
|
||||
setAppointmentId,
|
||||
appointmentExpiresAt,
|
||||
setAppointmentExpiresAt,
|
||||
}) {
|
||||
const elements = [
|
||||
<Date
|
||||
@@ -73,8 +75,16 @@ function Container({
|
||||
selectedSlot={selectedSlot}
|
||||
selectedDate={selectedDate}
|
||||
setAppointmentId={setAppointmentId}
|
||||
setAppointmentExpiresAt={setAppointmentExpiresAt}
|
||||
/>,
|
||||
<Paying
|
||||
setStep={setStep}
|
||||
appointmentId={appointmentId}
|
||||
expiresAt={appointmentExpiresAt}
|
||||
doctor={doctor}
|
||||
selectedSlot={selectedSlot}
|
||||
selectedDate={selectedDate}
|
||||
/>,
|
||||
<Paying setStep={setStep} appointmentId={appointmentId} />,
|
||||
<SuccessPay setStep={setStep} />,
|
||||
<FailedPay setStep={setStep} />,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user