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
| Property | Type | Required | Description |
|---|
| DispatchRouteTemplateId | int | Yes | Primary key |
| OrganizationId | int | Yes | Tenant scope |
| Name | string | Yes | Template name |
| RouteType | DispatchRouteType | Yes | Delivery or Pickup |
| DaysOfWeek | DayOfWeek[] | Yes | Weekdays this template should generate routes for |
| DivisionId | int? | No | Optional division scope |
| EquipmentTypeId | int? | No | Planned equipment type |
| Enabled | bool | Yes | Disabled templates are skipped by generation |
| Stops | DispatchRouteTemplateStop[] | No | Ordered template stops |
| CustomValues | Dictionary | No | Extensible custom properties |
DispatchRouteTemplateStop
| Property | Type | Required | Description |
|---|
| DispatchRouteTemplateStopId | int | Yes | Primary key |
| DispatchRouteTemplateId | int | Yes | Parent template |
| StopContactId | int? | No | Store/location contact (nullable; use with or without contactAddressId) |
| ContactAddressId | int? | No | Specific stop address |
| StopType | DispatchRouteType | Yes | Defaults to the template route type when omitted |
| Sequence | int | Yes | 1-based planned stop order |
| EstimatedServiceMinutes | int? | No | Planned dwell/service time |
| CustomValues | Dictionary | No | Extensible 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.