Tracking Views & Package Display
Status System
Internal Status to Display Name Mapping
| Internal Status | Display Name |
|---|---|
| received, unprocessed | Received |
| checkin, check in | Checked-In |
| intransit, in transit | In Transit |
| unloaded | Ready for Pickup |
| clientPickUp, client pickup | Picked Up |
| consolidated | Consolidated |
Scan History Role to Timeline Label Mapping
| userRole (from scanHistory) | Timeline Label |
|---|---|
| Receiving | Received |
| Check In | Checked-In |
| In Transit | In Transit |
| Container Unloading | Unloaded |
| Client Pickup | Picked Up |
Single Package Tracking
View: #single-tracking-view
Flow
- Customer enters a tracking number
- Query
PackagesWHEREtrackingNumber == input - Verify the package belongs to
currentClient.id(security check) - If status is
consolidated, look up theconsolidatedIntomain package and use that package’s status and scan history - Query for packages consolidated into this package (to show sub-items)
- Build chronological timeline from
scanHistoryarray - Generate human-readable status message with estimated dates
Status Messages with Date Estimates
| Status | Message Logic |
|---|---|
| Received / Checked-In | Next Monday as shipping date, +5 days for estimated arrival |
| In Transit | Actual shipped date + 9 days for estimated arrival |
| Unloaded | “Ready for pickup” message |
| Picked Up | Timestamp of pickup + thank you message |
Displayed Result
- Status badge (color-coded)
- Status message paragraph with dates
- Horizontal scrollable “Tracking History” timeline (oldest to newest)
- Consolidated-into notice (if applicable)
- Consolidated-items notice (if applicable)
View All Packages
View: #all-packages-view
Flow
- Query
PackagesWHEREclientID == currentClient.id - Skip consolidated packages (shown as sub-items under main packages)
- Build
consolidatedMap: mainPackageId to list of consolidated tracking numbers - For each main package: build timeline, fetch container info (if in transit), find last scan timestamp
- Sort all packages newest first by
latestScanTimestamp - Group into 4 sections
- Display summary stats grid (clickable — scrolls to section)
- Render collapsible sections with package cards (20 per page, “Load More” button)
- Show search bar that filters by tracking number (including consolidated tracking numbers)
Section Grouping
| Section | Statuses Included | Color |
|---|---|---|
| Checked-In | received, checkin | Orange #fd7e14 |
| In Transit | intransit | Teal #17a2b8 |
| Ready for Pickup | unloaded | Green #28a745 |
| Picked Up | clientPickUp | Grey #6c757d |
Package Card Content
Each card displays:
| Element | Description |
|---|---|
| Tracking Number | Monospace font |
| Status Badge | Color-coded by section |
| Consolidated Packages | List of sub-package tracking numbers (if any) |
| Timeline | Horizontal scroll, oldest to newest with timestamps |
| Container Info | Container name + estimated arrival (if in transit) |
| Last Scanned | Timestamp of most recent scan |
Package Data Model
| Field | Type | Description |
|---|---|---|
| trackingNumber | string | e.g., TBA930284756123 |
| status | string | received, checkin, intransit, unloaded, clientPickUp, consolidated |
| clientID | string | Firestore document ID of the client |
| scanHistory | array | Objects with userRole (string) and timestamp (Firestore Timestamp) |
| containerID | string | For in-transit packages |
| consolidatedInto | string | Firestore doc ID of the main package (if consolidated) |
| shippedDate | timestamp | When the package was shipped |
Visual Elements
Flying Package Animation
A div.package-flyer element animates a package emoji flying across the screen toward the chat button, triggered periodically.
Impact Effect
When the flying package hits the chat button, a CSS chatbotImpact animation shakes the button and gold sparkle dots radiate outward.
Loading Spinner
CSS spin animation displayed during Firestore queries.