@fleetbase/fleetops-engine 0.6.65 → 0.6.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RELEASE.md +11 -6
- package/addon/components/ai/create-order-preview.hbs +10 -5
- package/addon/components/asset/pill.hbs +24 -0
- package/addon/components/asset/summary.hbs +1 -0
- package/addon/components/asset-connection/pill.hbs +24 -0
- package/addon/components/asset-connection/summary.hbs +1 -0
- package/addon/components/attachable/pill.hbs +24 -0
- package/addon/components/attachable/summary.hbs +1 -0
- package/addon/components/cell/asset-connection-identity.hbs +1 -0
- package/addon/components/cell/asset-identity.hbs +1 -0
- package/addon/components/cell/attachable-identity.hbs +1 -0
- package/addon/components/cell/contact-identity.hbs +1 -0
- package/addon/components/cell/customer-identity.hbs +1 -0
- package/addon/components/cell/device-event-identity.hbs +1 -0
- package/addon/components/cell/device-identity.hbs +1 -24
- package/addon/components/cell/driver-identity.hbs +1 -33
- package/addon/components/cell/entity-identity.hbs +1 -0
- package/addon/components/cell/equipment-identity.hbs +1 -5
- package/addon/components/cell/facilitator-identity.hbs +1 -0
- package/addon/components/cell/fleet-driver-identity.hbs +1 -0
- package/addon/components/cell/fleet-identity.hbs +1 -0
- package/addon/components/cell/fuel-provider-connection-identity.hbs +1 -0
- package/addon/components/cell/fuel-provider-transaction-identity.hbs +1 -0
- package/addon/components/cell/fuel-report-identity.hbs +1 -0
- package/addon/components/cell/inspection-form-identity.hbs +1 -0
- package/addon/components/cell/inspection-item-result-identity.hbs +1 -0
- package/addon/components/cell/inspection-submission-identity.hbs +1 -0
- package/addon/components/cell/integrated-vendor-identity.hbs +1 -0
- package/addon/components/cell/issue-identity.hbs +1 -0
- package/addon/components/cell/maintenance-identity.hbs +1 -0
- package/addon/components/cell/maintenance-schedule-identity.hbs +1 -0
- package/addon/components/cell/maintenance-subject-identity.hbs +1 -0
- package/addon/components/cell/manifest-identity.hbs +1 -0
- package/addon/components/cell/manifest-stop-identity.hbs +1 -0
- package/addon/components/cell/order-config-identity.hbs +1 -0
- package/addon/components/cell/order-identity.hbs +1 -0
- package/addon/components/cell/part-identity.hbs +1 -5
- package/addon/components/cell/payload-identity.hbs +1 -0
- package/addon/components/cell/place-identity.hbs +1 -0
- package/addon/components/cell/position-identity.hbs +1 -0
- package/addon/components/cell/purchase-rate-identity.hbs +1 -0
- package/addon/components/cell/recurring-order-schedule-identity.hbs +1 -0
- package/addon/components/cell/resource-list.hbs +10 -0
- package/addon/components/cell/resource-list.js +28 -0
- package/addon/components/cell/route-identity.hbs +1 -0
- package/addon/components/cell/sensor-identity.hbs +1 -0
- package/addon/components/cell/service-area-identity.hbs +1 -0
- package/addon/components/cell/service-quote-identity.hbs +1 -0
- package/addon/components/cell/service-quote-item-identity.hbs +1 -0
- package/addon/components/cell/service-rate-fee-identity.hbs +1 -0
- package/addon/components/cell/service-rate-identity.hbs +1 -0
- package/addon/components/cell/service-rate-parcel-fee-identity.hbs +1 -0
- package/addon/components/cell/telematic-identity.hbs +1 -0
- package/addon/components/cell/tracking-number-identity.hbs +1 -0
- package/addon/components/cell/tracking-status-identity.hbs +1 -0
- package/addon/components/cell/trailer-identity.hbs +1 -0
- package/addon/components/cell/vehicle-device-identity.hbs +1 -0
- package/addon/components/cell/vehicle-identity.hbs +1 -33
- package/addon/components/cell/vendor-identity.hbs +1 -0
- package/addon/components/cell/warranty-identity.hbs +1 -0
- package/addon/components/cell/waypoint-identity.hbs +1 -0
- package/addon/components/cell/work-order-identity.hbs +1 -0
- package/addon/components/cell/zone-identity.hbs +1 -0
- package/addon/components/contact/form.hbs +2 -4
- package/addon/components/contact/pill.hbs +24 -0
- package/addon/components/contact/summary.hbs +1 -0
- package/addon/components/customer/create-order-form.hbs +8 -4
- package/addon/components/customer/form.hbs +2 -4
- package/addon/components/customer/order-form.hbs +10 -8
- package/addon/components/customer/pill.hbs +24 -0
- package/addon/components/customer/summary.hbs +1 -0
- package/addon/components/device/details.hbs +3 -1
- package/addon/components/device/form.hbs +4 -13
- package/addon/components/device/panel-header.hbs +3 -2
- package/addon/components/device/panel-header.js +1 -5
- package/addon/components/device/panel-tabs/vehicle.hbs +2 -2
- package/addon/components/device/pill.hbs +24 -16
- package/addon/components/device/summary.hbs +1 -0
- package/addon/components/device/telemetry.hbs +17 -0
- package/addon/components/device/telemetry.js +117 -0
- package/addon/components/device-event/details.hbs +6 -24
- package/addon/components/device-event/pill.hbs +24 -0
- package/addon/components/device-event/summary.hbs +1 -0
- package/addon/components/driver/details.hbs +9 -1
- package/addon/components/driver/form.hbs +6 -18
- package/addon/components/driver/panel-header.hbs +3 -4
- package/addon/components/driver/panel-header.js +8 -1
- package/addon/components/driver/pill.hbs +16 -8
- package/addon/components/driver/summary.hbs +1 -0
- package/addon/components/entity/pill.hbs +24 -0
- package/addon/components/entity/summary.hbs +1 -0
- package/addon/components/equipment/details.hbs +6 -2
- package/addon/components/equipment/form.hbs +10 -4
- package/addon/components/equipment/pill.hbs +24 -20
- package/addon/components/equipment/summary.hbs +1 -0
- package/addon/components/facilitator/pill.hbs +24 -0
- package/addon/components/facilitator/summary.hbs +1 -0
- package/addon/components/fleet/details.hbs +6 -2
- package/addon/components/fleet/driver-listing.hbs +3 -12
- package/addon/components/fleet/form.hbs +8 -4
- package/addon/components/fleet/pill.hbs +24 -0
- package/addon/components/fleet/summary.hbs +1 -0
- package/addon/components/fleet/vehicle-listing.hbs +3 -12
- package/addon/components/fleet-driver/pill.hbs +24 -0
- package/addon/components/fleet-driver/summary.hbs +1 -0
- package/addon/components/fleet-driver-listing.hbs +2 -1
- package/addon/components/fleet-panel/details.hbs +6 -2
- package/addon/components/fleet-panel/driver-listing.hbs +2 -1
- package/addon/components/fleet-panel/vehicle-listing.hbs +2 -1
- package/addon/components/fleet-vehicle-listing.hbs +2 -1
- package/addon/components/fuel-integration/form.hbs +125 -25
- package/addon/components/fuel-integration/form.js +74 -19
- package/addon/components/fuel-integration/hub.hbs +68 -65
- package/addon/components/fuel-integration/hub.js +15 -19
- package/addon/components/fuel-provider-connection/pill.hbs +24 -0
- package/addon/components/fuel-provider-connection/summary.hbs +1 -0
- package/addon/components/fuel-provider-transaction/pill.hbs +24 -0
- package/addon/components/fuel-provider-transaction/summary.hbs +1 -0
- package/addon/components/fuel-report/details.hbs +9 -3
- package/addon/components/fuel-report/form.hbs +6 -3
- package/addon/components/fuel-report/pill.hbs +24 -0
- package/addon/components/fuel-report/summary.hbs +1 -0
- package/addon/components/fuel-transaction-status.hbs +1 -0
- package/addon/components/fuel-transaction-status.js +8 -0
- package/addon/components/geofence-map.hbs +19 -0
- package/addon/components/geofence-map.js +83 -0
- package/addon/components/inspection-field/form.hbs +103 -0
- package/addon/components/inspection-field/form.js +211 -0
- package/addon/components/inspection-field/input.hbs +270 -0
- package/addon/components/inspection-field/input.js +472 -0
- package/addon/components/inspection-field/value.hbs +90 -0
- package/addon/components/inspection-field/value.js +158 -0
- package/addon/components/inspection-flyout.hbs +34 -0
- package/addon/components/inspection-flyout.js +66 -0
- package/addon/components/inspection-form/builder.hbs +88 -0
- package/addon/components/inspection-form/builder.js +211 -0
- package/addon/components/inspection-form/details/submissions.hbs +48 -0
- package/addon/components/inspection-form/details/submissions.js +42 -0
- package/addon/components/inspection-form/details.hbs +97 -0
- package/addon/components/inspection-form/details.js +57 -0
- package/addon/components/inspection-form/form.hbs +93 -0
- package/addon/components/inspection-form/form.js +79 -0
- package/addon/components/inspection-form/pill.hbs +24 -0
- package/addon/components/inspection-form/summary.hbs +1 -0
- package/addon/components/inspection-item-result/pill.hbs +24 -0
- package/addon/components/inspection-item-result/summary.hbs +1 -0
- package/addon/components/inspection-link/list.hbs +94 -0
- package/addon/components/inspection-link/list.js +129 -0
- package/addon/components/inspection-sheet/group.hbs +45 -0
- package/addon/components/inspection-sheet/group.js +75 -0
- package/addon/components/inspection-sheet.hbs +77 -0
- package/addon/components/inspection-sheet.js +152 -0
- package/addon/components/inspection-submission/details.hbs +149 -0
- package/addon/components/inspection-submission/details.js +130 -0
- package/addon/components/inspection-submission/form.hbs +114 -0
- package/addon/components/inspection-submission/form.js +129 -0
- package/addon/components/inspection-submission/photos.hbs +20 -0
- package/addon/components/inspection-submission/photos.js +57 -0
- package/addon/components/inspection-submission/pill.hbs +24 -0
- package/addon/components/inspection-submission/summary.hbs +1 -0
- package/addon/components/integrated-vendor/pill.hbs +24 -0
- package/addon/components/integrated-vendor/summary.hbs +1 -0
- package/addon/components/issue/details.hbs +12 -0
- package/addon/components/issue/details.js +36 -0
- package/addon/components/issue/form.hbs +10 -5
- package/addon/components/issue/pill.hbs +24 -0
- package/addon/components/issue/summary.hbs +1 -0
- package/addon/components/layout/fleet-ops-sidebar.js +14 -3
- package/addon/components/maintenance/details.hbs +9 -3
- package/addon/components/maintenance/form.hbs +22 -3
- package/addon/components/maintenance/form.js +4 -4
- package/addon/components/maintenance/panel-header.hbs +14 -12
- package/addon/components/maintenance/pill.hbs +24 -0
- package/addon/components/maintenance/summary.hbs +1 -0
- package/addon/components/maintenance-schedule/details.hbs +7 -3
- package/addon/components/maintenance-schedule/form.hbs +20 -2
- package/addon/components/maintenance-schedule/form.js +6 -6
- package/addon/components/maintenance-schedule/pill.hbs +24 -0
- package/addon/components/maintenance-schedule/summary.hbs +1 -0
- package/addon/components/maintenance-schedule/work-orders.hbs +39 -0
- package/addon/components/maintenance-schedule/work-orders.js +37 -0
- package/addon/components/maintenance-subject/pill.hbs +24 -0
- package/addon/components/maintenance-subject/summary.hbs +1 -0
- package/addon/components/manifest/pill.hbs +24 -0
- package/addon/components/manifest/summary.hbs +1 -0
- package/addon/components/manifest-stop/pill.hbs +24 -0
- package/addon/components/manifest-stop/summary.hbs +1 -0
- package/addon/components/map/drawer/device-event-listing.hbs +4 -14
- package/addon/components/map/drawer/device-event-listing.js +3 -1
- package/addon/components/map/drawer/driver-listing.js +6 -2
- package/addon/components/map/drawer/position-listing.hbs +2 -16
- package/addon/components/map/drawer/vehicle-listing.js +1 -2
- package/addon/components/modals/add-driver-shift.hbs +2 -1
- package/addon/components/modals/assign-driver.hbs +2 -16
- package/addon/components/modals/attach-device.hbs +2 -1
- package/addon/components/modals/attach-equipment.hbs +2 -4
- package/addon/components/modals/attach-telematic-device.hbs +8 -1
- package/addon/components/modals/attach-trailer.hbs +2 -1
- package/addon/components/modals/bulk-assign-driver.hbs +2 -9
- package/addon/components/modals/bulk-assign-orders.hbs +2 -9
- package/addon/components/modals/driver-assign-order.hbs +2 -6
- package/addon/components/modals/driver-assign-vehicle.hbs +4 -12
- package/addon/components/modals/driver-assign-vehicle.js +30 -0
- package/addon/components/modals/driver-assign-vendor.hbs +2 -1
- package/addon/components/modals/driver-form.hbs +4 -2
- package/addon/components/modals/fleet-assign-driver.hbs +2 -1
- package/addon/components/modals/fleet-assign-vehicle.hbs +2 -1
- package/addon/components/modals/fleet-form.hbs +4 -2
- package/addon/components/modals/fuel-connection-diagnostics.hbs +35 -0
- package/addon/components/modals/fuel-connection-diagnostics.js +87 -0
- package/addon/components/modals/fuel-report-form.hbs +4 -2
- package/addon/components/modals/fuel-transaction-action.hbs +48 -0
- package/addon/components/modals/fuel-transaction-action.js +98 -0
- package/addon/components/modals/group-form.hbs +2 -1
- package/addon/components/modals/inspection-follow-up.hbs +31 -0
- package/addon/components/modals/inspection-follow-up.js +39 -0
- package/addon/components/modals/inspection-link.hbs +100 -0
- package/addon/components/modals/inspection-link.js +83 -0
- package/addon/components/modals/issue-assign.hbs +2 -1
- package/addon/components/modals/issue-from.hbs +8 -4
- package/addon/components/modals/map-layer-form.hbs +2 -1
- package/addon/components/modals/order-assign-driver.hbs +2 -16
- package/addon/components/modals/order-form.hbs +8 -46
- package/addon/components/modals/order-route-form.hbs +8 -4
- package/addon/components/modals/place-assign-vendor.hbs +3 -2
- package/addon/components/modals/place-details.hbs +1 -1
- package/addon/components/modals/point-map.hbs +1 -1
- package/addon/components/modals/radar-notice.hbs +24 -0
- package/addon/components/modals/radar-notice.js +8 -0
- package/addon/components/modals/radar-save-view.hbs +7 -0
- package/addon/components/modals/radar-select-resource.hbs +35 -0
- package/addon/components/modals/radar-send-pin.hbs +20 -0
- package/addon/components/modals/radar-send-pin.js +8 -0
- package/addon/components/modals/select-trailer.hbs +2 -4
- package/addon/components/modals/vehicle-form.hbs +2 -1
- package/addon/components/modals/vendor-form.hbs +2 -3
- package/addon/components/order/details/activity.js +9 -0
- package/addon/components/order/details/detail.hbs +2 -32
- package/addon/components/order/form/details.hbs +10 -48
- package/addon/components/order/form/route.hbs +10 -12
- package/addon/components/order/form/service-rate.hbs +2 -3
- package/addon/components/order/pill.hbs +24 -34
- package/addon/components/order/route-editor.hbs +8 -4
- package/addon/components/order/schedule-card.hbs +2 -1
- package/addon/components/order/summary.hbs +1 -0
- package/addon/components/order-config/pill.hbs +24 -0
- package/addon/components/order-config/summary.hbs +1 -0
- package/addon/components/part/details.hbs +15 -3
- package/addon/components/part/details.js +37 -1
- package/addon/components/part/form.hbs +12 -5
- package/addon/components/part/pill.hbs +24 -0
- package/addon/components/part/summary.hbs +1 -0
- package/addon/components/payload/pill.hbs +24 -0
- package/addon/components/payload/summary.hbs +1 -0
- package/addon/components/place/details.hbs +1 -1
- package/addon/components/place/pill.hbs +24 -0
- package/addon/components/place/summary.hbs +1 -0
- package/addon/components/position/pill.hbs +24 -0
- package/addon/components/position/summary.hbs +1 -0
- package/addon/components/positions-replay.hbs +2 -4
- package/addon/components/public-inspection.hbs +174 -0
- package/addon/components/public-inspection.js +279 -0
- package/addon/components/purchase-rate/pill.hbs +24 -0
- package/addon/components/purchase-rate/summary.hbs +1 -0
- package/addon/components/radar/agenda/entry.hbs +17 -0
- package/addon/components/radar/agenda/entry.js +26 -0
- package/addon/components/radar/agenda/lane.hbs +33 -0
- package/addon/components/radar/agenda/lane.js +80 -0
- package/addon/components/radar/agenda.hbs +69 -0
- package/addon/components/radar/agenda.js +29 -0
- package/addon/components/radar/briefing.hbs +108 -0
- package/addon/components/radar/briefing.js +43 -0
- package/addon/components/radar/bulk-bar.hbs +41 -0
- package/addon/components/radar/bulk-bar.js +32 -0
- package/addon/components/radar/decision-card.hbs +28 -0
- package/addon/components/radar/decision-card.js +7 -0
- package/addon/components/radar/empty-state.hbs +30 -0
- package/addon/components/radar/empty-state.js +27 -0
- package/addon/components/radar/filter-pills.hbs +22 -0
- package/addon/components/radar/filter-pills.js +3 -0
- package/addon/components/radar/handover-card.hbs +62 -0
- package/addon/components/radar/handover-card.js +14 -0
- package/addon/components/radar/header.hbs +28 -0
- package/addon/components/radar/header.js +12 -0
- package/addon/components/radar/item-drawer.hbs +92 -0
- package/addon/components/radar/item-drawer.js +37 -0
- package/addon/components/radar/item-list.hbs +20 -0
- package/addon/components/radar/item-list.js +3 -0
- package/addon/components/radar/item-row.hbs +90 -0
- package/addon/components/radar/item-row.js +43 -0
- package/addon/components/radar/keyboard-hints.hbs +8 -0
- package/addon/components/radar/keyboard-hints.js +3 -0
- package/addon/components/radar/subject.hbs +14 -0
- package/addon/components/radar/subject.js +26 -0
- package/addon/components/radar/view-bar.hbs +27 -0
- package/addon/components/radar/view-bar.js +16 -0
- package/addon/components/recurring-order-schedule/pill.hbs +24 -0
- package/addon/components/recurring-order-schedule/summary.hbs +1 -0
- package/addon/components/resource-activity.hbs +1 -0
- package/addon/components/resource-activity.js +4 -0
- package/addon/components/route/pill.hbs +24 -0
- package/addon/components/route/summary.hbs +1 -0
- package/addon/components/select-option/asset-connection.hbs +12 -0
- package/addon/components/select-option/asset.hbs +12 -0
- package/addon/components/select-option/attachable.hbs +12 -0
- package/addon/components/select-option/contact.hbs +12 -0
- package/addon/components/select-option/customer.hbs +12 -0
- package/addon/components/select-option/device-event.hbs +12 -0
- package/addon/components/select-option/device.hbs +12 -0
- package/addon/components/select-option/driver.hbs +12 -0
- package/addon/components/select-option/entity.hbs +12 -0
- package/addon/components/select-option/equipment.hbs +12 -0
- package/addon/components/select-option/facilitator.hbs +12 -0
- package/addon/components/select-option/fleet-driver.hbs +12 -0
- package/addon/components/select-option/fleet.hbs +12 -0
- package/addon/components/select-option/fuel-provider-connection.hbs +12 -0
- package/addon/components/select-option/fuel-provider-transaction.hbs +12 -0
- package/addon/components/select-option/fuel-report.hbs +12 -0
- package/addon/components/select-option/inspection-form.hbs +12 -0
- package/addon/components/select-option/inspection-item-result.hbs +12 -0
- package/addon/components/select-option/inspection-submission.hbs +12 -0
- package/addon/components/select-option/integrated-vendor.hbs +12 -0
- package/addon/components/select-option/issue.hbs +12 -0
- package/addon/components/select-option/maintenance-schedule.hbs +12 -0
- package/addon/components/select-option/maintenance-subject.hbs +12 -0
- package/addon/components/select-option/maintenance.hbs +12 -0
- package/addon/components/select-option/manifest-stop.hbs +12 -0
- package/addon/components/select-option/manifest.hbs +12 -0
- package/addon/components/select-option/order-config.hbs +12 -0
- package/addon/components/select-option/order.hbs +12 -0
- package/addon/components/select-option/part.hbs +12 -0
- package/addon/components/select-option/payload.hbs +12 -0
- package/addon/components/select-option/place.hbs +12 -0
- package/addon/components/select-option/position.hbs +12 -0
- package/addon/components/select-option/purchase-rate.hbs +12 -0
- package/addon/components/select-option/recurring-order-schedule.hbs +12 -0
- package/addon/components/select-option/route.hbs +12 -0
- package/addon/components/select-option/sensor.hbs +12 -0
- package/addon/components/select-option/service-area.hbs +12 -0
- package/addon/components/select-option/service-quote-item.hbs +12 -0
- package/addon/components/select-option/service-quote.hbs +12 -0
- package/addon/components/select-option/service-rate-fee.hbs +12 -0
- package/addon/components/select-option/service-rate-parcel-fee.hbs +12 -0
- package/addon/components/select-option/service-rate.hbs +12 -0
- package/addon/components/select-option/telematic.hbs +12 -0
- package/addon/components/select-option/trackable.hbs +8 -0
- package/addon/components/select-option/tracking-number.hbs +12 -0
- package/addon/components/select-option/tracking-status.hbs +12 -0
- package/addon/components/select-option/trailer.hbs +12 -0
- package/addon/components/select-option/vehicle-device.hbs +12 -0
- package/addon/components/select-option/vehicle.hbs +12 -0
- package/addon/components/select-option/vendor.hbs +12 -0
- package/addon/components/select-option/warranty.hbs +12 -0
- package/addon/components/select-option/waypoint.hbs +12 -0
- package/addon/components/select-option/work-order.hbs +12 -0
- package/addon/components/select-option/zone.hbs +12 -0
- package/addon/components/sensor/details.hbs +6 -2
- package/addon/components/sensor/form.hbs +6 -17
- package/addon/components/sensor/panel-header.hbs +1 -1
- package/addon/components/sensor/pill.hbs +24 -0
- package/addon/components/sensor/summary.hbs +1 -0
- package/addon/components/service-area/details.hbs +1 -20
- package/addon/components/service-area/pill.hbs +24 -0
- package/addon/components/service-area/summary.hbs +1 -0
- package/addon/components/service-quote/pill.hbs +24 -0
- package/addon/components/service-quote/summary.hbs +1 -0
- package/addon/components/service-quote-item/pill.hbs +24 -0
- package/addon/components/service-quote-item/summary.hbs +1 -0
- package/addon/components/service-rate/details.hbs +12 -6
- package/addon/components/service-rate/form.hbs +10 -8
- package/addon/components/service-rate/pill.hbs +24 -0
- package/addon/components/service-rate/summary.hbs +1 -0
- package/addon/components/service-rate-fee/pill.hbs +24 -0
- package/addon/components/service-rate-fee/summary.hbs +1 -0
- package/addon/components/service-rate-parcel-fee/pill.hbs +24 -0
- package/addon/components/service-rate-parcel-fee/summary.hbs +1 -0
- package/addon/components/table/cell/fleet-ops-option.hbs +20 -0
- package/addon/components/telematic/details.hbs +4 -1
- package/addon/components/telematic/details.js +1 -0
- package/addon/components/telematic/form.hbs +6 -1
- package/addon/components/telematic/form.js +1 -0
- package/addon/components/telematic/pill.hbs +24 -0
- package/addon/components/telematic/settings.hbs +6 -1
- package/addon/components/telematic/settings.js +1 -0
- package/addon/components/telematic/summary.hbs +1 -0
- package/addon/components/telematic/telemetry-status.hbs +43 -0
- package/addon/components/telematic/telemetry-status.js +95 -0
- package/addon/components/tracking-number/pill.hbs +24 -0
- package/addon/components/tracking-number/summary.hbs +1 -0
- package/addon/components/tracking-status/pill.hbs +24 -0
- package/addon/components/tracking-status/summary.hbs +1 -0
- package/addon/components/trailer/card.hbs +2 -5
- package/addon/components/trailer/details.hbs +11 -5
- package/addon/components/trailer/details.js +4 -0
- package/addon/components/trailer/form.hbs +6 -3
- package/addon/components/trailer/pill.hbs +24 -21
- package/addon/components/trailer/summary.hbs +1 -0
- package/addon/components/vehicle/card.hbs +4 -8
- package/addon/components/vehicle/details/inspections.hbs +49 -0
- package/addon/components/vehicle/details/inspections.js +44 -0
- package/addon/components/vehicle/details/maintenance-history.hbs +1 -1
- package/addon/components/vehicle/details/schedules.hbs +2 -2
- package/addon/components/vehicle/details/work-orders.hbs +1 -1
- package/addon/components/vehicle/details.hbs +18 -1
- package/addon/components/vehicle/form.hbs +2 -1
- package/addon/components/vehicle/panel-header.hbs +3 -4
- package/addon/components/vehicle/panel-header.js +8 -1
- package/addon/components/vehicle/pill.hbs +15 -24
- package/addon/components/vehicle/summary.hbs +1 -0
- package/addon/components/vehicle-device/pill.hbs +24 -0
- package/addon/components/vehicle-device/summary.hbs +1 -0
- package/addon/components/vendor/form.hbs +2 -4
- package/addon/components/vendor/personnel-manager.hbs +2 -9
- package/addon/components/vendor/personnel-tab.hbs +1 -0
- package/addon/components/vendor/personnel-tab.js +4 -0
- package/addon/components/vendor/pill.hbs +24 -0
- package/addon/components/vendor/summary.hbs +1 -0
- package/addon/components/warranty/details.hbs +3 -1
- package/addon/components/warranty/form.hbs +2 -1
- package/addon/components/warranty/pill.hbs +24 -0
- package/addon/components/warranty/summary.hbs +1 -0
- package/addon/components/waypoint/pill.hbs +24 -0
- package/addon/components/waypoint/summary.hbs +1 -0
- package/addon/components/widget/radar.hbs +28 -0
- package/addon/components/widget/radar.js +44 -0
- package/addon/components/work-order/details.hbs +20 -4
- package/addon/components/work-order/details.js +64 -1
- package/addon/components/work-order/form.hbs +20 -2
- package/addon/components/work-order/form.js +10 -10
- package/addon/components/work-order/panel-header.hbs +15 -13
- package/addon/components/work-order/pill.hbs +24 -0
- package/addon/components/work-order/summary.hbs +1 -0
- package/addon/components/zone/details.hbs +2 -21
- package/addon/components/zone/pill.hbs +24 -0
- package/addon/components/zone/summary.hbs +1 -0
- package/addon/controllers/connectivity/devices/index/details/sensors.js +4 -0
- package/addon/controllers/connectivity/devices/index/details.js +1 -18
- package/addon/controllers/connectivity/events/index.js +1 -4
- package/addon/controllers/connectivity/fuel-providers/details/index.js +6 -0
- package/addon/controllers/connectivity/fuel-providers/details/matching.js +13 -0
- package/addon/controllers/connectivity/fuel-providers/details/sync.js +21 -10
- package/addon/controllers/connectivity/fuel-providers/details/transactions.js +5 -16
- package/addon/controllers/connectivity/fuel-providers/details.js +76 -13
- package/addon/controllers/connectivity/fuel-providers/index.js +22 -17
- package/addon/controllers/connectivity/sensors/index.js +1 -3
- package/addon/controllers/connectivity/telematics/details/events.js +8 -0
- package/addon/controllers/connectivity/telematics/details/sensors.js +3 -2
- package/addon/controllers/connectivity/telematics/index.js +3 -1
- package/addon/controllers/maintenance/inspection-forms/index/details.js +29 -0
- package/addon/controllers/maintenance/inspection-forms/index/edit.js +39 -0
- package/addon/controllers/maintenance/inspection-forms/index/new.js +48 -0
- package/addon/controllers/maintenance/inspection-forms/index.js +90 -0
- package/addon/controllers/maintenance/inspection-submissions/index/details.js +53 -0
- package/addon/controllers/maintenance/inspection-submissions/index/edit.js +39 -0
- package/addon/controllers/maintenance/inspection-submissions/index/new.js +48 -0
- package/addon/controllers/maintenance/inspection-submissions/index.js +142 -0
- package/addon/controllers/maintenance/maintenances/index.js +6 -2
- package/addon/controllers/maintenance/schedules/index/details.js +4 -86
- package/addon/controllers/maintenance/schedules/index.js +15 -0
- package/addon/controllers/maintenance/work-orders/index.js +19 -1
- package/addon/controllers/management/contacts/customers.js +6 -4
- package/addon/controllers/management/contacts/index.js +6 -3
- package/addon/controllers/management/drivers/index/details.js +1 -66
- package/addon/controllers/management/drivers/index.js +9 -34
- package/addon/controllers/management/fleets/index/details.js +2 -15
- package/addon/controllers/management/fleets/index.js +12 -20
- package/addon/controllers/management/fuel-reports/index.js +9 -59
- package/addon/controllers/management/fuel-transactions/index/details.js +51 -48
- package/addon/controllers/management/fuel-transactions/index.js +32 -32
- package/addon/controllers/management/index.js +1367 -49
- package/addon/controllers/management/issues/index/details.js +1 -33
- package/addon/controllers/management/issues/index.js +10 -59
- package/addon/controllers/management/trailers/index/details.js +4 -78
- package/addon/controllers/management/trailers/index.js +20 -22
- package/addon/controllers/management/vehicles/index/details.js +9 -77
- package/addon/controllers/management/vehicles/index.js +50 -72
- package/addon/controllers/management/vendors/index.js +6 -3
- package/addon/controllers/operations/orders/index.js +38 -11
- package/addon/controllers/operations/service-rates/index.js +10 -2
- package/addon/controllers/settings/payments/index.js +11 -2
- package/addon/extension.js +36 -0
- package/addon/helpers/initials.js +6 -0
- package/addon/helpers/leaflet-tile-url.js +6 -1
- package/addon/instance-initializers/register-fleetops-resource-descriptors.js +29 -0
- package/addon/modifiers/inspection-flyout.js +237 -0
- package/addon/modifiers/radar-keyboard.js +78 -0
- package/addon/modifiers/sync-value.js +26 -0
- package/addon/modifiers/when-changed.js +25 -0
- package/addon/routes/connectivity/fuel-providers/details/settings.js +5 -2
- package/addon/routes/connectivity/fuel-providers/details/sync.js +6 -13
- package/addon/routes/connectivity/fuel-providers/details/transactions.js +8 -7
- package/addon/routes/connectivity/fuel-providers/details.js +15 -2
- package/addon/routes/connectivity/fuel-providers/edit.js +2 -1
- package/addon/routes/connectivity/fuel-providers/index.js +5 -0
- package/addon/routes/maintenance/inspection-forms/index/details/index.js +3 -0
- package/addon/routes/maintenance/inspection-forms/index/details/submissions.js +3 -0
- package/addon/routes/maintenance/inspection-forms/index/details.js +18 -0
- package/addon/routes/maintenance/inspection-forms/index/edit.js +18 -0
- package/addon/routes/maintenance/inspection-forms/index/new.js +3 -0
- package/addon/routes/maintenance/inspection-forms/index.js +22 -0
- package/addon/routes/maintenance/inspection-forms.js +3 -0
- package/addon/routes/maintenance/inspection-submissions/index/details/audit.js +8 -0
- package/addon/routes/maintenance/inspection-submissions/index/details/index.js +3 -0
- package/addon/routes/maintenance/inspection-submissions/index/details/photos.js +8 -0
- package/addon/routes/maintenance/inspection-submissions/index/details.js +18 -0
- package/addon/routes/maintenance/inspection-submissions/index/edit.js +18 -0
- package/addon/routes/maintenance/inspection-submissions/index/new.js +3 -0
- package/addon/routes/maintenance/inspection-submissions/index.js +25 -0
- package/addon/routes/maintenance/inspection-submissions.js +3 -0
- package/addon/routes/management/fuel-transactions/index/details.js +12 -2
- package/addon/routes/management/fuel-transactions/index.js +6 -0
- package/addon/routes/management/index.js +17 -1
- package/addon/routes/management/vehicles/index/details/inspections.js +3 -0
- package/addon/routes/management/vehicles/index.js +2 -2
- package/addon/routes.js +24 -0
- package/addon/services/contact-actions.js +22 -4
- package/addon/services/customer-actions.js +7 -4
- package/addon/services/device-actions.js +28 -0
- package/addon/services/driver-actions.js +79 -16
- package/addon/services/equipment-actions.js +15 -6
- package/addon/services/fleet-actions.js +20 -4
- package/addon/services/fuel-report-actions.js +7 -7
- package/addon/services/inspection-form-actions.js +236 -0
- package/addon/services/inspection-submission-actions.js +273 -0
- package/addon/services/issue-actions.js +58 -7
- package/addon/services/maintenance-actions.js +22 -3
- package/addon/services/maintenance-schedule-actions.js +70 -5
- package/addon/services/movement-tracker.js +52 -1
- package/addon/services/part-actions.js +13 -7
- package/addon/services/place-actions.js +8 -7
- package/addon/services/service-area-actions.js +27 -4
- package/addon/services/trailer-actions.js +60 -7
- package/addon/services/vehicle-actions.js +58 -3
- package/addon/services/vendor-actions.js +8 -7
- package/addon/services/work-order-actions.js +14 -5
- package/addon/services/zone-actions.js +27 -4
- package/addon/styles/fleetops-engine.css +3621 -75
- package/addon/templates/connectivity/devices/index/details/vehicle.hbs +2 -2
- package/addon/templates/connectivity/events/details.hbs +2 -2
- package/addon/templates/connectivity/fuel-providers/details/index.hbs +65 -35
- package/addon/templates/connectivity/fuel-providers/details/matching.hbs +2 -2
- package/addon/templates/connectivity/fuel-providers/details/sync.hbs +54 -43
- package/addon/templates/connectivity/fuel-providers/details/transactions.hbs +10 -5
- package/addon/templates/connectivity/fuel-providers/details.hbs +38 -13
- package/addon/templates/connectivity/fuel-providers/edit.hbs +1 -0
- package/addon/templates/connectivity/fuel-providers/index.hbs +2 -1
- package/addon/templates/connectivity/fuel-providers/new.hbs +1 -1
- package/addon/templates/connectivity/telematics/details/attachments.hbs +2 -1
- package/addon/templates/maintenance/inspection-forms/index/details/index.hbs +1 -0
- package/addon/templates/maintenance/inspection-forms/index/details/submissions.hbs +2 -0
- package/addon/templates/maintenance/inspection-forms/index/details.hbs +14 -0
- package/addon/templates/maintenance/inspection-forms/index/edit.hbs +11 -0
- package/addon/templates/maintenance/inspection-forms/index/new.hbs +11 -0
- package/addon/templates/maintenance/inspection-forms/index.hbs +28 -0
- package/addon/templates/maintenance/inspection-forms.hbs +1 -0
- package/addon/templates/maintenance/inspection-submissions/index/details/audit.hbs +1 -0
- package/addon/templates/maintenance/inspection-submissions/index/details/index.hbs +1 -0
- package/addon/templates/maintenance/inspection-submissions/index/details/photos.hbs +1 -0
- package/addon/templates/maintenance/inspection-submissions/index/details.hbs +14 -0
- package/addon/templates/maintenance/inspection-submissions/index/edit.hbs +11 -0
- package/addon/templates/maintenance/inspection-submissions/index/new.hbs +11 -0
- package/addon/templates/maintenance/inspection-submissions/index.hbs +28 -0
- package/addon/templates/maintenance/inspection-submissions.hbs +1 -0
- package/addon/templates/management/fuel-transactions/index/details.hbs +64 -62
- package/addon/templates/management/fuel-transactions/index.hbs +9 -31
- package/addon/templates/management/index.hbs +110 -102
- package/addon/templates/management/vehicles/index/details/inspections.hbs +2 -0
- package/addon/templates/operations/orders/index.hbs +2 -4
- package/addon/utils/context-panel.js +34 -0
- package/addon/utils/device-table-columns.js +18 -27
- package/addon/utils/fleet-ops-options.js +40 -0
- package/addon/utils/fuel-integration-format.js +43 -0
- package/addon/utils/fuel-transaction.js +115 -0
- package/addon/utils/identity-cell-resource.js +56 -0
- package/addon/utils/inspection-answers.js +283 -0
- package/addon/utils/inspection-field-types.js +74 -0
- package/addon/utils/inspection-form-structure.js +161 -0
- package/addon/utils/radar.js +212 -0
- package/addon/utils/relation-value.js +37 -0
- package/addon/utils/resource-descriptors/assets.js +246 -0
- package/addon/utils/resource-descriptors/connectivity.js +146 -0
- package/addon/utils/resource-descriptors/fuel.js +75 -0
- package/addon/utils/resource-descriptors/helpers.js +191 -0
- package/addon/utils/resource-descriptors/index.js +35 -0
- package/addon/utils/resource-descriptors/maintenance.js +175 -0
- package/addon/utils/resource-descriptors/operations.js +215 -0
- package/addon/utils/resource-descriptors/people.js +173 -0
- package/addon/utils/resource-descriptors/polymorphic.js +123 -0
- package/addon/utils/resource-descriptors/sub-records.js +297 -0
- package/addon/utils/telemetry-timestamp.js +6 -0
- package/app/components/asset/pill.js +1 -0
- package/app/components/asset/summary.js +1 -0
- package/app/components/asset-connection/pill.js +1 -0
- package/app/components/asset-connection/summary.js +1 -0
- package/app/components/attachable/pill.js +1 -0
- package/app/components/attachable/summary.js +1 -0
- package/app/components/cell/asset-connection-identity.js +1 -0
- package/app/components/cell/{attached-vehicle.js → asset-identity.js} +1 -1
- package/app/components/cell/attachable-identity.js +1 -0
- package/app/components/cell/{telematic-device.js → contact-identity.js} +1 -1
- package/app/components/cell/customer-identity.js +1 -0
- package/app/components/cell/device-event-identity.js +1 -0
- package/app/components/cell/entity-identity.js +1 -0
- package/app/components/cell/facilitator-identity.js +1 -0
- package/app/components/cell/fleet-driver-identity.js +1 -0
- package/app/components/cell/fleet-identity.js +1 -0
- package/app/components/cell/fuel-provider-connection-identity.js +1 -0
- package/app/components/cell/fuel-provider-transaction-identity.js +1 -0
- package/app/components/cell/fuel-report-identity.js +1 -0
- package/app/components/cell/inspection-form-identity.js +1 -0
- package/app/components/cell/inspection-item-result-identity.js +1 -0
- package/app/components/cell/inspection-submission-identity.js +1 -0
- package/app/components/cell/integrated-vendor-identity.js +1 -0
- package/app/components/cell/issue-identity.js +1 -0
- package/app/components/cell/maintenance-identity.js +1 -0
- package/app/components/cell/maintenance-schedule-identity.js +1 -0
- package/app/components/cell/maintenance-subject-identity.js +1 -0
- package/app/components/cell/manifest-identity.js +1 -0
- package/app/components/cell/manifest-stop-identity.js +1 -0
- package/app/components/cell/order-config-identity.js +1 -0
- package/app/components/cell/order-identity.js +1 -0
- package/app/components/cell/payload-identity.js +1 -0
- package/app/components/cell/place-identity.js +1 -0
- package/app/components/cell/position-identity.js +1 -0
- package/app/components/cell/purchase-rate-identity.js +1 -0
- package/app/components/cell/recurring-order-schedule-identity.js +1 -0
- package/app/components/cell/resource-list.js +1 -0
- package/app/components/cell/route-identity.js +1 -0
- package/app/components/cell/sensor-identity.js +1 -0
- package/app/components/cell/service-area-identity.js +1 -0
- package/app/components/cell/service-quote-identity.js +1 -0
- package/app/components/cell/service-quote-item-identity.js +1 -0
- package/app/components/cell/service-rate-fee-identity.js +1 -0
- package/app/components/cell/service-rate-identity.js +1 -0
- package/app/components/cell/service-rate-parcel-fee-identity.js +1 -0
- package/app/components/cell/{telematic-provider.js → telematic-identity.js} +1 -1
- package/app/components/cell/tracking-number-identity.js +1 -0
- package/app/components/cell/tracking-status-identity.js +1 -0
- package/app/components/cell/trailer-identity.js +1 -0
- package/app/components/cell/vehicle-device-identity.js +1 -0
- package/app/components/cell/vendor-identity.js +1 -0
- package/app/components/cell/warranty-identity.js +1 -0
- package/app/components/cell/waypoint-identity.js +1 -0
- package/app/components/cell/work-order-identity.js +1 -0
- package/app/components/cell/zone-identity.js +1 -0
- package/app/components/{cell/driver-name.js → contact/pill.js} +1 -1
- package/app/components/{cell/vehicle-name.js → contact/summary.js} +1 -1
- package/app/components/customer/pill.js +1 -0
- package/app/components/customer/summary.js +1 -0
- package/app/components/device/summary.js +1 -0
- package/app/components/device/telemetry.js +1 -0
- package/app/components/device-event/pill.js +1 -0
- package/app/components/device-event/summary.js +1 -0
- package/app/components/driver/summary.js +1 -0
- package/app/components/entity/pill.js +1 -0
- package/app/components/entity/summary.js +1 -0
- package/app/components/equipment/card.js +1 -0
- package/app/components/equipment/panel-header.js +1 -0
- package/app/components/equipment/summary.js +1 -0
- package/app/components/{filter/multi-model.js → facilitator/pill.js} +1 -1
- package/app/components/facilitator/summary.js +1 -0
- package/app/components/fleet/pill.js +1 -0
- package/app/components/fleet/summary.js +1 -0
- package/app/components/fleet-driver/pill.js +1 -0
- package/app/components/fleet-driver/summary.js +1 -0
- package/app/components/fuel-provider-connection/pill.js +1 -0
- package/app/components/fuel-provider-connection/summary.js +1 -0
- package/app/components/fuel-provider-transaction/pill.js +1 -0
- package/app/components/fuel-provider-transaction/summary.js +1 -0
- package/app/components/fuel-report/pill.js +1 -0
- package/app/components/fuel-report/summary.js +1 -0
- package/app/components/fuel-transaction-status.js +1 -0
- package/app/components/geofence-map.js +1 -0
- package/app/components/inspection-field/form.js +1 -0
- package/app/components/inspection-field/input.js +1 -0
- package/app/components/inspection-field/value.js +1 -0
- package/app/components/inspection-flyout.js +1 -0
- package/app/components/inspection-form/builder.js +1 -0
- package/app/components/inspection-form/details/submissions.js +1 -0
- package/app/components/inspection-form/details.js +1 -0
- package/app/components/inspection-form/form.js +1 -0
- package/app/components/inspection-form/pill.js +1 -0
- package/app/components/inspection-form/summary.js +1 -0
- package/app/components/inspection-item-result/pill.js +1 -0
- package/app/components/inspection-item-result/summary.js +1 -0
- package/app/components/inspection-link/list.js +1 -0
- package/app/components/inspection-sheet/group.js +1 -0
- package/app/components/inspection-sheet.js +1 -0
- package/app/components/inspection-submission/details.js +1 -0
- package/app/components/inspection-submission/form.js +1 -0
- package/app/components/inspection-submission/photos.js +1 -0
- package/app/components/inspection-submission/pill.js +1 -0
- package/app/components/inspection-submission/summary.js +1 -0
- package/app/components/integrated-vendor/pill.js +1 -0
- package/app/components/integrated-vendor/summary.js +1 -0
- package/app/components/issue/pill.js +1 -0
- package/app/components/issue/summary.js +1 -0
- package/app/components/issue/timeline.js +1 -0
- package/app/components/layout/fleet-ops-sidebar/operations-monitor.js +1 -0
- package/app/components/maintenance/pill.js +1 -0
- package/app/components/maintenance/summary.js +1 -0
- package/app/components/maintenance-schedule/pill.js +1 -0
- package/app/components/maintenance-schedule/summary.js +1 -0
- package/app/components/maintenance-schedule/work-orders.js +1 -0
- package/app/components/maintenance-subject/pill.js +1 -0
- package/app/components/maintenance-subject/summary.js +1 -0
- package/app/components/manifest/pill.js +1 -0
- package/app/components/manifest/summary.js +1 -0
- package/app/components/manifest-stop/pill.js +1 -0
- package/app/components/manifest-stop/summary.js +1 -0
- package/app/components/modals/fuel-connection-diagnostics.js +1 -0
- package/app/components/modals/fuel-transaction-action.js +1 -0
- package/app/components/modals/inspection-follow-up.js +1 -0
- package/app/components/modals/inspection-link.js +1 -0
- package/app/components/modals/radar-notice.js +1 -0
- package/app/components/modals/radar-save-view.js +1 -0
- package/app/components/modals/radar-select-resource.js +1 -0
- package/app/components/modals/radar-send-pin.js +1 -0
- package/app/components/order/summary.js +1 -0
- package/app/components/order-config/pill.js +1 -0
- package/app/components/order-config/summary.js +1 -0
- package/app/components/part/card.js +1 -0
- package/app/components/part/panel-header.js +1 -0
- package/app/components/part/pill.js +1 -0
- package/app/components/part/summary.js +1 -0
- package/app/components/payload/pill.js +1 -0
- package/app/components/payload/summary.js +1 -0
- package/app/components/place/pill.js +1 -0
- package/app/components/place/summary.js +1 -0
- package/app/components/position/pill.js +1 -0
- package/app/components/position/summary.js +1 -0
- package/app/components/public-inspection.js +1 -0
- package/app/components/purchase-rate/pill.js +1 -0
- package/app/components/purchase-rate/summary.js +1 -0
- package/app/components/radar/agenda/entry.js +1 -0
- package/app/components/radar/agenda/lane.js +1 -0
- package/app/components/radar/agenda.js +1 -0
- package/app/components/radar/briefing.js +1 -0
- package/app/components/radar/bulk-bar.js +1 -0
- package/app/components/radar/decision-card.js +1 -0
- package/app/components/radar/empty-state.js +1 -0
- package/app/components/radar/filter-pills.js +1 -0
- package/app/components/radar/handover-card.js +1 -0
- package/app/components/radar/header.js +1 -0
- package/app/components/radar/item-drawer.js +1 -0
- package/app/components/radar/item-list.js +1 -0
- package/app/components/radar/item-row.js +1 -0
- package/app/components/radar/keyboard-hints.js +1 -0
- package/app/components/radar/subject.js +1 -0
- package/app/components/radar/view-bar.js +1 -0
- package/app/components/recurring-order-schedule/pill.js +1 -0
- package/app/components/recurring-order-schedule/summary.js +1 -0
- package/app/components/resource-activity.js +1 -0
- package/app/components/route/pill.js +1 -0
- package/app/components/route/summary.js +1 -0
- package/app/components/select-option/asset-connection.js +1 -0
- package/app/components/select-option/asset.js +1 -0
- package/app/components/select-option/attachable.js +1 -0
- package/app/components/select-option/contact.js +1 -0
- package/app/components/select-option/customer.js +1 -0
- package/app/components/select-option/device-event.js +1 -0
- package/app/components/select-option/device.js +1 -0
- package/app/components/select-option/driver.js +1 -0
- package/app/components/select-option/entity.js +1 -0
- package/app/components/select-option/equipment.js +1 -0
- package/app/components/select-option/facilitator.js +1 -0
- package/app/components/select-option/fleet-driver.js +1 -0
- package/app/components/select-option/fleet.js +1 -0
- package/app/components/select-option/fuel-provider-connection.js +1 -0
- package/app/components/select-option/fuel-provider-transaction.js +1 -0
- package/app/components/select-option/fuel-report.js +1 -0
- package/app/components/select-option/inspection-form.js +1 -0
- package/app/components/select-option/inspection-item-result.js +1 -0
- package/app/components/select-option/inspection-submission.js +1 -0
- package/app/components/select-option/integrated-vendor.js +1 -0
- package/app/components/select-option/issue.js +1 -0
- package/app/components/select-option/maintenance-schedule.js +1 -0
- package/app/components/select-option/maintenance-subject.js +1 -0
- package/app/components/select-option/maintenance.js +1 -0
- package/app/components/select-option/manifest-stop.js +1 -0
- package/app/components/select-option/manifest.js +1 -0
- package/app/components/select-option/order-config.js +1 -0
- package/app/components/select-option/order.js +1 -0
- package/app/components/select-option/part.js +1 -0
- package/app/components/select-option/payload.js +1 -0
- package/app/components/select-option/place.js +1 -0
- package/app/components/select-option/position.js +1 -0
- package/app/components/select-option/purchase-rate.js +1 -0
- package/app/components/select-option/recurring-order-schedule.js +1 -0
- package/app/components/select-option/route.js +1 -0
- package/app/components/select-option/sensor.js +1 -0
- package/app/components/select-option/service-area.js +1 -0
- package/app/components/select-option/service-quote-item.js +1 -0
- package/app/components/select-option/service-quote.js +1 -0
- package/app/components/select-option/service-rate-fee.js +1 -0
- package/app/components/select-option/service-rate-parcel-fee.js +1 -0
- package/app/components/select-option/service-rate.js +1 -0
- package/app/components/select-option/telematic.js +1 -0
- package/app/components/select-option/trackable.js +1 -0
- package/app/components/select-option/tracking-number.js +1 -0
- package/app/components/select-option/tracking-status.js +1 -0
- package/app/components/select-option/trailer.js +1 -0
- package/app/components/select-option/vehicle-device.js +1 -0
- package/app/components/select-option/vehicle.js +1 -0
- package/app/components/select-option/vendor.js +1 -0
- package/app/components/select-option/warranty.js +1 -0
- package/app/components/select-option/waypoint.js +1 -0
- package/app/components/select-option/work-order.js +1 -0
- package/app/components/select-option/zone.js +1 -0
- package/app/components/sensor/pill.js +1 -0
- package/app/components/sensor/summary.js +1 -0
- package/app/components/service-area/pill.js +1 -0
- package/app/components/service-area/summary.js +1 -0
- package/app/components/service-quote/pill.js +1 -0
- package/app/components/service-quote/summary.js +1 -0
- package/app/components/service-quote-item/pill.js +1 -0
- package/app/components/service-quote-item/summary.js +1 -0
- package/app/components/service-rate/pill.js +1 -0
- package/app/components/service-rate/summary.js +1 -0
- package/app/components/service-rate-fee/pill.js +1 -0
- package/app/components/service-rate-fee/summary.js +1 -0
- package/app/components/service-rate-parcel-fee/pill.js +1 -0
- package/app/components/service-rate-parcel-fee/summary.js +1 -0
- package/app/components/table/cell/fleet-ops-option.js +1 -0
- package/app/components/telematic/pill.js +1 -0
- package/app/components/telematic/summary.js +1 -0
- package/app/components/telematic/telemetry-status.js +1 -0
- package/app/components/tracking-number/pill.js +1 -0
- package/app/components/tracking-number/summary.js +1 -0
- package/app/components/tracking-status/pill.js +1 -0
- package/app/components/tracking-status/summary.js +1 -0
- package/app/components/trailer/summary.js +1 -0
- package/app/components/vehicle/details/inspections.js +1 -0
- package/app/components/vehicle/summary.js +1 -0
- package/app/components/vehicle-device/pill.js +1 -0
- package/app/components/vehicle-device/summary.js +1 -0
- package/app/components/vendor/personnel-tab.js +1 -0
- package/app/components/vendor/pill.js +1 -0
- package/app/components/vendor/summary.js +1 -0
- package/app/components/warranty/pill.js +1 -0
- package/app/components/warranty/summary.js +1 -0
- package/app/components/waypoint/pill.js +1 -0
- package/app/components/waypoint/summary.js +1 -0
- package/app/components/widget/radar.js +1 -0
- package/app/components/work-order/panel-header.js +1 -0
- package/app/components/work-order/pill.js +1 -0
- package/app/components/work-order/summary.js +1 -0
- package/app/components/zone/pill.js +1 -0
- package/app/components/zone/summary.js +1 -0
- package/app/controllers/maintenance/inspection-forms/index/details.js +1 -0
- package/app/controllers/maintenance/inspection-forms/index/edit.js +1 -0
- package/app/controllers/maintenance/inspection-forms/index/new.js +1 -0
- package/app/controllers/maintenance/inspection-forms/index.js +1 -0
- package/app/controllers/maintenance/inspection-submissions/index/details.js +1 -0
- package/app/controllers/maintenance/inspection-submissions/index/edit.js +1 -0
- package/app/controllers/maintenance/inspection-submissions/index/new.js +1 -0
- package/app/controllers/maintenance/inspection-submissions/index.js +1 -0
- package/app/helpers/initials.js +1 -0
- package/app/modifiers/inspection-flyout.js +1 -0
- package/app/modifiers/radar-keyboard.js +1 -0
- package/app/modifiers/sync-value.js +1 -0
- package/app/modifiers/when-changed.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/details/index.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/details/submissions.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/details.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/edit.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/new.js +1 -0
- package/app/routes/maintenance/inspection-forms/index.js +1 -0
- package/app/routes/maintenance/inspection-forms.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/details/audit.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/details/index.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/details/photos.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/details.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/edit.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/new.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index.js +1 -0
- package/app/routes/maintenance/inspection-submissions.js +1 -0
- package/app/routes/management/vehicles/index/details/inspections.js +1 -0
- package/app/services/inspection-form-actions.js +1 -0
- package/app/services/inspection-submission-actions.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/details/index.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/details/submissions.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/details.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/edit.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/new.js +1 -0
- package/app/templates/maintenance/inspection-forms/index.js +1 -0
- package/app/templates/maintenance/inspection-forms.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/details/audit.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/details/index.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/details/photos.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/details.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/edit.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/new.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index.js +1 -0
- package/app/templates/maintenance/inspection-submissions.js +1 -0
- package/app/templates/management/vehicles/index/details/inspections.js +1 -0
- package/app/utils/inspection-field-types.js +2 -0
- package/app/utils/inspection-form-structure.js +1 -0
- package/app/utils/radar.js +1 -0
- package/composer.json +1 -1
- package/docs/AFAQY.md +91 -0
- package/docs/TELEMETRY_ARCHITECTURE.md +115 -0
- package/extension.json +1 -1
- package/package.json +3 -3
- package/scripts/coverage-summary.php +11 -0
- package/scripts/pest-bootstrap.php +1 -1
- package/server/config/afaqy.php +8 -0
- package/server/config/fuel-providers.php +28 -7
- package/server/config/telematics.php +8 -1
- package/server/config/telemetry.php +17 -0
- package/server/migrations/2026_09_09_000001_create_inspection_tables.php +152 -0
- package/server/migrations/2026_09_10_000001_convert_inspection_form_items_to_field_groups.php +44 -0
- package/server/migrations/2026_09_10_000002_add_token_to_inspection_links.php +39 -0
- package/server/migrations/2026_09_11_000001_add_assignee_and_pin_to_inspection_links.php +39 -0
- package/server/migrations/2026_09_15_000001_create_telematic_telemetry_tables.php +62 -0
- package/server/migrations/2026_09_15_000002_scope_fuel_transactions_to_connection.php +25 -0
- package/server/migrations/2026_09_16_000001_add_public_id_to_alerts_table.php +45 -0
- package/server/resources/views/mail/inspection-link-pin.blade.php +34 -0
- package/server/src/Auth/Schemas/FleetOps.php +12 -0
- package/server/src/Console/Commands/DrainTelematicInbox.php +82 -0
- package/server/src/Console/Commands/ProcessMaintenanceTriggers.php +4 -1
- package/server/src/Console/Commands/SyncTelematics.php +32 -2
- package/server/src/Contracts/TelemetryProviderInterface.php +27 -0
- package/server/src/Events/DeviceTelemetryUpdated.php +37 -0
- package/server/src/Events/VehicleLocationChanged.php +8 -4
- package/server/src/Exports/InspectionExport.php +125 -0
- package/server/src/Http/Controllers/Api/v1/GeofenceController.php +1 -1
- package/server/src/Http/Controllers/Api/v1/InspectionController.php +300 -0
- package/server/src/Http/Controllers/Internal/v1/FuelProviderConnectionController.php +40 -8
- package/server/src/Http/Controllers/Internal/v1/HubController.php +36 -11
- package/server/src/Http/Controllers/Internal/v1/InspectionFormController.php +326 -0
- package/server/src/Http/Controllers/Internal/v1/InspectionSubmissionController.php +229 -0
- package/server/src/Http/Controllers/Internal/v1/RadarController.php +1117 -0
- package/server/src/Http/Controllers/Internal/v1/TelematicController.php +67 -0
- package/server/src/Http/Controllers/Public/PublicInspectionController.php +243 -0
- package/server/src/Http/Controllers/TelematicPositionWebhookController.php +60 -0
- package/server/src/Http/Controllers/TelematicWebhookController.php +3 -0
- package/server/src/Http/Filter/FuelProviderConnectionFilter.php +1 -1
- package/server/src/Http/Middleware/ForceJsonResponse.php +25 -0
- package/server/src/Http/Resources/v1/InspectionForm.php +153 -0
- package/server/src/Http/Resources/v1/InspectionItemResult.php +77 -0
- package/server/src/Http/Resources/v1/InspectionLink.php +84 -0
- package/server/src/Http/Resources/v1/InspectionSubmission.php +173 -0
- package/server/src/Jobs/PollTelematicTelemetry.php +118 -0
- package/server/src/Jobs/ProcessTelematicDelivery.php +122 -0
- package/server/src/Jobs/SyncFuelProviderTransactionsJob.php +21 -4
- package/server/src/Mail/InspectionLinkPinMail.php +57 -0
- package/server/src/Models/Driver.php +8 -2
- package/server/src/Models/FuelProviderTransaction.php +1 -0
- package/server/src/Models/InspectionForm.php +240 -0
- package/server/src/Models/InspectionItemResult.php +90 -0
- package/server/src/Models/InspectionLink.php +284 -0
- package/server/src/Models/InspectionSubmission.php +440 -0
- package/server/src/Models/Part.php +9 -2
- package/server/src/Models/WorkOrder.php +3 -0
- package/server/src/Observers/WorkOrderObserver.php +1 -1
- package/server/src/Providers/FleetOpsServiceProvider.php +9 -0
- package/server/src/Rules/Base64OrUrl.php +54 -0
- package/server/src/Support/FuelProviders/FuelProviderService.php +64 -27
- package/server/src/Support/FuelProviders/Providers/PetroAppFuelProvider.php +81 -15
- package/server/src/Support/InspectionFileStore.php +268 -0
- package/server/src/Support/InspectionFormSync.php +231 -0
- package/server/src/Support/InspectionLinkPin.php +150 -0
- package/server/src/Support/InspectionSubmitter.php +297 -0
- package/server/src/Support/Radar/RadarAgenda.php +375 -0
- package/server/src/Support/Radar/RadarBriefing.php +504 -0
- package/server/src/Support/Radar/RadarItemState.php +435 -0
- package/server/src/Support/Radar/RadarRules.php +1424 -0
- package/server/src/Support/Reporting/FleetOpsReportSchema.php +178 -0
- package/server/src/Support/Telematics/Afaqy/Payload.php +49 -0
- package/server/src/Support/Telematics/Providers/AfaqyProvider.php +179 -61
- package/server/src/Support/Telematics/TelematicService.php +37 -6
- package/server/src/Support/Telematics/Telemetry/Configuration.php +30 -0
- package/server/src/Support/Telematics/Telemetry/Inbox.php +61 -0
- package/server/src/Support/Telematics/Telemetry/Ingestor.php +112 -0
- package/server/src/Support/Telematics/Telemetry/Queue.php +28 -0
- package/server/src/Support/Telematics/Telemetry/Sample.php +54 -0
- package/server/src/routes.php +76 -0
- package/server/tests/ApiManifestControllerContractsTest.php +9 -9
- package/server/tests/ControllerFilterContractsTest.php +1 -1
- package/server/tests/EventContractsTest.php +2 -1
- package/server/tests/Feature/Http/AfaqyRealtimeIngestionTest.php +792 -0
- package/server/tests/Feature/Http/Api/GeofenceControllerContractsTest.php +4 -4
- package/server/tests/Feature/Http/Api/TrailerControllerLifecycleTest.php +1 -1
- package/server/tests/Feature/Http/Internal/DriverControllerCreateRecordTest.php +1 -1
- package/server/tests/Feature/Http/Internal/DriverControllerExistingUserAdoptionTest.php +1 -1
- package/server/tests/Feature/Http/Internal/HubControllerTest.php +28 -2
- package/server/tests/Feature/Http/Internal/OrderControllerCreateRecordTest.php +1 -1
- package/server/tests/Feature/Http/Internal/RadarControllerDatabaseTest.php +415 -0
- package/server/tests/Feature/Http/Internal/RadarControllerTest.php +594 -0
- package/server/tests/FuelProviderConnectionControllerContractsTest.php +83 -3
- package/server/tests/FuelProviderImplementationTest.php +10 -2
- package/server/tests/HubAndGettingStartedContractsTest.php +26 -3
- package/server/tests/InspectionControllerContractsTest.php +1329 -0
- package/server/tests/InspectionFieldContractsTest.php +1019 -0
- package/server/tests/InspectionModelContractsTest.php +728 -0
- package/server/tests/InspectionSubmitterRulesTest.php +47 -0
- package/server/tests/ObserverContractsTest.php +1 -1
- package/server/tests/QueueJobContractsTest.php +3 -4
- package/server/tests/RadarRoutesTest.php +35 -0
- package/server/tests/ReportSchemaContractsTest.php +15 -1
- package/server/tests/RouteRegistrationExecutionTest.php +109 -18
- package/server/tests/Support/AfaqyTestCrypto.php +27 -0
- package/server/tests/Support/ExampleTelemetryProvider.php +82 -0
- package/server/tests/Support/TelemetryTestEnvironment.php +53 -0
- package/server/tests/TelematicsHardeningTest.php +17 -17
- package/server/tests/TrailerSupportCoverageTest.php +1 -1
- package/server/tests/Unit/Http/Resources/ManifestResourceTest.php +3 -3
- package/server/tests/Unit/Support/FuelProviderServiceMatchingTest.php +127 -0
- package/server/tests/Unit/Support/PetroAppFuelProviderTest.php +126 -1
- package/server/tests/Unit/Support/RadarAgendaTest.php +200 -0
- package/server/tests/Unit/Support/RadarBriefingTest.php +214 -0
- package/server/tests/Unit/Support/RadarItemStateTest.php +260 -0
- package/server/tests/Unit/Support/RadarRulesTest.php +523 -0
- package/server/tests/Unit/Support/Telematics/Providers/AfaqyProviderTest.php +9 -1
- package/server/tests/Unit/Support/Telematics/Providers/AfaqyProviderTransportTest.php +8 -0
- package/server/tests/Unit/Support/Telematics/Providers/AfaqyRealtimeContractTest.php +188 -0
- package/server/tests/Unit/Support/Telematics/TelematicServiceTelemetryTest.php +1 -0
- package/translations/ar-ae.yml +3 -1
- package/translations/bg-bg.yaml +3 -1
- package/translations/en-us.yaml +738 -15
- package/translations/es-pa.yaml +3 -1
- package/translations/fr-fr.yaml +3 -1
- package/translations/mn-mn.yaml +3 -1
- package/translations/pt-br.yaml +3 -1
- package/translations/ru-ru.yaml +3 -1
- package/translations/vi-vn.yaml +3 -1
- package/addon/components/cell/attached-vehicle.hbs +0 -10
- package/addon/components/cell/attached-vehicle.js +0 -58
- package/addon/components/cell/device-identity.js +0 -129
- package/addon/components/cell/driver-identity.js +0 -143
- package/addon/components/cell/driver-name.hbs +0 -26
- package/addon/components/cell/driver-name.js +0 -30
- package/addon/components/cell/equipment-identity.js +0 -48
- package/addon/components/cell/part-identity.js +0 -63
- package/addon/components/cell/telematic-device.hbs +0 -38
- package/addon/components/cell/telematic-device.js +0 -44
- package/addon/components/cell/telematic-provider.hbs +0 -33
- package/addon/components/cell/telematic-provider.js +0 -78
- package/addon/components/cell/vehicle-identity.js +0 -138
- package/addon/components/cell/vehicle-name.hbs +0 -23
- package/addon/components/cell/vehicle-name.js +0 -3
- package/addon/components/device/pill.js +0 -3
- package/addon/components/driver/pill.js +0 -7
- package/addon/components/equipment/pill.js +0 -3
- package/addon/components/filter/multi-model.hbs +0 -19
- package/addon/components/filter/multi-model.js +0 -90
- package/addon/components/order/pill.js +0 -3
- package/addon/components/trailer/pill.js +0 -3
- package/addon/components/vehicle/pill.js +0 -7
- package/addon/templates/connectivity/fuel-providers/details/settings.hbs +0 -11
|
@@ -38,6 +38,8 @@ class FleetOpsFuelServiceMatchingProbe extends FuelProviderService
|
|
|
38
38
|
|
|
39
39
|
function fleetopsFuelServiceMatchingBoot(): SQLiteConnection
|
|
40
40
|
{
|
|
41
|
+
EloquentModel::setEventDispatcher(new Illuminate\Events\Dispatcher(app()));
|
|
42
|
+
EloquentModel::clearBootedModels();
|
|
41
43
|
$pdo = new PDO('sqlite::memory:');
|
|
42
44
|
// SQLite lacks the MySQL spatial functions used by the fuel report
|
|
43
45
|
// location cast; a passthrough keeps the WKT string intact.
|
|
@@ -91,6 +93,13 @@ function fleetopsFuelServiceMatchingBoot(): SQLiteConnection
|
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
95
|
|
|
96
|
+
// Exercise real UUID assignment without unrelated HTTP-cache observers.
|
|
97
|
+
foreach ([FuelProviderTransaction::class, Fleetbase\FleetOps\Models\FuelReport::class, Fleetbase\FleetOps\Models\FuelProviderSyncRun::class] as $modelClass) {
|
|
98
|
+
new $modelClass();
|
|
99
|
+
$modelClass::flushEventListeners();
|
|
100
|
+
$modelClass::bootHasUuid();
|
|
101
|
+
}
|
|
102
|
+
|
|
94
103
|
session(['company' => 'company-1']);
|
|
95
104
|
FleetOpsFuelServiceMatchingRecorder::$events = [];
|
|
96
105
|
|
|
@@ -177,8 +186,12 @@ test('match vehicle and match order resolve string identifiers', function () {
|
|
|
177
186
|
$matched = $service->matchVehicle($transaction, 'vehicle_test');
|
|
178
187
|
expect($matched->vehicle_uuid)->toBe('vehicle-1')
|
|
179
188
|
->and($matched->sync_status)->toBe('matched')
|
|
189
|
+
->and($matched->fuel_report_uuid)->not->toBeNull()
|
|
180
190
|
->and($connection->table('fuel_reports')->count())->toBe(1);
|
|
181
191
|
|
|
192
|
+
$service->matchVehicle($matched, 'vehicle_test');
|
|
193
|
+
expect($connection->table('fuel_reports')->count())->toBe(1);
|
|
194
|
+
|
|
182
195
|
$withOrder = $service->matchOrder($matched, 'order_test');
|
|
183
196
|
expect($withOrder->order_uuid)->toBe('order-1');
|
|
184
197
|
});
|
|
@@ -278,3 +291,117 @@ test('ensure fuel report reuses existing reports and skips vehicleless transacti
|
|
|
278
291
|
expect($report)->not->toBeNull()
|
|
279
292
|
->and($connection->table('fuel_reports')->where('uuid', $report->uuid)->value('location'))->toBe('POINT(103.85 1.29)');
|
|
280
293
|
});
|
|
294
|
+
|
|
295
|
+
test('reimport updates a transaction without duplicating its report and preserves ignored review', function () {
|
|
296
|
+
$db = fleetopsFuelServiceMatchingBoot();
|
|
297
|
+
$connection = fleetopsFuelServiceMatchingConnection($db);
|
|
298
|
+
$db->table('vehicles')->insert(['uuid' => 'vehicle-1', 'company_uuid' => 'company-1', 'plate_number' => 'SGX-1234']);
|
|
299
|
+
$service = fleetopsFuelServiceMatchingService();
|
|
300
|
+
$payload = ['provider_transaction_id' => 'repeat-1', 'plate_number' => 'SGX-1234', 'amount' => 1250, 'currency' => 'SAR', 'volume' => 5];
|
|
301
|
+
$first = $service->ingestTransaction($connection, $payload);
|
|
302
|
+
$second = $service->ingestTransaction($connection, $payload);
|
|
303
|
+
expect($first->wasRecentlyCreated)->toBeTrue()
|
|
304
|
+
->and($second->wasRecentlyCreated)->toBeFalse()
|
|
305
|
+
->and($db->table('fuel_provider_transactions')->count())->toBe(1)
|
|
306
|
+
->and($db->table('fuel_reports')->count())->toBe(1)
|
|
307
|
+
->and($second->fuel_report_uuid)->toBe($first->fuel_report_uuid);
|
|
308
|
+
$service->reviewTransaction($second, 'ignored');
|
|
309
|
+
expect($service->ingestTransaction($connection, $payload)->sync_status)->toBe('ignored');
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
test('sandbox and production connections cannot overwrite one another’s provider transactions', function () {
|
|
313
|
+
$db = fleetopsFuelServiceMatchingBoot();
|
|
314
|
+
$first = fleetopsFuelServiceMatchingConnection($db);
|
|
315
|
+
$second = clone $first;
|
|
316
|
+
$second->uuid = 'production-connection';
|
|
317
|
+
$service = fleetopsFuelServiceMatchingService();
|
|
318
|
+
$payload = ['provider_transaction_id' => 'shared-bill-id', 'amount' => 1000, 'currency' => 'SAR'];
|
|
319
|
+
$sandbox = $service->ingestTransaction($first, $payload);
|
|
320
|
+
$production = $service->ingestTransaction($second, $payload);
|
|
321
|
+
expect($sandbox->uuid)->not->toBe($production->uuid)
|
|
322
|
+
->and($db->table('fuel_provider_transactions')->count())->toBe(2)
|
|
323
|
+
->and($sandbox->fuel_provider_connection_uuid)->toBe($first->uuid)
|
|
324
|
+
->and($production->fuel_provider_connection_uuid)->toBe($second->uuid);
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
test('empty matching rules disable automatic matching', function () {
|
|
328
|
+
$db = fleetopsFuelServiceMatchingBoot();
|
|
329
|
+
$connection = fleetopsFuelServiceMatchingConnection($db);
|
|
330
|
+
$connection->sync_settings = ['matching_order' => []];
|
|
331
|
+
$db->table('vehicles')->insert(['uuid' => 'vehicle-1', 'company_uuid' => 'company-1', 'plate_number' => 'SGX-1234']);
|
|
332
|
+
$transaction = fleetopsFuelServiceMatchingService()->ingestTransaction($connection, ['provider_transaction_id' => 'manual-only', 'plate_number' => 'SGX-1234']);
|
|
333
|
+
expect($transaction->sync_status)->toBe('unmatched')->and($transaction->vehicle_uuid)->toBeNull();
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
test('sync windows retain the configured lookback after empty runs and reject reversed dates', function () {
|
|
337
|
+
$db = fleetopsFuelServiceMatchingBoot();
|
|
338
|
+
$connection = fleetopsFuelServiceMatchingConnection($db);
|
|
339
|
+
$connection->sync_settings = ['window_days' => 7];
|
|
340
|
+
$connection->last_synced_at = now();
|
|
341
|
+
$service = fleetopsFuelServiceMatchingService();
|
|
342
|
+
[$from, $to] = $service->syncWindow($connection);
|
|
343
|
+
expect($from->toDateString())->toBe(now()->subDays(7)->toDateString())->and($to->toDateString())->toBe(now()->toDateString());
|
|
344
|
+
expect(fn () => $service->syncWindow($connection, now(), now()->subDay()))->toThrow(InvalidArgumentException::class);
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
test('ambiguous vehicle identifiers require manual matching', function () {
|
|
348
|
+
$db = fleetopsFuelServiceMatchingBoot();
|
|
349
|
+
$connection = fleetopsFuelServiceMatchingConnection($db, ['sync_settings' => json_encode(['matching_order' => ['plate_number']])]);
|
|
350
|
+
$db->table('vehicles')->insert([
|
|
351
|
+
['uuid' => 'vehicle-1', 'company_uuid' => 'company-1', 'plate_number' => 'ABC 1234'],
|
|
352
|
+
['uuid' => 'vehicle-2', 'company_uuid' => 'company-1', 'plate_number' => 'ABC-1234'],
|
|
353
|
+
]);
|
|
354
|
+
$transaction = fleetopsFuelServiceMatchingService()->ingestTransaction($connection, ['provider_transaction_id' => 'ambiguous', 'plate_number' => 'ABC 1234']);
|
|
355
|
+
expect($transaction->sync_status)->toBe('unmatched')
|
|
356
|
+
->and($transaction->vehicle_uuid)->toBeNull()
|
|
357
|
+
->and($db->table('fuel_reports')->count())->toBe(0);
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
test('activity reports persisted totals and isolates the company and connection', function () {
|
|
361
|
+
$db = fleetopsFuelServiceMatchingBoot();
|
|
362
|
+
$connection = fleetopsFuelServiceMatchingConnection($db);
|
|
363
|
+
foreach ([['conn-1', 'company-1', 300], ['conn-2', 'company-1', 900], ['conn-3', 'company-2', 500]] as [$id, $company, $amount]) {
|
|
364
|
+
$db->table('fuel_provider_transactions')->insert(['uuid' => 'txn-' . $id, 'fuel_provider_connection_uuid' => $id, 'company_uuid' => $company, 'sync_status' => 'unmatched', 'amount' => $amount, 'currency' => 'SAR', 'volume' => 4]);
|
|
365
|
+
}
|
|
366
|
+
$controller = new Fleetbase\FleetOps\Http\Controllers\Internal\v1\FuelProviderConnectionController(fleetopsFuelServiceMatchingService());
|
|
367
|
+
$activity = $controller->activity(new Illuminate\Http\Request(), 'conn-1')->getData(true);
|
|
368
|
+
expect($activity['totals'])->toMatchArray(['transactions' => 1, 'unmatched' => 1, 'liters' => 4, 'fuel_reports' => 0])
|
|
369
|
+
->and($activity['totals']['spend'])->toBe([['currency' => 'SAR', 'amount' => 300]])
|
|
370
|
+
->and($activity['connection'])->not->toHaveKey('credentials');
|
|
371
|
+
session(['company' => 'company-2']);
|
|
372
|
+
expect(fn () => $controller->activity(new Illuminate\Http\Request(), 'conn-1'))->toThrow(Illuminate\Database\Eloquent\ModelNotFoundException::class);
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
test('terminal worker failures mark a sync failed without destroying its last successful summary', function () {
|
|
376
|
+
$db = fleetopsFuelServiceMatchingBoot();
|
|
377
|
+
$db->getSchemaBuilder()->table('fuel_provider_connections', function ($table) {
|
|
378
|
+
$table->text('last_error')->nullable();
|
|
379
|
+
$table->text('last_sync_state')->nullable();
|
|
380
|
+
});
|
|
381
|
+
$db->getSchemaBuilder()->table('fuel_provider_sync_runs', function ($table) { $table->timestamp('finished_at')->nullable(); });
|
|
382
|
+
fleetopsFuelServiceMatchingConnection($db, ['last_sync_state' => json_encode(['summary' => ['imported' => 1]])]);
|
|
383
|
+
$db->table('fuel_provider_sync_runs')->insert(['uuid' => 'run-1', 'fuel_provider_connection_uuid' => 'conn-1', 'status' => 'running']);
|
|
384
|
+
$job = new Fleetbase\FleetOps\Jobs\SyncFuelProviderTransactionsJob('conn-1', syncRunUuid: 'run-1');
|
|
385
|
+
$job->failed(new RuntimeException('worker stopped'));
|
|
386
|
+
expect($db->table('fuel_provider_sync_runs')->value('status'))->toBe('error')
|
|
387
|
+
->and($db->table('fuel_provider_sync_runs')->value('finished_at'))->not->toBeNull()
|
|
388
|
+
->and(FuelProviderConnection::where('uuid', 'conn-1')->first()->last_sync_state)->toBe(['summary' => ['imported' => 1]]);
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
test('ingestion persists the report returned by a custom report resolution strategy', function () {
|
|
392
|
+
$db = fleetopsFuelServiceMatchingBoot();
|
|
393
|
+
$connection = fleetopsFuelServiceMatchingConnection($db);
|
|
394
|
+
$db->table('vehicles')->insert(['uuid' => 'vehicle-1', 'company_uuid' => 'company-1', 'plate_number' => 'SGX-1234']);
|
|
395
|
+
$db->table('fuel_reports')->insert(['uuid' => 'existing-report', 'company_uuid' => 'company-1', 'vehicle_uuid' => 'vehicle-1']);
|
|
396
|
+
$service = new class(new FuelProviderRegistry()) extends FleetOpsFuelServiceMatchingProbe {
|
|
397
|
+
protected function ensureFuelReport(FuelProviderTransaction $transaction): ?Fleetbase\FleetOps\Models\FuelReport
|
|
398
|
+
{
|
|
399
|
+
return Fleetbase\FleetOps\Models\FuelReport::where('company_uuid', $transaction->company_uuid)->where('vehicle_uuid', $transaction->vehicle_uuid)->firstOrFail();
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
$transaction = $service->ingestTransaction($connection, ['provider_transaction_id' => 'existing-report-transaction', 'plate_number' => 'SGX-1234']);
|
|
403
|
+
expect($transaction->sync_status)->toBe('matched');
|
|
404
|
+
expect($transaction->fuel_report_uuid)->toBe('existing-report');
|
|
405
|
+
expect($db->table('fuel_provider_transactions')->value('fuel_report_uuid'))->toBe('existing-report');
|
|
406
|
+
expect($db->table('fuel_reports')->count())->toBe(1);
|
|
407
|
+
});
|
|
@@ -38,7 +38,7 @@ function fleetopsPetroAppConnection(array $credentials = []): FuelProviderConnec
|
|
|
38
38
|
test('test connection reports success failure and exceptions', function () {
|
|
39
39
|
fleetopsPetroAppFreshHttp();
|
|
40
40
|
Http::fake([
|
|
41
|
-
'https://petroapp.test/webservice/vehicles*' => Http::response(['data' => ['total' => 12]], 200),
|
|
41
|
+
'https://petroapp.test/webservice/vehicles*' => Http::response(['data' => ['total' => 12, 'data' => []]], 200),
|
|
42
42
|
]);
|
|
43
43
|
|
|
44
44
|
$provider = new PetroAppFuelProvider();
|
|
@@ -163,3 +163,128 @@ test('provider identity and header variants resolve correctly', function () {
|
|
|
163
163
|
|
|
164
164
|
expect($probe->exposeBaseUrl(fleetopsPetroAppConnection()))->toBe('https://petroapp.test/webservice');
|
|
165
165
|
});
|
|
166
|
+
|
|
167
|
+
test('environment selects the endpoint for connection tests and imports', function (string $environment, string $baseUrl) {
|
|
168
|
+
fleetopsPetroAppFreshHttp();
|
|
169
|
+
Http::preventStrayRequests();
|
|
170
|
+
Http::fake([
|
|
171
|
+
$baseUrl . '/vehicles*' => Http::response(['success' => true, 'data' => ['data' => [], 'meta' => ['total' => 123]]]),
|
|
172
|
+
$baseUrl . '/bills*' => Http::response(['success' => true, 'data' => ['data' => []]]),
|
|
173
|
+
]);
|
|
174
|
+
$connection = fleetopsPetroAppConnection(['base_url' => ' ', 'auth_type' => 'ws_sk_header']);
|
|
175
|
+
$connection->environment = $environment;
|
|
176
|
+
$provider = new PetroAppFuelProvider();
|
|
177
|
+
|
|
178
|
+
expect($provider->testConnection($connection))
|
|
179
|
+
->toMatchArray(['success' => true]);
|
|
180
|
+
expect($provider->testConnection($connection)['metadata'])->toMatchArray(['total_vehicles' => 123, 'environment' => $environment, 'auth_type' => 'ws_sk_header']);
|
|
181
|
+
expect($provider->listTransactions($connection, Carbon::parse('2026-09-08'), Carbon::parse('2026-09-15')))->toBeEmpty();
|
|
182
|
+
Http::assertSent(fn ($request) => $request->url() === $baseUrl . '/vehicles?page=1'
|
|
183
|
+
&& $request->hasHeader('WS-SK', 'token-123') && !$request->hasHeader('Authorization'));
|
|
184
|
+
Http::assertSent(fn ($request) => str_starts_with($request->url(), $baseUrl . '/bills?')
|
|
185
|
+
&& $request['from'] === '2026-09-08' && $request['to'] === '2026-09-15' && $request['lang'] === 'en');
|
|
186
|
+
})->with([
|
|
187
|
+
['sandbox', 'https://app-public.staging.petroapp.app/webservice'],
|
|
188
|
+
['production', 'https://app.petroapp.com.sa/webservice'],
|
|
189
|
+
]);
|
|
190
|
+
|
|
191
|
+
test('HTTP 200 provider errors and malformed payloads fail tests and imports', function ($payload) {
|
|
192
|
+
fleetopsPetroAppFreshHttp();
|
|
193
|
+
Http::fake(['*' => Http::response($payload, 200)]);
|
|
194
|
+
$provider = new PetroAppFuelProvider();
|
|
195
|
+
$connection = fleetopsPetroAppConnection();
|
|
196
|
+
|
|
197
|
+
expect($provider->testConnection($connection)['success'])->toBeFalse();
|
|
198
|
+
expect(fn () => $provider->listTransactions($connection, Carbon::now()->subDay(), Carbon::now()))->toThrow(RuntimeException::class);
|
|
199
|
+
})->with([
|
|
200
|
+
'missing secret' => [['status' => false, 'message' => 'Secret key is not found']],
|
|
201
|
+
'invalid bearer' => [['success' => false, 'message' => 'Unauthenticated.', 'data' => null]],
|
|
202
|
+
'false with data' => [['success' => false, 'data' => ['data' => []]]],
|
|
203
|
+
'numeric status' => [['status' => 0, 'data' => ['data' => []]]],
|
|
204
|
+
'HTML' => ['<html>Login</html>'],
|
|
205
|
+
'missing data' => [['message' => 'Secret key is not found']],
|
|
206
|
+
]);
|
|
207
|
+
|
|
208
|
+
test('vehicle resource pagination follows meta and links without following insecure URLs', function () {
|
|
209
|
+
fleetopsPetroAppFreshHttp();
|
|
210
|
+
Http::preventStrayRequests();
|
|
211
|
+
Http::fake([
|
|
212
|
+
'https://petroapp.test/webservice/vehicles?page=1' => Http::response([
|
|
213
|
+
'success' => true,
|
|
214
|
+
'data' => ['data' => [['vehicle_id' => 1]], 'meta' => ['last_page' => 2], 'links' => ['next' => 'http://petroapp.test/webservice/vehicles?page=2']],
|
|
215
|
+
]),
|
|
216
|
+
'https://petroapp.test/webservice/vehicles?page=2' => Http::response([
|
|
217
|
+
'success' => true,
|
|
218
|
+
'data' => ['data' => [['vehicle_id' => 2]], 'meta' => ['last_page' => 2], 'links' => ['next' => null]],
|
|
219
|
+
]),
|
|
220
|
+
]);
|
|
221
|
+
|
|
222
|
+
expect((new PetroAppFuelProvider())->listVehicles(fleetopsPetroAppConnection())->pluck('vehicle_id')->all())->toBe([1, 2]);
|
|
223
|
+
Http::assertSentCount(2);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
test('legacy token-only forms retry WS-SK only when PetroApp requests the missing secret key', function () {
|
|
227
|
+
fleetopsPetroAppFreshHttp();
|
|
228
|
+
Http::preventStrayRequests();
|
|
229
|
+
Http::fake(function ($request) {
|
|
230
|
+
if ($request->hasHeader('WS-SK', 'token-123')) {
|
|
231
|
+
expect($request->hasHeader('Authorization'))->toBeFalse();
|
|
232
|
+
|
|
233
|
+
return Http::response(['success' => true, 'data' => ['data' => [['id' => 1]], 'total' => 1]]);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
expect($request->hasHeader('Authorization', 'Bearer token-123'))->toBeTrue();
|
|
237
|
+
|
|
238
|
+
return Http::response(['status' => false, 'message' => 'Secret key is not found']);
|
|
239
|
+
});
|
|
240
|
+
$connection = fleetopsPetroAppConnection(['api_token' => " token-123\n"]);
|
|
241
|
+
$provider = new PetroAppFuelProvider();
|
|
242
|
+
$result = $provider->testConnection($connection);
|
|
243
|
+
expect($result['success'])->toBeTrue()
|
|
244
|
+
->and($result['metadata']['auth_type'])->toBe('ws_sk_header')
|
|
245
|
+
->and(data_get($connection->credentials, 'auth_type'))->toBeNull();
|
|
246
|
+
expect($provider->listVehicles($connection))->toHaveCount(1);
|
|
247
|
+
Http::assertSentCount(4);
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
test('explicit authentication is never changed after a missing secret error', function (string $authType) {
|
|
251
|
+
fleetopsPetroAppFreshHttp();
|
|
252
|
+
Http::fake(['*' => Http::response(['status' => false, 'message' => 'Secret key is not found'])]);
|
|
253
|
+
$result = (new PetroAppFuelProvider())->testConnection(fleetopsPetroAppConnection(['auth_type' => $authType]));
|
|
254
|
+
expect($result['success'])->toBeFalse()->and($result['metadata']['auth_type'])->toBe($authType);
|
|
255
|
+
Http::assertSentCount(1);
|
|
256
|
+
})->with(['bearer_token', 'ws_sk_header']);
|
|
257
|
+
|
|
258
|
+
test('working legacy bearer tokens are not retried', function () {
|
|
259
|
+
fleetopsPetroAppFreshHttp();
|
|
260
|
+
Http::fake(['*' => Http::response(['success' => true, 'data' => ['data' => [], 'total' => 0]])]);
|
|
261
|
+
$result = (new PetroAppFuelProvider())->testConnection(fleetopsPetroAppConnection());
|
|
262
|
+
expect($result['success'])->toBeTrue()->and($result['metadata']['auth_type'])->toBe('bearer_token');
|
|
263
|
+
Http::assertSentCount(1);
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
test('PetroApp bill numbers remain stable when a bill is corrected and split plates are combined', function () {
|
|
267
|
+
$provider = new class extends PetroAppFuelProvider {
|
|
268
|
+
public function normalize(array $bill): array
|
|
269
|
+
{
|
|
270
|
+
return $this->normalizeBill($bill);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
$bill = ['bill_number' => 32549086, 'plate_letter' => 'ABC', 'plate_snum' => '1234', 'cost' => '3.00', 'num_of_liters' => '4'];
|
|
274
|
+
$original = $provider->normalize($bill);
|
|
275
|
+
$corrected = $provider->normalize(array_merge($bill, ['cost' => '4.50']));
|
|
276
|
+
expect($original['provider_transaction_id'])->toBe('32549086')
|
|
277
|
+
->and($corrected['provider_transaction_id'])->toBe($original['provider_transaction_id'])
|
|
278
|
+
->and($original['plate_number'])->toBe('ABC 1234')
|
|
279
|
+
->and($corrected['amount'])->toBe(450)
|
|
280
|
+
->and($provider->normalize(array_merge($bill, ['plate_snum' => 'ABC 1234']))['plate_number'])->toBe('ABC 1234');
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
test('pagination limits fail visibly instead of returning a silently incomplete import', function () {
|
|
284
|
+
fleetopsPetroAppFreshHttp();
|
|
285
|
+
Http::preventStrayRequests();
|
|
286
|
+
Http::fake(['*' => Http::response(['success' => true, 'data' => ['data' => [['bill_number' => 1]], 'last_page' => 3]])]);
|
|
287
|
+
expect(fn () => (new PetroAppFuelProvider())->listTransactions(fleetopsPetroAppConnection(), Carbon::parse('2026-06-23'), Carbon::parse('2026-06-23'), ['max_pages' => 1]))
|
|
288
|
+
->toThrow(RuntimeException::class, 'Choose a shorter date range');
|
|
289
|
+
Http::assertSentCount(1);
|
|
290
|
+
});
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Fleetbase\FleetOps\Support\Radar\RadarAgenda;
|
|
4
|
+
use Illuminate\Support\Carbon;
|
|
5
|
+
|
|
6
|
+
function fleetOpsAgendaNow(): Carbon
|
|
7
|
+
{
|
|
8
|
+
return Carbon::parse('2026-09-15 08:35:00', 'UTC');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function fleetOpsAgendaItem(string $key, array $extra = []): array
|
|
12
|
+
{
|
|
13
|
+
[$rule] = explode(':', $key);
|
|
14
|
+
|
|
15
|
+
return array_merge([
|
|
16
|
+
'key' => $key,
|
|
17
|
+
'rule' => $rule,
|
|
18
|
+
'category' => 'maintenance',
|
|
19
|
+
'lane' => 'maintenance',
|
|
20
|
+
'chip' => 'Maint',
|
|
21
|
+
'severity' => 'warning',
|
|
22
|
+
'title' => $key,
|
|
23
|
+
'subject' => null,
|
|
24
|
+
'due_at' => null,
|
|
25
|
+
'due_bucket' => 'none',
|
|
26
|
+
'window' => null,
|
|
27
|
+
'state' => ['status' => 'open'],
|
|
28
|
+
'actions' => [],
|
|
29
|
+
'record' => null,
|
|
30
|
+
], $extra);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function fleetOpsAgendaDriver(string $name, array $extra = []): array
|
|
34
|
+
{
|
|
35
|
+
$slug = strtolower(str_replace(' ', '', $name));
|
|
36
|
+
|
|
37
|
+
return array_merge(['type' => 'driver', 'uuid' => 'driver-' . $slug, 'public_id' => 'driver_' . $slug, 'label' => $name, 'photo_url' => null], $extra);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
afterEach(fn () => Carbon::setTestNow());
|
|
41
|
+
|
|
42
|
+
test('items land in the overdue band, a lane, the later rail or the anytime tray', function () {
|
|
43
|
+
$now = fleetOpsAgendaNow();
|
|
44
|
+
$items = [
|
|
45
|
+
fleetOpsAgendaItem('maintenance_overdue:a', ['due_at' => '2026-09-12T08:00:00+00:00', 'due_bucket' => 'overdue']),
|
|
46
|
+
fleetOpsAgendaItem('maintenance_due_soon:b', ['due_at' => '2026-09-15T14:00:00+00:00', 'due_bucket' => 'today']),
|
|
47
|
+
fleetOpsAgendaItem('license_expiring:c', ['category' => 'compliance', 'lane' => 'expiries', 'due_at' => '2026-09-21T00:00:00+00:00', 'due_bucket' => 'week']),
|
|
48
|
+
fleetOpsAgendaItem('notice:d', ['category' => 'notices', 'lane' => 'notices', 'due_at' => '2026-09-16T06:00:00+00:00', 'due_bucket' => 'later']),
|
|
49
|
+
fleetOpsAgendaItem('issue_open:e', ['category' => 'issues', 'lane' => 'anytime']),
|
|
50
|
+
fleetOpsAgendaItem('part_low_stock:f', ['category' => 'parts', 'lane' => 'anytime', 'state' => ['status' => 'open', 'planned_at' => '2026-09-15T16:00:00+00:00']]),
|
|
51
|
+
fleetOpsAgendaItem('fuel_unmatched:g', ['category' => 'fuel', 'lane' => 'anytime', 'state' => ['status' => 'snoozed', 'snoozed_until' => '2026-09-18T08:00:00+00:00']]),
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
$day = RadarAgenda::build($items, [], '24h', $now);
|
|
55
|
+
|
|
56
|
+
expect($day['window']['key'])->toBe('24h')
|
|
57
|
+
->and($day['window']['start_at'])->toBe('2026-09-15T08:00:00+00:00')
|
|
58
|
+
->and($day['window']['end_at'])->toBe('2026-09-16T08:00:00+00:00')
|
|
59
|
+
->and($day['window']['now_pct'])->toBe(2.43)
|
|
60
|
+
->and(array_column($day['window']['ticks'], 'label'))->toBe(['08', '10', '12', '14', '16', '18', '20', '22', '00', '02', '04', '06', '08'])
|
|
61
|
+
->and(array_column($day['overdue'], 'key'))->toBe(['maintenance_overdue:a'])
|
|
62
|
+
->and(array_column($day['lanes']['maintenance'], 'key'))->toBe(['maintenance_due_soon:b', 'part_low_stock:f'])
|
|
63
|
+
->and($day['lanes']['maintenance'][0]['pct'])->toBe(25.0)
|
|
64
|
+
->and($day['lanes']['maintenance'][0]['label'])->toBe('14:00')
|
|
65
|
+
->and($day['lanes']['maintenance'][1]['planned'])->toBeTrue()
|
|
66
|
+
->and(array_column($day['lanes']['notices'], 'key'))->toBe(['notice:d'])
|
|
67
|
+
->and(array_column($day['later'], 'key'))->toBe(['license_expiring:c'])
|
|
68
|
+
->and(array_column($day['anytime'], 'key'))->toBe(['issue_open:e'], 'snoozed items are not on the agenda')
|
|
69
|
+
->and($day['counts'])->toBe(['overdue' => 1, 'later' => 1, 'anytime' => 1, 'shifts' => 0]);
|
|
70
|
+
|
|
71
|
+
$week = RadarAgenda::build($items, [], '7d', $now);
|
|
72
|
+
expect($week['window']['hours'])->toBe(168)
|
|
73
|
+
->and(array_column($week['lanes']['expiries'], 'key'))->toBe(['license_expiring:c'], 'the 7-day window absorbs the later rail')
|
|
74
|
+
->and($week['later'])->toBe([])
|
|
75
|
+
->and($week['window']['ticks'][1]['label'])->toBe('Wed 16');
|
|
76
|
+
|
|
77
|
+
expect(RadarAgenda::build($items, [], 'bogus', $now)['window']['key'])->toBe('24h');
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('every live shift is a bar on the shifts lane carrying its gaps and handover', function () {
|
|
81
|
+
$now = fleetOpsAgendaNow();
|
|
82
|
+
$ortega = fleetOpsAgendaDriver('Luis Ortega');
|
|
83
|
+
$diallo = fleetOpsAgendaDriver('Amara Diallo');
|
|
84
|
+
$items = [
|
|
85
|
+
fleetOpsAgendaItem('shift_handover:driver_luisortega', ['category' => 'staffing', 'lane' => 'shifts', 'subject' => $ortega, 'window' => ['start_at' => '2026-09-15T01:15:00+00:00', 'end_at' => '2026-09-15T09:15:00+00:00'], 'due_at' => '2026-09-15T09:15:00+00:00', 'due_bucket' => 'today', 'source' => ['active_orders' => 2]]),
|
|
86
|
+
fleetOpsAgendaItem('shift_late_start:driver_amaradiallo', ['category' => 'staffing', 'lane' => 'shifts', 'severity' => 'critical', 'subject' => $diallo, 'window' => ['start_at' => '2026-09-15T08:00:00+00:00', 'end_at' => '2026-09-15T16:00:00+00:00']]),
|
|
87
|
+
];
|
|
88
|
+
$shifts = [
|
|
89
|
+
['uuid' => 'sh1', 'public_id' => 'shift_1', 'start_at' => '2026-09-15 01:15:00', 'end_at' => '2026-09-15 09:15:00', 'status' => 'in_progress', 'driver' => $ortega, 'driver_online' => true, 'active_orders' => 2],
|
|
90
|
+
['uuid' => 'sh2', 'public_id' => 'shift_2', 'start_at' => '2026-09-15 08:00:00', 'end_at' => '2026-09-15 16:00:00', 'status' => 'scheduled', 'driver' => $diallo, 'driver_online' => false, 'active_orders' => 0],
|
|
91
|
+
['uuid' => 'sh3', 'public_id' => 'shift_3', 'start_at' => '2026-09-15 14:00:00', 'end_at' => '2026-09-15 21:00:00', 'status' => 'scheduled', 'driver' => fleetOpsAgendaDriver('Tomas Alves'), 'driver_online' => false, 'active_orders' => 0],
|
|
92
|
+
['uuid' => 'sh4', 'public_id' => 'shift_4', 'start_at' => '2026-09-17 06:00:00', 'end_at' => '2026-09-17 14:00:00', 'status' => 'scheduled', 'driver' => fleetOpsAgendaDriver('Far Away'), 'driver_online' => false, 'active_orders' => 0],
|
|
93
|
+
['uuid' => 'sh5', 'public_id' => 'shift_5', 'start_at' => '2026-09-14 20:00:00', 'end_at' => '2026-09-15 04:00:00', 'status' => 'completed', 'driver' => fleetOpsAgendaDriver('Night Done'), 'driver_online' => false, 'active_orders' => 0],
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
$day = RadarAgenda::build($items, $shifts, '24h', $now);
|
|
97
|
+
$lane = collect($day['lanes']['shifts']);
|
|
98
|
+
$bars = $lane->where('kind', 'shift')->keyBy('key');
|
|
99
|
+
|
|
100
|
+
expect($bars->keys()->all())->toBe(['shift:shift_1', 'shift:shift_2', 'shift:shift_3'])
|
|
101
|
+
->and($bars['shift:shift_1']['state'])->toBe('on_shift')
|
|
102
|
+
->and($bars['shift:shift_1']['pct'])->toBe(0.0)
|
|
103
|
+
->and($bars['shift:shift_1']['width_pct'])->toBe(5.21)
|
|
104
|
+
->and($bars['shift:shift_1']['handover_key'])->toBe('shift_handover:driver_luisortega')
|
|
105
|
+
->and($bars['shift:shift_1']['gap_keys'])->toBe(['shift_handover:driver_luisortega'])
|
|
106
|
+
->and($bars['shift:shift_2']['state'])->toBe('not_online')
|
|
107
|
+
->and($bars['shift:shift_2']['severity'])->toBe('critical')
|
|
108
|
+
->and($bars['shift:shift_3']['state'])->toBe('upcoming')
|
|
109
|
+
->and($bars['shift:shift_3']['pct'])->toBe(25.0)
|
|
110
|
+
->and($bars['shift:shift_3']['label'])->toBe('14:00–21:00')
|
|
111
|
+
->and($lane->where('kind', 'item')->pluck('key')->all())->toBe(['shift_late_start:driver_amaradiallo', 'shift_handover:driver_luisortega'], 'a live gap sits at the now line, ahead of the 09:15 handover')
|
|
112
|
+
->and($day['counts']['shifts'])->toBe(5);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('a handover card lists the orders and suggests the nearest on-shift driver with capacity', function () {
|
|
116
|
+
$now = fleetOpsAgendaNow();
|
|
117
|
+
$ortega = fleetOpsAgendaDriver('Luis Ortega');
|
|
118
|
+
$alves = fleetOpsAgendaDriver('Tomas Alves');
|
|
119
|
+
$kim = fleetOpsAgendaDriver('Rin Kim');
|
|
120
|
+
$full = fleetOpsAgendaDriver('Full Driver');
|
|
121
|
+
$early = fleetOpsAgendaDriver('Ends Early');
|
|
122
|
+
$items = [
|
|
123
|
+
fleetOpsAgendaItem('shift_handover:driver_luisortega', ['category' => 'staffing', 'lane' => 'shifts', 'subject' => $ortega, 'window' => ['start_at' => '2026-09-15T01:15:00+00:00', 'end_at' => '2026-09-15T09:15:00+00:00'], 'due_at' => '2026-09-15T09:15:00+00:00', 'due_bucket' => 'today', 'source' => ['active_orders' => 2], 'record' => ['route' => 'management.drivers.index.details', 'model' => 'driver_luisortega']]),
|
|
124
|
+
];
|
|
125
|
+
$shifts = [
|
|
126
|
+
['uuid' => 'sh1', 'start_at' => '2026-09-15 01:15:00', 'end_at' => '2026-09-15 09:15:00', 'status' => 'in_progress', 'driver' => $ortega, 'driver_online' => true],
|
|
127
|
+
['uuid' => 'sh2', 'start_at' => '2026-09-15 06:00:00', 'end_at' => '2026-09-15 21:00:00', 'status' => 'in_progress', 'driver' => $alves, 'driver_online' => true],
|
|
128
|
+
['uuid' => 'sh3', 'start_at' => '2026-09-15 06:00:00', 'end_at' => '2026-09-15 18:00:00', 'status' => 'in_progress', 'driver' => $kim, 'driver_online' => true],
|
|
129
|
+
['uuid' => 'sh4', 'start_at' => '2026-09-15 06:00:00', 'end_at' => '2026-09-15 18:00:00', 'status' => 'in_progress', 'driver' => $full, 'driver_online' => true],
|
|
130
|
+
['uuid' => 'sh5', 'start_at' => '2026-09-15 06:00:00', 'end_at' => '2026-09-15 10:00:00', 'status' => 'in_progress', 'driver' => $early, 'driver_online' => true],
|
|
131
|
+
];
|
|
132
|
+
$drivers = [
|
|
133
|
+
['uuid' => 'driver-luisortega', 'location' => ['lat' => 40.70, 'lng' => -73.99], 'active_orders' => 2],
|
|
134
|
+
['uuid' => 'driver-tomasalves', 'location' => ['lat' => 40.71, 'lng' => -73.98], 'active_orders' => 2, 'max_daily_orders' => 6],
|
|
135
|
+
['uuid' => 'driver-rinkim', 'location' => ['lat' => 40.80, 'lng' => -73.90], 'active_orders' => 0],
|
|
136
|
+
['uuid' => 'driver-fulldriver', 'location' => ['lat' => 40.70, 'lng' => -73.99], 'active_orders' => 6],
|
|
137
|
+
['uuid' => 'driver-endsearly', 'location' => ['lat' => 40.70, 'lng' => -73.99], 'active_orders' => 0],
|
|
138
|
+
];
|
|
139
|
+
$orders = [
|
|
140
|
+
'driver-luisortega' => [
|
|
141
|
+
['uuid' => 'o1', 'public_id' => 'order_88412', 'status' => 'dispatched', 'destination' => 'Bay Ridge', 'ends_at' => '2026-09-15T09:40:00+00:00'],
|
|
142
|
+
['uuid' => 'o2', 'public_id' => 'order_88431', 'status' => 'dispatched', 'destination' => 'Sunset Park', 'ends_at' => '2026-09-15T08:50:00+00:00'],
|
|
143
|
+
],
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
$cards = RadarAgenda::handovers($items, $shifts, $drivers, $orders, $now);
|
|
147
|
+
|
|
148
|
+
expect($cards)->toHaveCount(1)
|
|
149
|
+
->and($cards[0]['key'])->toBe('shift_handover:driver_luisortega')
|
|
150
|
+
->and($cards[0]['shift']['minutes_left'])->toBe(40)
|
|
151
|
+
->and($cards[0]['rule'])->toBe('shift_handover')
|
|
152
|
+
->and(array_column($cards[0]['orders'], 'finishes_after_shift'))->toBe([true, false])
|
|
153
|
+
->and($cards[0]['orders'][0]['destination'])->toBe('Bay Ridge')
|
|
154
|
+
->and($cards[0]['suggested']['driver']['label'])->toBe('Tomas Alves')
|
|
155
|
+
->and($cards[0]['suggested']['distance_km'])->toBe(1.4)
|
|
156
|
+
->and($cards[0]['suggested']['capacity_label'])->toBe('2 of 6 orders')
|
|
157
|
+
->and($cards[0]['suggested']['on_shift_until'])->toBe('2026-09-15T21:00:00+00:00');
|
|
158
|
+
|
|
159
|
+
// Without anyone on shift long enough, the card still exists but has no suggestion.
|
|
160
|
+
$none = RadarAgenda::handovers($items, [$shifts[0], $shifts[4]], $drivers, $orders, $now);
|
|
161
|
+
expect($none[0]['suggested'])->toBeNull();
|
|
162
|
+
|
|
163
|
+
expect(RadarAgenda::distanceKm(['lat' => 0, 'lng' => 0], ['lat' => 0, 'lng' => 1]))->toBe(111.2)
|
|
164
|
+
->and(RadarAgenda::distanceKm(null, ['lat' => 0, 'lng' => 1]))->toBeNull();
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
test('cover suggestions prefer online drivers, then the nearest, then the least busy', function () {
|
|
168
|
+
$now = fleetOpsAgendaNow();
|
|
169
|
+
$shiftEnd = Carbon::parse('2026-09-15 09:15:00', 'UTC');
|
|
170
|
+
$shift = fn (string $name, bool $online) => ['uuid' => 'sh-' . $name, 'start_at' => '2026-09-15 06:00:00', 'end_at' => '2026-09-15 21:00:00', 'status' => 'in_progress', 'driver' => fleetOpsAgendaDriver($name), 'driver_online' => $online];
|
|
171
|
+
|
|
172
|
+
$offlineFirst = RadarAgenda::suggestCover('driver-leaving', null, $shiftEnd, [$shift('Offline Olga', false), $shift('Online Omar', true)], [], $now);
|
|
173
|
+
expect($offlineFirst['driver']['label'])->toBe('Online Omar');
|
|
174
|
+
|
|
175
|
+
// With no locations to compare, the driver carrying fewer orders wins.
|
|
176
|
+
$rows = [
|
|
177
|
+
'driver-busybea' => ['uuid' => 'driver-busybea', 'active_orders' => 4],
|
|
178
|
+
'driver-freefred' => ['uuid' => 'driver-freefred', 'active_orders' => 1],
|
|
179
|
+
];
|
|
180
|
+
$leastBusy = RadarAgenda::suggestCover('driver-leaving', null, $shiftEnd, [$shift('Busy Bea', true), $shift('Free Fred', true)], $rows, $now);
|
|
181
|
+
expect($leastBusy['driver']['label'])->toBe('Free Fred');
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
test('a driver with several gaps shows the worst one on their shift bar', function () {
|
|
185
|
+
$now = fleetOpsAgendaNow();
|
|
186
|
+
$driver = fleetOpsAgendaDriver('Amara Diallo');
|
|
187
|
+
$window = ['start_at' => '2026-09-15T08:00:00+00:00', 'end_at' => '2026-09-15T09:30:00+00:00'];
|
|
188
|
+
$items = [
|
|
189
|
+
fleetOpsAgendaItem('shift_handover:driver_amaradiallo', ['category' => 'staffing', 'lane' => 'shifts', 'severity' => 'warning', 'subject' => $driver, 'window' => $window]),
|
|
190
|
+
fleetOpsAgendaItem('shift_late_start:driver_amaradiallo', ['category' => 'staffing', 'lane' => 'shifts', 'severity' => 'critical', 'subject' => $driver, 'window' => $window]),
|
|
191
|
+
fleetOpsAgendaItem('driver_without_vehicle:driver_amaradiallo', ['category' => 'staffing', 'lane' => 'anytime', 'severity' => 'info', 'subject' => $driver]),
|
|
192
|
+
];
|
|
193
|
+
$shifts = [['uuid' => 'sh', 'public_id' => 'shift_a', 'start_at' => '2026-09-15 08:00:00', 'end_at' => '2026-09-15 09:30:00', 'status' => 'scheduled', 'driver' => $driver, 'driver_online' => false]];
|
|
194
|
+
|
|
195
|
+
$bar = collect(RadarAgenda::build($items, $shifts, '24h', $now)['lanes']['shifts'])->firstWhere('kind', 'shift');
|
|
196
|
+
|
|
197
|
+
expect($bar['severity'])->toBe('critical')
|
|
198
|
+
->and($bar['handover_key'])->toBe('shift_handover:driver_amaradiallo')
|
|
199
|
+
->and($bar['gap_keys'])->toHaveCount(3);
|
|
200
|
+
});
|