Skip to content

dbo.optimoRouteOrder ​

Info Generated by scripts/Generate-DataDictionary.ps1 - do not edit by hand. Edit descriptions in schemas/tables/dbo.optimoRouteOrder.json and regenerate.

Columns ​

#ColumnTypeNullableFlagsDescription
1IDintnoidentitySurrogate primary key of the OptimoRoute order record.
2primeJobIDuniqueidentifiernoPrime Ecosystem job this OptimoRoute order/stop is for.
3primeAppointmentIDuniqueidentifieryesPrime Ecosystem appointment linked to this order, once one has been scheduled.
4bookingIDintyesethBooking record linked to this order, once one has been scheduled.
5optimoRouteIDuniqueidentifieryesID of the order/stop as created in OptimoRoute, once it has been submitted; null until the order exists in OptimoRoute.
6optimoRouteDaydatetimenoDate of the OptimoRoute route plan this order/stop belongs to.
7VersionbigintnoMonotonically increasing version stamp used to detect whether the job/appointment data has changed since this order was last synced to OptimoRoute.
8CreatedAtdatetimenoTimestamp when this order record was first created.
9UpdatedAtdatetimenoTimestamp when this order record was last updated.
10ScheduledEstimatorIDuniqueidentifieryesPrime Ecosystem user ID of the estimator/driver OptimoRoute assigned to this stop.
11ScheduledAtdatetimeyesTimestamp when OptimoRoute scheduled this stop (assigned a driver/time slot); null if not yet scheduled.
12CompletionDatedatetimeyesTimestamp when the driver marked/OptimoRoute recorded this stop as completed.
13CompletionStatusnvarchar(100)yesCompletion outcome reported by OptimoRoute for the stop (e.g. success/failed).
14CompletionTrackingURLnvarchar(512)yesOptimoRoute live tracking URL customers/staff can use to follow the driver's progress to this stop.
15CompletionUpdateAppointmentbitnoFlag set to 1 when the stop's completion has not yet been propagated back to the Prime Ecosystem appointment, so a background job can pick it up.
16ScheduledEstimatorUpdateAppointmentbitnoFlag set to 1 (via spOptimoRouteSetAppointmentScheduledEstimator) when the scheduled estimator needs to be propagated back to the Prime Ecosystem appointment, so a background job can pick it up.
17optimoRouteCountAddressesintyesNumber of addresses/stops OptimoRoute returned for this order's plan, used to detect address-count mismatches.
21ResponseDurationMinsintyesOn-site job duration in minutes as returned by OptimoRoute for this stop.
22ResponseTravelMinsintyesTravel time in minutes to this stop as returned by OptimoRoute.
23ResponseDurationMinsUpdatedAtdatetimeyesTimestamp when ResponseDurationMins was last updated from OptimoRoute.
24ResponseTravelMinsUpdatedAtdatetimeyesTimestamp when ResponseTravelMins was last updated from OptimoRoute.
25NotScheduledVersionbigintyesVersion stamp used to track whether an unscheduled-order alert has already been sent for the current state, to avoid duplicate notifications.
26primeWorkOrderIDuniqueidentifieryesPrime Ecosystem work order ID this order/stop is linked to, if applicable.
27optimoRouteJSONnvarchar(MAX)yesRaw JSON payload of the order/stop data last sent to or received from the OptimoRoute API.
28ContactVersionbigintyesVersion stamp of the customer/contact details used to detect whether they've changed since last synced to OptimoRoute.

Indexes ​

NameTypeUniquePKKey columnsIncludedFilter
PK_optimoRouteOrderCLUSTEREDyesyesID

Relationships (inferred) ​

FromToConfidence
dbo.optimoRouteOrder.bookingIDdbo.ethBooking.IDhigh
dbo.optimoRouteOrder.NotScheduledVersiondbo.optimoRouteOrder.Versionmedium
dbo.optimoRouteOrder.primeAppointmentIDdbo.primeAppointments.idhigh
dbo.optimoRouteOrder.primeJobIDdbo.primeJobs.Idhigh
dbo.optimoRouteOrder.primeJobIDdbo.primeAppointments.jobIdmedium
dbo.optimoRouteOrder.primeJobIDdbo.primeWorkOrders.jobidmedium
dbo.optimoRouteOrder.primeWorkOrderIDdbo.primeWorkOrders.idhigh
dbo.optimoRouteOrder.ScheduledEstimatorIDdbo.primeUsers.idhigh
dbo.optimoRouteOrder.ScheduledEstimatorIDdbo.ethBookingEstimatorSkill.primeEstimatorIDmedium
dbo.optimoRouteOrder.Versiondbo.primeAppointments.versionmedium
dbo.optimoRouteOrder.Versiondbo.primeWorkOrders.versionmedium
dbo.primeJobsLocation.jobIDdbo.optimoRouteOrder.primeJobIDhigh

Referenced by ​

Procedures: dbo.spEthAIPrimeJobSummaryQueueUpdateApptTask, dbo.spEthBookingGet, dbo.spEthBookingGetAvailabilityGeo, dbo.spEthBookingSetAppointmentID, dbo.spOptimoRouteDriverDayClear, dbo.spOptimoRouteDriverDayUpsertDurationMins, dbo.spOptimoRouteGetAllowAdvancedBookings, dbo.spOptimoRouteGetAppointmentCompletionQueue, dbo.spOptimoRouteGetAppointmentQueue, dbo.spOptimoRouteGetAppointmentScheduledEstimatorQueue, dbo.spOptimoRouteGetBookingID, dbo.spOptimoRouteGetCompletionQueue, dbo.spOptimoRouteGetCountOrderFixedTime_Deprecated, dbo.spOptimoRouteGetNearbyJobs, dbo.spOptimoRouteGetNotScheduledOrders, dbo.spOptimoRouteGetNotScheduledOrdersEmailQueue, dbo.spOptimoRouteGetScheduledOrders, dbo.spOptimoRouteGetWorkOrderQueue, dbo.spOptimoRouteOrderGetActiveByJob, dbo.spOptimoRouteOrderGetRefreshQueue, dbo.spOptimoRouteOrderSetCompletion, dbo.spOptimoRoutePlanSetID, dbo.spOptimoRouteSetAppointmentCompletion, dbo.spOptimoRouteSetAppointmentScheduledEstimator, dbo.spOptimoRouteSetNotScheduledOrdersEmailSent, dbo.spOptimoRouteUpdateOrderDurationMins, dbo.spOptimoRouteUpdateOrderID, dbo.spOptimoRouteUpdateOrderTravelMins, dbo.spOptimoRouteUpsertOrder, dbo.spOptimoRouteUpsertOrder_Depcrecated, dbo.spOptimoRouteUpsertOrder_V2, dbo.spOptimoRouteUpsertStop