Skip to main content

Dispatch Route Template

Dispatch route templates are reusable weekly route designs. Each template defines the route type, the days it should run, and an ordered list of planned stops. Scheduled route generation uses enabled templates to create daily draft routes.

DispatchRouteTemplate

PropertyTypeRequiredDescription
DispatchRouteTemplateIdintYesPrimary key
OrganizationIdintYesTenant scope
NamestringYesTemplate name
RouteTypeDispatchRouteTypeYesDelivery or Pickup
DaysOfWeekDayOfWeek[]YesWeekdays this template should generate routes for
DivisionIdint?NoOptional division scope
EquipmentTypeIdint?NoPlanned equipment type
EnabledboolYesDisabled templates are skipped by generation
StopsDispatchRouteTemplateStop[]NoOrdered template stops
CustomValuesDictionaryNoExtensible custom properties

DispatchRouteTemplateStop

PropertyTypeRequiredDescription
DispatchRouteTemplateStopIdintYesPrimary key
DispatchRouteTemplateIdintYesParent template
StopContactIdint?NoStore/location contact (nullable; use with or without contactAddressId)
ContactAddressIdint?NoSpecific stop address
StopTypeDispatchRouteTypeYesDefaults to the template route type when omitted
SequenceintYes1-based planned stop order
EstimatedServiceMinutesint?NoPlanned dwell/service time
CustomValuesDictionaryNoExtensible custom properties (use for ad-hoc stop address when not using a contact)

Behavior

  • Create accepts nested stops; sequences are assigned contiguously in input order.
  • Template updates can replace the nested stops array. Existing stops with dispatchRouteTemplateStopId are sparse-updated and resequenced by array order; new stops are added; omitted existing stops are soft-deleted. Dedicated add/update/remove/reorder stop operations remain available for targeted changes.
  • Removing or reordering a stop resequences remaining active stops.
  • Template deletion is a soft delete and does not lock against generated routes.
  • Stop location: A stop's location is either a contact address (contactAddressId, optionally with stopContactId) or an ad-hoc address placed in customValues; a stop must have at least one of stopContactId / contactAddressId / non-empty customValues.