feat: Implement resource-based appointment booking flow
- Updated DoctorPage component to accept bookingResources prop for appointment list. - Added serviceQuery function to serialize service item UUIDs for API requests. - Introduced new API endpoints for fetching booking resources and resource slots. - Enhanced tests for new resource-based booking functionality, including resource selection and service availability. - Created ResourceSelect component for selecting appointment types, including doctor and resource options. - Updated appointment submission logic to include resource_uuid in payload when applicable. - Ensured UI reflects changes in booking flow without disrupting existing doctor-centric experience.
This commit is contained in:
@@ -13,7 +13,9 @@ function Date({
|
||||
onChangeService,
|
||||
selectedLocation = null,
|
||||
clinicUuid = null,
|
||||
resourceUuid = null,
|
||||
onChangeLocation,
|
||||
onChangeResource,
|
||||
onDateChange,
|
||||
closedOnDate = false,
|
||||
}) {
|
||||
@@ -29,7 +31,7 @@ function Date({
|
||||
<div
|
||||
className="p-0 lg:p-[24px] rounded-[8px] border border-solid border-transparent lg:border-[#EFEFEF] bg-transparent lg:bg-[#FFF]"
|
||||
>
|
||||
{(onChangeLocation || (serviceMode && onChangeService)) && (
|
||||
{(onChangeLocation || onChangeResource || (serviceMode && onChangeService)) && (
|
||||
<div className="mb-3 flex flex-wrap items-center gap-x-4 gap-y-1">
|
||||
{onChangeLocation && (
|
||||
<button
|
||||
@@ -40,6 +42,15 @@ function Date({
|
||||
← تغییر محل{selectedLocation?.title ? ` (${selectedLocation.title})` : ""}
|
||||
</button>
|
||||
)}
|
||||
{onChangeResource && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onChangeResource}
|
||||
className="text-[13px] text-[#5559CE] hover:underline"
|
||||
>
|
||||
← تغییر نوع نوبت
|
||||
</button>
|
||||
)}
|
||||
{serviceMode && onChangeService && (
|
||||
<button
|
||||
type="button"
|
||||
@@ -72,6 +83,8 @@ function Date({
|
||||
isStep
|
||||
disabledDates={disabledDates}
|
||||
clinicUuid={clinicUuid}
|
||||
resourceUuid={resourceUuid}
|
||||
selectedServiceUuids={selectedServiceUuids}
|
||||
/>
|
||||
<Hour
|
||||
isStep
|
||||
@@ -83,6 +96,7 @@ function Date({
|
||||
serviceMode={serviceMode}
|
||||
selectedServiceUuids={selectedServiceUuids}
|
||||
clinicUuid={clinicUuid}
|
||||
resourceUuid={resourceUuid}
|
||||
selectedLocation={selectedLocation}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user