Simple 4-step system: Client books β ONLINE Nurse selected β Nurse accepts β Nurse navigates to PATIENT (not just client) β Care starts. Works for family bookings across cities (Accra client booking for mother in Kumasi).
Go to nurse-register.html β nurse-login.html β nurses-dashboard.html
CRITICAL β Only ONLINE nurses show for clients! Offline nurses are hidden and won't pop up.
CLIENT (Accra) NURSE (Kumasi)
| |
| 1. Auto-capture client lat/lng | 1. Register + Save Name Photo Email Phone
| via geolocation + map drag | + Time + Location
| | 2. Tap π’ Go ONLINE β Writes to
| | onlineNurses, nursePresence,
| | nurseLocations (lat/lng)
| |
| 2. Search ONLINE Only (radius 10km) |
| Fetches nurses + onlineNurses + |
| nursePresence + nurseLocations |
| Filters isNurseOnline() true only |
| β Only ONLINE nurses show |
| Offline hidden, won't pop up |
| |
| 3. Select nurse β Preview π’ ONLINE |
| |
| 4. Enter PATIENT details |
| Same as client? Checked = same lat |
| Different? Drag map to Kumasi house |
| + Set Patient Location = Map Center |
| β patientLat, patientLng = Kumasi |
| |
| 5. Calc total: GHS 17/hr Γ 9hrs + 100 |
| Full: Pay GHS 253 now |
| 50%: Pay GHS 126.50 now, 126.50 later|
| |
| 6. Pay via Paystack β bookingId |
| Saves to bookings, myJobOffers/{nurseId},
| ceoBookings, allBookings |
| |
|--------------------------------------->|
| Booking created | my-job-offer.html detects NEW ID
| | β ringNurseTone() β Custom song
| | + Vibrate + Notification + SMS:
| | "NEW BOOKING! Client booked you!
| | GHS 150, Patient Ama at Kumasi"
| |
| | 7. Accept β Updates status ACCEPTED
| | Starts GPS watchPosition
| | Shares to nurseLocations,
| | liveNurseLocations, ceoBookings
| | Auto opens Google Maps:
| | dir/?api=1&origin=nurseLat,lng
| | &destination=patientLat,lng
| | β Navigates to PATIENT house in
| | Kumasi (not client Accra!)
| |
|<---------------------------------------|
| Nurse accepted + on the way | Calls patient + client
| client-alerts.html: |
| ringCustomTone accepted β |
| Your custom song rings + Vibrate |
| + Notification + SMS: |
| "Nurse Ama ACCEPTED LCG-FULL-... |
| GHS 150. Call: +233..." |
| Shows nurse photo phone + |
| Buttons: Call, WhatsApp, Navigate |
| to PATIENT, Play Tone Again |
| |
| 8. Nurse arrives β ARRIVED β INSERVICE |
| Tracking continues |
| |
| 9. Job completed β COMPLETED |
| Payout 80% nurse 20% CEO |
| Ratings + Reviews |
Current rules miss new nodes for ONLINE filter + SMS + Tone. Add:
Without these, clients see "Permission denied" and ONLINE filter fails. Publish updated rules in Firebase Console β Realtime Database β Rules.
Only ONLINE nurses can be booked β They have green dot + blinking on map + π’ ONLINE badge