TapTrack User Reference

BookingRecordView

Overview

BookingRecordView is a @Composable function designed to display detailed information about a booking record and allow the user to perform actions such as checking in or checking out the booking. It includes several UI components that display booking details, rental information, waivers, and booking notes. The view also incorporates NFC scanning functionality for checking in bookings, with the status of the booking being updated accordingly.

Key Features:

Functionality

Booking Details

The dialog shows various details about the booking, such as:

Check-In and Check-Out

Enabling/Disabling Buttons

Modify Booking Notes

Allows note modification via a dialog. Changes are stored until confirmation, with immediate backend updates for already processed bookings.

NFC Scanning

The NFC scanning process plays a critical role in managing check-ins within the BookingRecordView. Here’s how it works:

  1. Initiation:
    • The NFC scan is initiated when the user clicks on the Check-In/Check-Out button while in check-in or check-out mode.
  2. Tag Scanning:
    • Once an NFC tag is successfully scanned, its UUID (Universal Unique Identifier) is captured and stored in nfcPayload.
    • All scanned tags are accumulated in nfcPayloads, ensuring all required items for a booking are checked in.
  3. Booking Update:
    • The booking record is updated with the scanned NFC tag IDs.
    • If all necessary items have been scanned, the booking status changes to “Checked-In” or “Returned” respectively.
  4. Check-Out Considerations:
    • In check-out mode, the system ensures that each scanned tag corresponds to items already checked in.
    • If a tag is not found in the list of checked-in items or has been scanned more than once (indicating it’s already checked out), appropriate error messages are displayed.

Confirmation

  1. Confirm Button:
    • Functionality:
      • When clicked, this button updates the booking status to either “Checked-In” or “Returned,” depending on whether the user is in check-in or check-out mode.
    • Check-In Mode:
      • If all required NFC tags are scanned and validated, the booking status transitions to “Checked-In.”
      • Before confirming BowYak rentals or during storm warnings, users must acknowledge any associated risks. This ensures customer awareness and consent.
    • Check-Out Mode:
      • The button checks that all items listed for check-out have corresponding scanned tags.
      • If all conditions are met, the booking status is updated to “Returned.”
  2. Dismiss Button:
    • Functionality:
      • Allows users to cancel the current action without making any changes to the booking record.
      • Closes the dialog, returning control to the user and preserving existing data states.