๐ฆ Order Tracker โ End-to-End Documentation (Rookie-Friendly)
What is this? A complete, beginner-friendly walkthrough of how Lithia/Driveway's Order Tracker works โ from the moment Salesforce announces "the customer's car is now in transit," all the way to the progress bar the customer sees in the app.
It shows which system talks to which, in what order, how the stages are calculated, and exactly where Salesforce fits in. No prior knowledge assumed โ there's a Glossary at the bottom.
Every claim below is grounded in real code. File paths are given so you can verify each one.
#โ ๏ธ First, the real cast of characters
The order tracker is not built from repos named webstore-order-tracker-api / driveway-orderdetails-api (those don't exist here). After scanning the whole workspace, here are the actual moving parts:
| # | Role | Repo / system | In this workspace? |
|---|---|---|---|
| 1 | ๐ง The brain โ decides when each milestone happens and announces it | Salesforce ("FreewayCRM" org) | โ ๏ธ Event/field metadata only (Salesforce-FreewayCRM) โ Apex publisher not checked out |
| 2 | ๐ก The listener โ catches Salesforce's announcements | Salesforce-Integration-API โ order-tracker-consumer module | โ Yes |
| 3 | ๐พ The recorder โ stores progress, records milestones, serves them | cart-service | โ Yes |
| 4 | ๐ฑ The screen โ calculates the visual step + draws the progress bar | UI / UI2 (Driveway web, React/Next.js) + ROAM mobile | โ Web is here; ROAM mobile is not |
There's also a second, older path (Salesforce-Integration-API/routes) that pushes a few status changes to cart-service synchronously. We cover both.
#1. ๐ฏ The 30-Second Summary
Here's who does what:
- Salesforce is the brain. When a Lithia employee (or a Salesforce automation) marks a milestone done, Salesforce publishes a tiny announcement called a Platform Event (
Order_Tracker_Event__e). - The
order-tracker-consumeris the listener. It stays permanently subscribed to Salesforce's announcement channel and grabs each event the instant it appears. - It forwards the event to
cart-serviceover a normal HTTP call. cart-serviceis the recorder. It finds the customer's active order and stamps the time onto the matching milestone (e.g.vehicleInTransitAt = now). A few milestones also flip a status (orderCOMPLETED, deliveryIN_TRANSIT). A helper (OrderProgressCalculator) keeps the timestamps tidy โ back-filling earlier steps and clearing steps that no longer apply.- When the customer opens the app, the web UI asks cart-service for the order (with all its timestamps). The UI then calculates the current step (
useOrderSteps) and draws the progress bar (RetailOrderTracker).
๐ง Quick check โ the 3 layers
0/2 ยท 0/2 answered1. Who decides which milestone an order has reached?
2. What is cart-service's job in this pipeline?
#2. ๐บ๏ธ The Big Picture (who talks to whom)
How to read it: Updates flow left โ right (Salesforce โ consumer โ cart-service). The customer reads the order right โ left (app โ cart-service) and computes the bar itself.
#3. ๐ฌ The Full Story, Step by Step (sequence diagram)
A vehicle just left the dealership and is now "in transit":
๐ Plain-English replay: Salesforce announces "in transit" (1โ2). The consumer hears it, decodes the binary, hands it to the handler (3โ5). The handler saves it once to avoid double-processing (6). If it's a buying order, it tells cart-service, which records the timestamp + status and remembers its place (7โ11). Selling orders are skipped for now (12). Whenever the customer opens the app, cart-service returns the order and the UI computes & draws the bar (13โ17).
#4. ๐ข The Repositories & Who Calls Who
#Repo 1 โ Salesforce-Integration-API (the listener)
A collection of small "consumer" apps, each listening to a different Salesforce event. Ours is order-tracker-consumer (Kotlin + Spring Boot, coroutines).
It has effectively 3 classes:
OrderTrackerConsumer.kt subscribes to the Salesforce topic, decodes each eventOrderTrackerHandler.kt dedupes (Mongo), then SHOPโcart-service / SELLโskipCartClient.kt the actual HTTP POST to cart-service
OrderTrackerConsumer.kt โ the always-on loop (file: order-tracker-consumer/.../consumer/OrderTrackerConsumer.kt):
object Constants { const val TOPIC = "/event/Order_Tracker_Event__e" } // the "radio channel"while (isActive) {val replayId = replayOffsetRepository.getReplayIdForTopic(TOPIC) // resume bookmarkval stub = salesforcePubSubClient.getAuthenticatedStub() // log into Salesforcestub.subscribe(buildRequestFlow(TOPIC, replayId)).collect { response ->response.eventsList.forEach { event ->val schema = schemaRegistry.fetchSchema(stub, event.event.schemaId)when (val r = OrderTrackerEvent.fromPlatformEvent(event, schema)) { // decode Avrois Success -> orderTrackerHandler.handle(r.event, event.replayIdโฆ)is Failure -> logger.error("Failed to deserialize โฆ")}}}} // on any error: health gauge = 0, wait 3s, reconnect
OrderTrackerHandler.kt โ dedupe + route (.../handler/OrderTrackerHandler.kt):
suspend fun handle(event, replayId) = when (eventRepository.insert(event.toEvent(replayId))) {is Success -> if (event.caseType == SELL) handleSellEvent(event) // skip (not built)else handleShopEvent(event) // โ cart-serviceis Duplicate -> Result.Duplicate // already seen, skipis Failure -> Result.Skip("Failed to insert event")}
handleShopEvent also guards one rule: DELIVERY_DATE_UPDATE must include targetDate, else it's skipped.
CartClient.kt โ the outbound call:
cartClient.postTrackerEvent(userId = event.userId,request = TrackerEventRequest(trackerPhase, objectType, fulfillmentMethod,caseType, completedOn = event.eventDateTime, vehicleId, vin, targetDate))// โ POST {cart-service.base-url}/callback/salesforce/users/{userId}
Config (order-tracker-consumer/src/main/resources/application.yml):
cart-service: { base-url: the cart service (internal) } # โ where events are forwardedbackpack: { base-url: the Backpack service (internal) } # (for future SELL support)salesforce-lead-submission.auth: # how it logs into SalesforcebaseUrl: ${SALESFORCE_AUTH_CLIENT_URL:the Salesforce login endpoint}clientId/clientSecret/username/password: ${...} # from env vars (secrets)spring.data.mongodb.uri: ${SPRING_DATA_MONGODB_URI} # event store
#Repo 2 โ cart-service (the recorder + read API)
This repo owns the Order and its progress. It has two doors:
| Door | Endpoint | Knocked by | Purpose |
|---|---|---|---|
| ๐ฅ write (event-driven) | POST /callback/salesforce/users/{userId} | the consumer | "milestone X happened โ record it" |
| ๐ฅ write (legacy/sync) | PATCH /callback/salesforce/{cartId}/status + task/amazon/payment callbacks | Salesforce-Integration-API/routes | direct status pushes |
| ๐ค read | GET /orders (served at cart/v1/orders) | the web/mobile app | "give me my orders + timestamps to draw the bar" |
Key classes:
rest/salesforce/SalesforceCallbackController.kt all the inbound callback endpointsrest/order/OrderProgressOrchestratorRouter.kt decides what each phase doesservice/.../OrderProgressUpdateOrchestrator.kt stamps the timestampsservice/.../CompleteOrderOrchestrator.kt marks order COMPLETED / DELIVEREDservice/.../UpdateDeliveryStatusOrchestrator.kt sets IN_TRANSITservice/.../components/OrderProgressCalculator.kt builds the new OrderProgressState (back-fill/clear)rest/order/OrderController.kt GET /orders (read door)library/.../order/domain/Order.kt Order + OrderProgressState + enums
#Who-calls-who at a glance
#5. โ๏ธ The Salesforce Integration, Explained Slowly
#5.1 How the consumer "hears" Salesforce โ the radio analogy
Salesforce's Pub/Sub API is a radio station:
- Salesforce broadcasts on a topic (the channel):
/event/Order_Tracker_Event__e. The__esuffix = Platform Event (Salesforce's word for a broadcastable message). - Our consumer is a radio permanently tuned to that channel, connected over gRPC to
the Salesforce Pub/Sub API, waiting for events.
The event is defined as a HighVolume, PublishImmediately platform event (verified in Order_Tracker_Event__e.object-meta.xml):
"Events to indicate the current status of a driveway order โฆ to indicate to customers the status of their order."
#5.2 The event itself
Order_Tracker_Event__e has these custom fields (verified in .../Order_Tracker_Event__e/fields/):
| Salesforce field | Meaning |
|---|---|
userId__c | which customer |
eventDateTime__c | when the milestone happened |
trackerPhase__c | which milestone โ a required Text(40) field holding an enum name โญ |
objectType__c | CASE or VEHICLE |
caseType__c | SHOP / SHOP_W_TRADE / SELL |
fulfillmentMethod__c | DELIVERY or IN_STORE_PICKUP |
vehicleId__c, vin__c | which car |
The field description for trackerPhase__c says it all: "The tracker phase being signalled โ main stage completion, sub-step completion, or regression trigger." (The consumer also reads an optional targetDate__c for ETA changes.)
๐ก Salesforce conventions:
__c= custom field,__e= platform event.
#5.3 Avro โ object (decoding)
Salesforce sends events as Avro (compact binary, smaller/faster than JSON). The consumer decodes them field-by-field (OrderTrackerEvent.fromPlatformEvent) โ e.g. record.get("trackerPhase__c") โ TrackerPhase enum, eventDateTime__c (epoch millis) โ Instant. If required fields are missing/garbled, the event is logged and dropped (the loop never crashes).
#5.4 Authenticating to Salesforce
OAuth2 password grant: the consumer logs in with clientId + clientSecret + username + password (all from environment variables), gets a token, and uses it to subscribe.
#5.5 Reliability โ never miss, never double-process
Two safety nets live in the consumer's MongoDB:
| Mechanism | Problem it solves | How |
|---|---|---|
Event store (events) | processing the same event twice | each event is inserted by id; a repeat returns Duplicate and is skipped |
Replay offset (replay_offsets) | losing events on restart | Salesforce stamps each event with a replayId; the consumer saves the last one and resumes from exactly there |
There's also a health gauge: if the Salesforce connection drops, it's set to 0 (โ Datadog alert), the loop waits 3s and reconnects.
#6. ๐งฎ The Stage Calculation โ The Heart of the System
This is what you asked about most: how are the stages calculated, and how does Salesforce factor in? There are three distinct layers โ keep them separate in your head.
#6.1 Layer 1 โ the 15 milestones Salesforce can send (TrackerPhase)
enum class TrackerPhase {ORDER_CONFIRMED, CONTRACTS_COMPLETE, VEHICLE_PREPARED, DELIVERY_SCHEDULED,VEHICLE_IN_TRANSIT, VEHICLE_DELIVERED, VEHICLE_PICKED_UP, E_SIGNATURE,TITLE_REG_SENT_WET_DOCS, TITLE_REG_RECEIVED_WET_DOCS,TITLE_REG_SENT_DMV, TITLE_REG_PROCESSED_DMV,DELIVERY_DATE_UPDATE, RETURN_TO_MANAGER, ORDER_CANCELLED}
#6.2 Layer 2 โ the router decides what each milestone does
When an update arrives, OrderProgressOrchestratorRouter does this (file: rest/order/OrderProgressOrchestratorRouter.kt):
- Find the user's active order (else
NoOrderFound). - Vehicle-swap check: if the event's
vehicleIddiffers from the order's current vehicle, it applies a vehicle swap first (the order was reassigned to a different car โ this wipes the progress so it can rebuild from the new car). - Dispatch on the phase โ the right orchestrator.
#6.3 The exact phase โ action table (verified line-by-line)
TrackerPhase | Orchestrator method | Field written on OrderProgressState | Status side-effect |
|---|---|---|---|
ORDER_CONFIRMED | applyOrderConfirmed | orderConfirmedAt | โ |
E_SIGNATURE | applyESignature | eSignatureAt (clears later title steps) | โ |
CONTRACTS_COMPLETE | applyContractsCompleted | contractsCompleteAt (back-fills orderConfirmedAt) | โ |
VEHICLE_PREPARED | applyVehiclePrepared | vehiclePreparedAt (back-fills contracts + confirmed) | โ |
DELIVERY_SCHEDULED | applyDeliveryScheduled | deliveryScheduledAt | โ |
TITLE_REG_SENT_WET_DOCS | applyTitleAndRegistrationSent | titleAndRegistrationSentAt | โ |
TITLE_REG_RECEIVED_WET_DOCS | applyTitleAndRegistrationReceived | titleAndRegistrationReceivedAt | โ |
TITLE_REG_SENT_DMV | applyTitleAndRegistrationSentForProcessing | titleSentForProcessingAt | โ |
TITLE_REG_PROCESSED_DMV | applyTitleAndRegistrationProcessed | titleAndRegistrationProcessedAt | โ |
VEHICLE_IN_TRANSIT | applyVehicleInTransit | vehicleInTransitAt (clears deliveryScheduledAt) | deliveryStatus = IN_TRANSIT |
VEHICLE_DELIVERED | completeDeliveryOrder | vehicleDeliveredAt (+ back-fill prepared/contracts/confirmed) | status = COMPLETED, deliveryStatus = DELIVERED |
VEHICLE_PICKED_UP | completePickupOrder | vehiclePickedUpAt (+ back-fill prepared/contracts/confirmed) | status = COMPLETED, deliveryStatus = DELIVERED |
DELIVERY_DATE_UPDATE | applyDeliveryDateUpdate | estimatedDeliveryDate (โ targetDate) | โ |
RETURN_TO_MANAGER | applyReturnToManager | clears processed/sent-DMV/contracts/title/eSignature/confirmed | โ (regression) |
ORDER_CANCELLED | cancelOrder | โ | status = CANCELLED |
#6.4 Layer 2.5 โ OrderProgressCalculator: the tidy-up helper โญ
This is the class that actually builds the new OrderProgressState for each milestone. It is not a "which step am I on" projector โ it's a set of calculateโฆ() helpers that return an updated timestamp bag. It does two clever things a rookie should understand, because they're why the progress bar never looks broken:
(a) Back-fill earlier steps. If "Vehicle Delivered" arrives but earlier milestones were never recorded, it fills them in with the delivery time โ so you never see "Delivered โ
but Contracts โฌ". (file: service/.../components/OrderProgressCalculator.kt)
fun calculateDeliveredAt(orderProgress, vehicleDeliveredAt, fulfillmentMethod): OrderProgressState {val init = initOrderProgress(orderProgress, fulfillmentMethod)return init.copy(vehicleDeliveredAt = vehicleDeliveredAt,vehiclePreparedAt = init.vehiclePreparedAt ?: vehicleDeliveredAt, // back-fillcontractsCompleteAt = init.contractsCompleteAt ?: vehicleDeliveredAt, // back-fillorderConfirmedAt = init.orderConfirmedAt ?: vehicleDeliveredAt, // back-fill)}
(b) Clear steps that no longer apply (regression). Some milestones mean the order moved backwards, so later timestamps are wiped:
fun calculateVehicleInTransitAt(...) = init.copy(deliveryScheduledAt = null, // in transit โ "scheduled" no longer the active stepvehicleInTransitAt = vehicleInTransitAt,)fun calculateReturnToManager(...) = init.copy( // a full regressiontitleAndRegistrationProcessedAt = null, titleSentForProcessingAt = null,contractsCompleteAt = null, titleAndRegistrationReceivedAt = null,titleAndRegistrationSentAt = null, eSignatureAt = null, orderConfirmedAt = null,)fun calculateVehicleSwapped(...) = init.copy( // new car โ wipe everythingvehicleDeliveredAt = null, vehiclePickedUpAt = null, vehiclePreparedAt = null,/* โฆall other timestampsโฆ */ estimatedDeliveryDate = null,)
It also stamps the fulfillmentMethod onto the state so the UI knows whether to show the delivery or pickup step list. Every save goes through IncrementingOrderSaveOperator, which uses an optimistic snapshot id to prevent two updates clobbering each other (a CollisionError).
#6.5 Layer 3 โ the UI calculates the current step and renders the bar
This is where "which step is the customer on" is actually decided. The web app (UI/UI2) reads the order, then useOrderSteps does the projection (file: UI/src/account/components/MyOrder/OrderDetailsTracker/useOrderSteps.ts):
- It has a fixed, ordered list
ORDER_STEP_UI_LABELSโ a mix of bigstagerows (Order Confirmed, Contracts Complete, Vehicle Prepared, Vehicle Delivered / Picked Up) and smallersubsteprows (identity verified, documents uploaded, e-signature, title & registration steps, in-transit, delivery scheduled, โฆ). - It filters the list by
shipmentType(filterPickupStepsvsfilterDeliverySteps), and removesdownPaymentPaidAtfor non-finance deals andtradeInVerifiedAtwhen there's no trade-in. - For each step: timestamp present โ
complete, elseincompleteโ using the exact field names fromprogressState. - Current stage = the earliest
stagerow with no timestamp (activeStageIndex). - It also derives a
vehicleStatuschip:
const vehicleStatus =pickup && vehiclePickedUpAt ? "vehiclePickedUp": pickup && orderConfirmedAt ? "preparingForPickup": vehicleDeliveredAt ? "vehicleDelivered": vehicleInTransitAt ? "vehicleInTransit": contractsCompleteAt ? "preparingForTransport": orderConfirmedAt ? "vehicleConfirmed": "confirmingVehicle";
There's also a coarser mapping in useCartOrderQuery.ts (mapToOrderStep) that turns deliveryStatus into a simple Submitted / InTransit / Delivered / Canceled for summary views.
๐ The full answer to "how stages are calculated with Salesforce": Salesforce decides the milestone โ cart-service records a timestamp (and
OrderProgressCalculatortidies the timestamps by back-filling/clearing) โ the UI projects the timestamps into a current step and renders the bar (delivery vs pickup).
#6.6 The status enums and their lifecycle
enum class OrderStatus { ACTIVE, COMPLETED, CANCELLED }enum class DeliveryStatus { AWAITING_SHIPMENT, IN_TRANSIT, DELIVERED }enum class FulfillmentMethod { DELIVERY, IN_STORE_PICKUP }
#7. ๐ The Second (Legacy) Path โ PATCH /callback/salesforce/{cartId}/status
Besides the event-driven path, Salesforce-Integration-API/routes (a normal REST service) can push a few status changes synchronously to the same cart-service controller (SalesforceCallbackController.salesforceCallback). The orchestrator methods it calls are now marked @Deprecated ("the SF callback endpoint which calls this shouldn't be used anymore") โ the event path is the future:
Incoming status | Effect in cart-service |
|---|---|
CANCELLED | cancelOrder(cartId) โ status = CANCELLED (treats "no order found" as success) |
OUT_FOR_DELIVERY | updateDeliveryStatus(IN_TRANSIT) |
ORDER_COMPLETED | completeOrder(cartId) โ status = COMPLETED, deliveryStatus = DELIVERED |
The same controller also exposes task callbacks (/tasks/{task}/status for identity verification & document upload), Amazon third-party order callbacks, and finalize-down-payment. These feed the same Order (writing identityVerifiedAt, documentsUploadedAt, downPaymentPaidAt, โฆ) but are outside the main tracker-phase flow.
#8. ๐งฑ The Data Model (cart-service Order.kt)
OrderProgressState is a flat bag of nullable UTC timestamps โ null = "not reached yet."
The extra timestamps (
downPaymentPaidAt,tradeInVerifiedAt,identityVerifiedAt, โฆ) are written by the other callbacks (payment, identity, doc-upload), not the tracker-phase path. The UI shows them as substeps within the main stages.
isShadowOrderis a flag that hides certain orders from the UI; note that several orchestrators setisShadowOrder = falseonce Salesforce reports real progress, so the order becomes visible to the customer.
#9. ๐ Security (Authentication) Summary
| Hop | How it's secured |
|---|---|
| Salesforce โ consumer | OAuth2 password grant (consumer logs into Salesforce with client id/secret + username/password from env vars) |
| consumer โ cart-service | Internal cluster HTTP (the cart service (internal)), service-to-service inside Kubernetes |
Salesforce-Integration-API/routes โ cart-service | same internal cluster call |
app โ cart-service GET /orders | OAuth2 JWT (Auth0 Bearer token); userId is pulled from the validated token (AuthHelper.getAndValidateUserId) |
#10. ๐จ Message Payloads (cheat sheet)
Salesforce โ consumer (Avro, decoded): userId__c, eventDateTime__c, trackerPhase__c, objectType__c, caseType__c, fulfillmentMethod__c, vehicleId__c, vin__c (+ optional targetDate__c).
consumer โ cart-service POST /callback/salesforce/users/{userId} (OrderProgressUpdateRequest):
{"trackerPhase": "VEHICLE_IN_TRANSIT","objectType": "VEHICLE","caseType": "SHOP","fulfillmentMethod": "DELIVERY","completedOn": "2026-05-29T15:04:00Z","vehicleId": "abc-123","vin": "1HGCM82633A004352","targetDate": null}
cart-service โ app GET cart/v1/orders โ list of orders, each with orderStatus, deliveryStatus, fulfillmentMethod, estimatedDeliveryDate, and the full progressState of timestamps the UI reads to draw the bar.
#11. ๐ Key File Index
Salesforce-Integration-API/order-tracker-consumer/src/main/kotlin/com/lithia/salesforceintegration/
consumer/OrderTrackerConsumer.ktโ subscribes to/event/Order_Tracker_Event__ehandler/OrderTrackerHandler.ktโ dedupe; SHOPโforward, SELLโskipmodel/OrderTrackerEvent.ktโ event model + Avro decode (fromPlatformEvent) + the 15TrackerPhasevaluespubsub/client/CartClient.ktโ POST to cart-servicesrc/main/resources/application.ymlโ topic, Salesforce auth,cart-service.base-url
cart-service/
routes/.../rest/salesforce/SalesforceCallbackController.ktโPOST /callback/salesforce/users/{userId}+ legacyPATCH .../{cartId}/status+ task/amazon/payment callbacksroutes/.../rest/order/OrderProgressOrchestratorRouter.ktโ phase โ orchestrator (incl. vehicle-swap)service/.../components/OrderProgressCalculator.ktโ โญ buildsOrderProgressState(back-fill / clear)service/.../orchestrators/OrderProgressUpdateOrchestrator.ktโ stamps timestamps /applyReturnToManagerservice/.../orchestrators/CompleteOrderOrchestrator.ktโcompleteDelivery/PickupOrder(COMPLETED + DELIVERED)service/.../orchestrators/UpdateDeliveryStatusOrchestrator.ktโapplyVehicleInTransit(IN_TRANSIT)routes/.../rest/order/OrderController.ktโGET /orders(read door)library/.../order/domain/Order.ktโOrder,OrderProgressState,OrderStatus,DeliveryStatus,FulfillmentMethod
Salesforce-FreewayCRM/force-app/main/default/objects/Order_Tracker_Event__e/ โ the Platform Event + 8 field definitions (trackerPhase__c is a required Text(40) field).
UI/src/account/components/MyOrder/ โ OrderDetailsTracker/useOrderSteps.ts (timestamps โ current step + chip), OrderDetailsTracker.tsx & RetailOrderTracker/ (the visual bar). UI/src/apis/cartServices/graphQueries/useCartOrderQuery.ts (the GET cart/v1/orders fetch + types).
#12. ๐ Glossary (plain English)
| Term | Meaning |
|---|---|
Platform Event (__e) | A broadcast message Salesforce sends when something happens; subscribers receive it. |
| Pub/Sub API | Salesforce's "radio station" for broadcasting/receiving those events. |
| Topic | The channel name to subscribe to: /event/Order_Tracker_Event__e. |
| Avro | A compact binary data format; must be decoded into an object. |
| gRPC | The fast network protocol used to connect to Salesforce Pub/Sub. |
| Consumer | A small always-on program that listens for events and reacts. |
| Replay ID / offset | A bookmark per event so a restarted consumer resumes without missing/repeating. |
| Idempotency | "Processing the same thing twice has no extra effect" โ done here via the event store. |
| TrackerPhase | One of the 15 milestones Salesforce can announce (e.g. VEHICLE_IN_TRANSIT). |
| OrderProgressState | The flat record of which milestones happened and when (a bag of timestamps). |
| OrderProgressCalculator | Backend helper that builds the new timestamp bag โ back-filling earlier steps, clearing steps that no longer apply. |
| Back-fill | Filling in earlier milestones that were never reported, so the bar shows no gaps. |
| Regression | A milestone that moves the order backwards (e.g. RETURN_TO_MANAGER), clearing later timestamps. |
| useOrderSteps | Frontend hook that turns the timestamps into the ordered, current-step progress bar. |
| Orchestrator | A backend class that performs a stage's work (stamp a time, complete the order, etc.). |
| Fulfillment method | How the customer gets the car: DELIVERY or IN_STORE_PICKUP (changes the UI step list). |
| Shadow order | An order temporarily hidden from the UI; real Salesforce progress un-hides it. |
| JWT / Bearer token | A signed login token the app sends to prove the user's identity. |
__c | Salesforce suffix meaning "custom field." |
#13. โ TL;DR for standup
Salesforce is the source of truth for order milestones. It publishes an
Order_Tracker_Event__ePlatform Event whenever a milestone changes. Theorder-tracker-consumer(inSalesforce-Integration-API) stays subscribed via the Pub/Sub gRPC API, decodes the Avro payload, dedupes it in MongoDB (with a replay bookmark), and โ for SHOP / SHOP_W_TRADE cases โ forwards it tocart-serviceatPOST /callback/salesforce/users/{userId}. cart-service's router maps theTrackerPhaseto an orchestrator: most phases stamp a timestamp;VEHICLE_DELIVERED/VEHICLE_PICKED_UPset COMPLETED + DELIVERED;VEHICLE_IN_TRANSITsets IN_TRANSIT;DELIVERY_DATE_UPDATEupdates the ETA;RETURN_TO_MANAGERregresses;ORDER_CANCELLEDcancels.OrderProgressCalculatorkeeps the timestamp bag tidy (back-fills earlier steps, clears steps that no longer apply). The Driveway web UI (useOrderSteps+RetailOrderTracker) then readsGET cart/v1/ordersand computes the current step from which timestamps are filled, rendering a delivery-vs-pickup progress bar. A second legacy path (Salesforce-Integration-API/routesโPATCH /callback/salesforce/{cartId}/status, now deprecated) pushes a few statuses synchronously. SELL orders aren't handled yet (Backpack integration pending).
Generated by scanning Salesforce-Integration-API, cart-service, UI, and Salesforce-FreewayCRM. ROAM mobile and the Salesforce Apex publisher are described from their integration contracts since their source isn't in this workspace.