AMS manages the full appointment lifecycle — from browsing a doctor’s available time slots to cancelling a booked session — using MockAPI as the backend. Appointments are stored remotely and fetched into a Redux slice on demand. Conflict detection runs locally by comparing the incoming slot against already-booked times for the same doctor and day, preventing double-bookings without a dedicated server-side check.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Jay-byte389/AMS/llms.txt
Use this file to discover all available pages before exploring further.
Appointment Data Shape
Every appointment record sent to and received fromPOST /Appointments or GET /Appointments has the following structure:
Booking Flow
Open Doctor Info Screen
Navigate to a doctor’s detail screen via
navigation.navigate('Info', { doctor: item }). Read the doctor’s profile, career path, experience, and focus area before proceeding.Tap Schedule and Select a Date
Tap the Schedule button to switch the
DoctorInfo screen into calendar mode. A react-native-calendars Calendar component shows the current month with minDate set to today. Dates where all 15 time slots are already booked are automatically disabled (greyed out) and display a snackbar warning if tapped. Tap any available date to navigate to ScheduleScreen via navigation.navigate('Schedule', { doctor, selectedDate: day.dateString }).Pick a Time Slot
ScheduleScreen displays the 15 slots exported from src/utils/timeSlots.js (9:00 AM – 4:00 PM in 30-minute increments). Slots already booked for this doctor on this day are shown greyed-out and non-interactive. The default selected slot is 10:00 AM; tap any available slot to select it.Enter Patient Details
Below the time grid, fill in the patient form:
- Booking for — toggle between
YourselfandAnother Person - Full Name — free-text input
- Age — numeric input
- Gender —
Male,Female, orOthertoggle - Describe your problem — multi-line text area
Tap Book Appointment
Pressing Book Appointment validates all fields, checks On success a snackbar confirms the booking and the app navigates to
isSlotDisabled(selectedTime) as a final guard, then dispatches addAppointment which calls POST /Appointments:YourAppointment.Time Slots
AMS ships with a fixed set of 15 daily time slots defined insrc/utils/timeSlots.js:
available field is a static hint; live availability is computed at runtime from the Redux appointments list (see below).
Conflict Detection
ScheduleScreen derives the set of booked times for the selected doctor and day directly from Redux state, without any additional network request:
isSlotDisabled check runs again inside handleBook as a final guard before dispatching.
All Appointments Screen
TheAllAppointmentsScreen (bottom tab Appointments) shows the current user’s appointments in three tabs:
- Complete
- Upcoming
- Cancelled
Displays the full doctor list fetched from
GET /Doctors. Each card shows avatar, name, qualification, ratings, and two actions: Re-Book and Add Review.Upcoming tab and filters to the chosen date’s appointments only.
Home Screen Schedule Section
TheHomeScreen displays a schedule panel when the user has at least one real appointment. A horizontal week strip lets the user pick a day; the panel then shows the nearest upcoming appointment for that day:
Cancelling an Appointment
TheCancelAppointmentScreen (route CancelAppointment) provides four preset cancellation reasons — Rescheduling, Weather Conditions, Unexpected Work, and Others — plus a free-text override field. Submitting dispatches cancelAppointment:
BottomTabs with the Cancelled tab of AllAppointmentsScreen pre-selected.
Redux Appointments State
| Thunk | HTTP Method | Endpoint |
|---|---|---|
fetchAppointments | GET | /Appointments |
addAppointment | POST | /Appointments |
cancelAppointment | PUT | /Appointments/:id |