Booking an inspection
Requesting a property tour, paying the inspection fee once the agent approves, and tracking every request on the My Inspections tab.
Where it lives
| Route | File | Who sees it |
|---|---|---|
/property/inspection | app/property/inspection.tsx | Tenant, from "Inspect" on a listing |
/property/inspection-payment | app/property/inspection-payment.tsx | Tenant, after tapping "Pay Now" on an approved inspection |
/property/inspection-verify | app/property/inspection-verify.tsx | Tenant, when the payment page redirects back |
/tenant/inspections | app/tenant/inspections.tsx | Tenant, the "Inspections" tab in the bottom bar |
Requests live in services/property/property-thunk.ts (cache propertyApi) and services/payment/payment-thunk.ts (cache paymentApi).
Before you start
- Signed in as a tenant. Name, email and phone on the form come from the
authslice. - No device permission is needed.
- The fee can only be paid after the agent or landlord has approved the request.
An inspection moves through these statuses on the backend:
| Status | Badge on My Inspections | Meaning |
|---|---|---|
pending_review | "Pending Review" | Request sent, waiting for the agent |
in_progress | "Payment Pending" | Agent approved; fee not yet paid |
scheduled | "Scheduled" | Fee paid, slot confirmed |
completed | "Completed" | Visit done |
cancelled | "Cancelled" | Agent rejected the request |
Flow
Requesting an inspection
- On a listing tap "Inspect". The app opens
/property/inspection?propertyId=...and loadsGET /api/v1/inspection/myandGET /api/v1/inspection/availability/:propertyId. Only theavailableDayslist from the availability response is used. When an agent has not set any, the API returns Monday to Friday. - If the tenant already has an inspection on this listing with status
scheduled,pending_revieworin_progress, the confirmation sheet from step 9 opens immediately over the form. - Select Tour Type. Two buttons, "Virtual" (default) and "In-person".
- Select available date and time. Two chips: the date as MM/DD/YY, defaulting to tomorrow, and the time.
-
Calendar. Tapping the date chip opens a month grid with previous and next arrows and SUN to SAT headers. Days before today are disabled. Days whose weekday is not in the agent's
availableDaysare also disabled. Tapping an enabled day selects it and closes the calendar. -
Time. Tapping the time chip opens three scroll wheels: hour 01 to 12, minute 00 to 59, and AM or PM. "Select Time" applies the wheel values to the chip.
-
Full Name, Email Address, Phone number are read-only and prefilled from the signed-in user.
-
Notes (Optional) is free text with the placeholder "I would like to know if...". There is no length check in the app; the API rejects a combined notes string longer than 500 characters.
-
Tap "Schedule Inspection" (reads "Scheduling..." while sending). Checks, in order:
- No
propertyIdparam: alert "Error" with "Property ID not found." - Selected date plus time is not later than now: alert "Error" with "Schedule date and time must be in the future."
Then
POST /api/v1/inspection/request: - No
{
"propertyId": "...",
"scheduledDate": "2026-12-01T09:30:00.000Z",
"notes": "Tour Type: Virtual\nNotes: <what the tenant typed>"
}- On success a full-screen sheet shows a tick, "Inspection Requested" and "Your request to visit this property has been successfully submitted to the agent." The button "View My Inspections" replaces the screen with
/tenant/inspections. The close icon replaces it with the listing at/property/[id]. - On failure an alert shows "Error" with the server message or "Failed to schedule inspection."
Time picker defaults do not match
The time chip first shows "12:55 PM", but the values actually sent are 08:21 AM until the tenant opens the picker and taps "Select Time". The wheels also open at the top (01, 00, AM) and only register a value after being scrolled. Always set the time explicitly when testing.
Unavailable days are only blocked in the calendar
The default date (tomorrow) is not checked against the agent's available days, and the API does not check the weekday either, so a request for an unavailable day can go through if the tenant never opens the calendar. The alert "Unavailable Day" exists in code but cannot appear, because disabled days do not accept taps. Available time slots returned by the API are not used.
Paying the inspection fee
The agent approves the request from their side. The inspection then has status in_progress and approval status approved, and "Pay Now" appears in two places:
- On the My Inspections tab, on the card with the "Payment Pending" badge.
- On
/property/inspectionfor that listing, where the sheet now reads "Inspection Approved" and "Your inspection request has been approved. You can now proceed to payment." The "Schedule Inspection" button behind it is disabled.
- Tap "Pay Now". The app sends
POST /api/v1/transaction/inspection/initialize:
{
"amount": 5000,
"propertyId": "...",
"inspectionId": "...",
"callbackUrl": "homelinkhub://property/inspection-verify?inspectionId=..."
}The amount is hardcoded in the app and ignored by the API, which charges the agent's own inspection fee or the platform default.
2. The response carries data.authorization_url and data.reference. The app pushes /property/inspection-payment with params authorizationUrl, inspectionId and reference.
3. The payment screen, titled "Pay Inspection Fee", loads the Paystack page in a webview with "Loading payment page…" on top until it finishes loading.
4. The tenant pays on the Paystack page. The screen watches every navigation; when the URL contains inspection-verify, starts with the app's deep link scheme, or contains trxref= or reference=, it replaces itself with /property/inspection-verify, passing inspectionId and reference (taken from the URL when it was not passed in).
5. The verify screen calls GET /api/v1/transaction/inspection/verify/:reference and shows "Confirming Payment…" with "Please wait while we verify your inspection payment."
6. When the response has success true and data.status equal to success, the screen shows "Inspection Confirmed!" and "Your inspection slot is locked in. The agent will be in touch with further details before the visit." A receipt card lists "Inspection Fee", "Reference", "Paid On" and "Status" with "Successful".
7. "View My Inspections" replaces the screen with /tenant/inspections. "Back to Home" replaces it with /tenant.
On a verified payment the backend marks the inspection paid, moves it to scheduled and syncs the agent's calendar.
My Inspections tab
- Open the "Inspections" tab. The list comes from
GET /api/v1/inspection/my, newest scheduled date first. - The header reads "My Inspections" and "N inspections found".
- Each card shows the listing photo (or a house icon), title, "community, state", the scheduled date and time, and the status badge from the table above.
- A card with status
in_progressalso shows "Pay Now", which starts the payment flow above. The button shows a spinner while the payment is being set up. - Pull down to refresh.
Cards cannot be opened, and there is no cancel or reschedule action in the app. A rejection reason entered by the agent is not displayed.
States and edge cases
- List loading. Full-screen loader with "Loading your inspections…".
- List error. A cloud-offline icon, "Could Not Load Inspections" and "Retry".
- Empty list. "No Inspections Yet", "When you request a property inspection, it will appear here." and "Browse Properties", which goes to
/tenant. The empty state has no pull to refresh. - Pay Now fails on the tab. The error is swallowed; the spinner stops and nothing else happens.
- Pay Now fails on the sheet. Alert "Error" with "Could not initialize payment. Please try again." when no payment link came back, or "Failed to start payment. Please try again." on a request error. The API answers "This inspection has already been paid for" for a paid inspection, but that text is not surfaced.
- Closing the payment page. The close icon asks "Cancel Payment" with "Are you sure you want to cancel this payment?" and the buttons "Continue Payment" and "Cancel". "Cancel" goes back; nothing is sent to the API.
- Payment link missing. "Payment Link Unavailable", "Could not load the payment page. Please go back and try again." and "Go Back".
- Payment page will not load. "Failed to Load", "Could not load the Paystack payment page. Check your connection and try again." and "Retry", which reloads the webview.
- Verification fails. "Payment Not Verified" with "We could not confirm your payment. If money was deducted from your account, it will be refunded automatically." Buttons: "Try Again" repeats the check, "View My Inspections" leaves. The same screen appears when no reference reached the screen, because the check is skipped.
- Opened from chat. The tenant chat menu item "Schedule Inspection" opens this form without a
propertyId, so "Schedule Inspection" always ends in "Property ID not found."
Lists can be stale after a request or payment
Nothing invalidates the cached GET /api/v1/inspection/my result after a new request or a successful payment. A tenant sent to My Inspections may not see the new request or the new status until they pull to refresh, and the listing screen may keep its old button label.
Second request on the same listing
While an inspection for a listing is active, the confirmation sheet covers the form every time it opens, and closing it returns to the listing. A tenant can only request again once the earlier inspection is completed or cancelled.
What happens next
- On request. The listing agent, or the landlord when there is no agent, gets an in-app notification "New Inspection Request" and an email with the subject "New Tour Request on HomeLink Hub". The inspection is created with status
pending_review. The backend stores the notes string in the inspection'scancellationReasonfield. - On approval. The tenant gets "Inspection Request Approved" and the status becomes
in_progress. Notifications are covered in Chats and notifications. - On rejection. The tenant gets "Inspection Request Rejected" with the agent's reason, and the status becomes
cancelled. - On payment. The inspection becomes
scheduledandpaid, and the fee is credited to the agent who handles the listing.