Skip to main content

Units

Units represent vehicles, apparatus, equipment, or any tracked asset in the department. The Units module is managed by the UnitsController.

Unit List

Authorization: Unit_View policy

The main index displays all units organized by group/station with:

  • Unit name and type
  • Current state (with custom state colors)
  • Station assignment
  • Tree-view sidebar for group filtering

Visibility: Unit visibility is governed by the CanUserViewUnitViaMatrix authorization check, which can restrict visibility based on group membership.

Creating Units

Authorization: Unit_Create policy

Unit Fields

FieldRequiredDescription
Unit NameYesMust be unique within the department
Unit TypeNoClassification (Engine, Ladder, Ambulance, etc.)
Station GroupNoHome station assignment
Custom StateNoAssign a custom unit state set

Unit Roles

Each unit can have defined roles (Driver, Officer, etc.):

  • Role names must be unique within the unit
  • Roles are used for staffing assignments

Creation Process

  1. Validates name uniqueness
  2. Saves the unit and its roles
  3. Creates a Novu subscriber (for push notifications)
  4. Fires AuditEvent (UnitAdded) and UnitAddedEvent

Editing Units

Authorization: Unit_Update policy + CanUserModifyUnit runtime check

Updates unit name, type, station group, and roles. Fires AuditEvent (UnitChanged).

Deleting Units

Authorization: Unit_Delete policy + CanUserModifyUnit runtime check

Deletes a unit. Fires AuditEvent (UnitRemoved).

Unit State Management

Setting Unit State

Units have a current operational state that can be set through several methods:

MethodDescription
SetUnitStateSet a single unit's state
SetUnitStateWithDestSet state with a destination (call or station)
SetUnitStateForMultipleBatch state change for multiple units (pipe-delimited IDs)
SetUnitStateWithDestForMultipleBatch state + destination for multiple units

State Destinations

When setting a unit state, a destination type determines the context:

Detail TypeOptions
NoneNo destination
CallsSelect from active calls
StationsSelect from station groups
CallsAndStationsSelect from either calls or stations

Default Unit Statuses

If no custom unit states are defined:

StatusDescription
AvailableReady for dispatch
DelayedAvailable with delay
UnavailableNot available
CommittedCurrently committed
Out Of ServiceNot operational
RespondingEn route
On SceneAt incident
StagingAt staging area
ReturningReturning to station
CancelledResponse cancelled
ReleasedReleased from incident
ManualManual status
EnrouteEn route to destination

Dynamic Status Dropdowns

The controller provides several endpoints for building dynamic status dropdowns:

  • GetUnitStatusHtmlForDropdown — HTML options based on unit type's custom states
  • GetUnitStatusHtmlForDropdownByStateId — HTML options by custom state ID
  • GetUnitStatusDestinationHtmlForDropdown — Destination dropdown based on status detail type
  • GetUnitOptionsDropdown — Full HTML dropdown menu with state options and destination sub-menus
  • GetUnitOptionsDropdownForStates — Same for multiple units with a shared state

Unit Staffing

Authorization: Unit_View policy

Unit staffing assigns personnel to specific unit roles:

Viewing Staffing

Displays all units with their roles and currently assigned personnel.

Updating Staffing

  1. Select personnel for each role on each unit
  2. On save, existing active role assignments are deleted
  3. New UnitActiveRole entries are created from the form data

Personnel Search for Staffing

The GetPersonnelForUnitStaffingJson endpoint supports search-as-you-type for finding personnel to assign, returning name, group, and role information.

Unit Logs

Creating Unit Logs

Authorization: UnitLog_Create policy

Add narrative log entries for a unit. The narrative text is HTML-decoded before storage.

Viewing Unit Logs

Authorization: UnitLog_View policy

View all log entries for a specific unit.

Unit Events & Tracking

Viewing Events

Authorization: Unit_View policy

Displays unit state change events on a map with:

  • Map centered on department coordinates
  • OSM (OpenStreetMap) integration
  • Custom state resolution for event labels

Event Data

The GetUnitEvents endpoint returns:

  • All unit state events
  • Custom state name and color resolution
  • Destination names (calls or stations resolved from IDs)
  • GPS coordinates for map display

Generating Event Reports

Select specific events to generate a report with:

  • Event details and timestamps
  • Resolved destination names (station names, call names)
  • Timeline of unit activity

ETA Calculation

When viewing units for a call, the system calculates Estimated Time of Arrival:

  1. Gets the unit's last known GPS position
  2. Uses IGeoService.GetEtaInSecondsAsync to calculate travel time to the call location
  3. Displays ETA in the call dispatch grid

Data Endpoints

EndpointPurpose
GetUnitsAll units (id, name, type, station)
GetUnitsForGroupUnits for a specific group
GetUnitsAndRolesForGroupUnits with roles for a group
GetUnitTypesDepartment unit types
GetUnitsListUnits with current state, color, timestamp
GetUnitsForCallGridUnits with ETA to call location
GetActivePersonnelForUnitStaffingRoleJsonCurrently assigned person for a unit role

Interactions with Other Modules

ModuleInteraction
DispatchUnits dispatched to calls
GroupsUnits assigned to station groups
Custom StatusesCustom unit state definitions
MappingUnit locations shown on maps
ShiftsUnit roles used in shift requirements
CallsUnit destination can be a call
ReportsUnit state history reports
CommandUnit types used in command definitions
NovuPush notification integration