@fleetbase/fleetops-engine 0.6.19 → 0.6.21
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/addon/components/custom-entity/form.hbs +14 -14
- package/addon/components/device/details.hbs +92 -43
- package/addon/components/device/form.hbs +108 -60
- package/addon/components/device/form.js +36 -8
- package/addon/components/device/panel-header.hbs +32 -0
- package/addon/components/device/panel-header.js +3 -0
- package/addon/components/driver/form.hbs +1 -1
- package/addon/components/driver/form.js +49 -47
- package/addon/components/entity/form.hbs +7 -5
- package/addon/components/layout/fleet-ops-sidebar.js +12 -12
- package/addon/components/map/drawer/device-event-listing.hbs +58 -0
- package/addon/components/map/drawer/device-event-listing.js +181 -0
- package/addon/components/map/drawer/position-listing.hbs +84 -0
- package/addon/components/map/drawer/position-listing.js +289 -0
- package/addon/components/map/drawer.js +2 -0
- package/addon/components/map/leaflet-live-map.hbs +7 -2
- package/addon/components/order/details/payload.hbs +6 -4
- package/addon/components/order/details/payload.js +2 -0
- package/addon/components/order/kanban.hbs +12 -10
- package/addon/components/order/kanban.js +27 -3
- package/addon/components/order-config-manager/custom-fields.js +1 -1
- package/addon/components/positions-replay.hbs +333 -0
- package/addon/components/positions-replay.js +372 -0
- package/addon/components/sensor/details.hbs +64 -38
- package/addon/components/sensor/form.hbs +112 -63
- package/addon/components/sensor/form.js +36 -24
- package/addon/components/sensor/panel-header.hbs +32 -0
- package/addon/components/sensor/panel-header.js +3 -0
- package/addon/components/telematic/details.hbs +40 -16
- package/addon/components/telematic/form.hbs +63 -64
- package/addon/components/telematic/form.js +73 -4
- package/addon/components/vehicle/card.hbs +1 -1
- package/addon/controllers/analytics/reports/index/edit.js +1 -1
- package/addon/controllers/connectivity/devices/index/details.js +22 -1
- package/addon/controllers/connectivity/devices/index/edit.js +66 -1
- package/addon/controllers/connectivity/devices/index.js +51 -9
- package/addon/controllers/connectivity/events/index.js +65 -16
- package/addon/controllers/connectivity/sensors/index/details.js +22 -1
- package/addon/controllers/connectivity/sensors/index/edit.js +66 -1
- package/addon/controllers/connectivity/sensors/index.js +66 -6
- package/addon/controllers/connectivity/telematics/index/details.js +22 -1
- package/addon/controllers/connectivity/telematics/index/edit.js +66 -1
- package/addon/controllers/connectivity/telematics/index.js +20 -11
- package/addon/controllers/management/fleets/index/details.js +26 -21
- package/addon/controllers/management/fleets/index/edit.js +9 -6
- package/addon/controllers/management/vehicles/index/details.js +21 -13
- package/addon/controllers/operations/orders/index/new.js +4 -2
- package/addon/controllers/operations/orders/index.js +50 -45
- package/addon/controllers/settings/custom-fields.js +6 -0
- package/addon/helpers/get-fleet-ops-option-label.js +11 -0
- package/addon/routes/connectivity/devices/index/details.js +27 -1
- package/addon/routes/connectivity/devices/index/edit.js +27 -1
- package/addon/routes/connectivity/sensors/index/details.js +27 -1
- package/addon/routes/connectivity/sensors/index/edit.js +27 -1
- package/addon/routes/connectivity/telematics/index/details.js +27 -1
- package/addon/routes/connectivity/telematics/index/edit.js +27 -1
- package/addon/routes/management/vehicles/index/details/positions.js +3 -0
- package/addon/routes/operations/orders/index.js +0 -3
- package/addon/routes.js +1 -0
- package/addon/services/movement-tracker.js +81 -30
- package/addon/services/order-creation.js +4 -8
- package/addon/services/order-validation.js +3 -3
- package/addon/styles/fleetops-engine.css +192 -0
- package/addon/templates/connectivity/devices/index/details/index.hbs +2 -2
- package/addon/templates/connectivity/devices/index/details.hbs +15 -2
- package/addon/templates/connectivity/devices/index/edit.hbs +1 -1
- package/addon/templates/connectivity/events/index.hbs +1 -1
- package/addon/templates/connectivity/sensors/index/details/index.hbs +2 -2
- package/addon/templates/connectivity/sensors/index/details.hbs +15 -2
- package/addon/templates/connectivity/sensors/index/edit.hbs +1 -1
- package/addon/templates/connectivity/telematics/index/details/index.hbs +2 -2
- package/addon/templates/connectivity/telematics/index/details.hbs +14 -2
- package/addon/templates/connectivity/telematics/index/edit.hbs +1 -1
- package/addon/templates/management/vehicles/index/details/positions.hbs +1 -0
- package/addon/templates/operations/orders/index.hbs +26 -2
- package/addon/utils/fleet-ops-options.js +95 -0
- package/addon/utils/setup-customer-portal.js +7 -0
- package/app/components/device/panel-header.js +1 -0
- package/app/components/map/drawer/device-event-listing.js +1 -0
- package/app/components/map/drawer/position-listing.js +1 -0
- package/app/components/positions-replay.js +1 -0
- package/app/components/sensor/panel-header.js +1 -0
- package/app/helpers/get-fleet-ops-option-label.js +1 -0
- package/app/routes/management/vehicles/index/details/positions.js +1 -0
- package/app/templates/management/vehicles/index/details/positions.js +1 -0
- package/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +4 -4
- package/server/config/telematics.php +111 -0
- package/server/migrations/2025_10_27_000001_add_telematics_integration_fields.php +70 -0
- package/server/migrations/2025_10_27_171322_fix_device_column_names.php +107 -0
- package/server/migrations/2025_10_27_203023_add_company_uuid_to_device_events_table.php +28 -0
- package/server/src/Console/Commands/ReplayVehicleLocations.php +225 -0
- package/server/src/Contracts/TelematicProviderDescriptor.php +72 -0
- package/server/src/Contracts/TelematicProviderInterface.php +119 -0
- package/server/src/Exceptions/TelematicProviderException.php +14 -0
- package/server/src/Exceptions/TelematicRateLimitExceededException.php +12 -0
- package/server/src/Http/Controllers/Api/v1/DriverController.php +24 -14
- package/server/src/Http/Controllers/Api/v1/VehicleController.php +27 -7
- package/server/src/Http/Controllers/Internal/v1/DeviceController.php +22 -0
- package/server/src/Http/Controllers/Internal/v1/OrderController.php +50 -68
- package/server/src/Http/Controllers/Internal/v1/PositionController.php +240 -0
- package/server/src/Http/Controllers/Internal/v1/SensorController.php +11 -0
- package/server/src/Http/Controllers/Internal/v1/TelematicController.php +141 -0
- package/server/src/Http/Controllers/Internal/v1/TelematicWebhookController.php +170 -0
- package/server/src/Http/Filter/DeviceEventFilter.php +68 -0
- package/server/src/Http/Filter/PositionFilter.php +35 -0
- package/server/src/Http/Resources/v1/Position.php +44 -0
- package/server/src/Jobs/ReplayPositions.php +64 -0
- package/server/src/Jobs/SendPositionReplay.php +65 -0
- package/server/src/Jobs/SyncTelematicDevicesJob.php +106 -0
- package/server/src/Jobs/TestTelematicConnectionJob.php +102 -0
- package/server/src/Models/Device.php +72 -10
- package/server/src/Models/DeviceEvent.php +7 -0
- package/server/src/Models/Driver.php +28 -1
- package/server/src/Models/Payload.php +11 -3
- package/server/src/Models/Place.php +9 -2
- package/server/src/Models/Position.php +17 -17
- package/server/src/Models/Sensor.php +78 -13
- package/server/src/Models/Telematic.php +116 -6
- package/server/src/Models/Vehicle.php +104 -1
- package/server/src/Providers/FleetOpsServiceProvider.php +2 -0
- package/server/src/Support/Telematics/Providers/AbstractProvider.php +151 -0
- package/server/src/Support/Telematics/Providers/FlespiProvider.php +182 -0
- package/server/src/Support/Telematics/Providers/GeotabProvider.php +181 -0
- package/server/src/Support/Telematics/Providers/SamsaraProvider.php +177 -0
- package/server/src/Support/Telematics/TelematicProviderRegistry.php +147 -0
- package/server/src/Support/Telematics/TelematicService.php +223 -0
- package/server/src/Support/Utils.php +1 -1
- package/server/src/routes.php +12 -1
|
@@ -403,6 +403,95 @@ export const serviceAreaTypes = [
|
|
|
403
403
|
{ label: 'Continent', value: 'continent', description: 'A global landmass encompassing multiple countries (e.g., Asia, Europe, Africa).' },
|
|
404
404
|
];
|
|
405
405
|
|
|
406
|
+
export const telematicStatuses = [
|
|
407
|
+
{ value: 'initialized', label: 'Initialized', description: 'Provider entry has been created but not yet configured.' },
|
|
408
|
+
{ value: 'configured', label: 'Configured', description: 'Provider credentials and settings are valid but connection not yet tested.' },
|
|
409
|
+
{ value: 'connecting', label: 'Connecting', description: 'Attempting to establish a connection with provider API.' },
|
|
410
|
+
{ value: 'connected', label: 'Connected', description: 'Successfully authenticated and connected to provider API.' },
|
|
411
|
+
{ value: 'synchronizing', label: 'Synchronizing', description: 'Currently syncing data (devices, vehicles, positions, etc.) from provider.' },
|
|
412
|
+
{ value: 'active', label: 'Active', description: 'Integration is healthy and data syncs are occurring normally.' },
|
|
413
|
+
{ value: 'degraded', label: 'Degraded', description: 'Integration partially working; intermittent errors or missing data.' },
|
|
414
|
+
{ value: 'disconnected', label: 'Disconnected', description: 'Connection lost or failed authentication.' },
|
|
415
|
+
{ value: 'error', label: 'Error', description: 'Provider integration encountered a fatal issue.' },
|
|
416
|
+
{ value: 'disabled', label: 'Disabled', description: 'Manually disabled by the user.' },
|
|
417
|
+
{ value: 'archived', label: 'Archived', description: 'Deprecated or replaced integration, kept for record.' },
|
|
418
|
+
];
|
|
419
|
+
|
|
420
|
+
export const telematicHealthStates = [
|
|
421
|
+
{ value: 'healthy', label: 'Healthy', description: 'Integration tested and stable.' },
|
|
422
|
+
{ value: 'warning', label: 'Warning', description: 'Minor issues detected (e.g., slow response, nearing quota).' },
|
|
423
|
+
{ value: 'critical', label: 'Critical', description: 'Persistent failure or no data received in X hours.' },
|
|
424
|
+
];
|
|
425
|
+
|
|
426
|
+
export const deviceTypes = [
|
|
427
|
+
{ label: 'GPS Tracker', value: 'gps_tracker', description: 'Standalone GPS tracking device installed in vehicle or asset.' },
|
|
428
|
+
{ label: 'OBD-II Plug-in Device', value: 'obd2_plugin', description: 'Plugs into vehicle OBD-II port; reads diagnostics, engine data, and transmits telematics.' },
|
|
429
|
+
{ label: 'CAN Bus Module', value: 'can_bus_module', description: 'Hard-wired module connected to vehicle CAN bus for detailed vehicle subsystem data.' },
|
|
430
|
+
{ label: 'Dash Camera Telematics Unit', value: 'dashcam_unit', description: 'Camera + integrated telematics module capturing video and vehicle data.' },
|
|
431
|
+
{
|
|
432
|
+
label: 'Battery-Powered Asset Tracker',
|
|
433
|
+
value: 'battery_asset_tracker',
|
|
434
|
+
description: 'Self-powered wireless device for tracking non-powered assets (trailers, containers, equipment).',
|
|
435
|
+
},
|
|
436
|
+
{ label: 'Smartphone App Device', value: 'smartphone_app_device', description: 'Mobile device running telematics/tracking app using phone sensors and connectivity.' },
|
|
437
|
+
{ label: 'Hard-wired Black Box Module', value: 'hardwired_black_box', description: 'Permanently installed telematics control unit wired to vehicle electrical system for fleet use.' },
|
|
438
|
+
{ label: 'Mobile Edge / IoT Gateway', value: 'mobile_edge_gateway', description: 'Multi-sensor/IoT gateway installed in vehicle or asset to aggregate sensor data and telematics.' },
|
|
439
|
+
{
|
|
440
|
+
label: 'Trailer/Container Telematic Sensor Node',
|
|
441
|
+
value: 'trailer_container_node',
|
|
442
|
+
description: 'Specialised telematics node for trailers, containers, intermodal assets, tracking location and status.',
|
|
443
|
+
},
|
|
444
|
+
];
|
|
445
|
+
|
|
446
|
+
export const sensorTypes = [
|
|
447
|
+
{ label: 'GPS / GNSS Receiver', value: 'gps_gnss', description: 'Global positioning sensor providing latitude/longitude, speed and time information.' },
|
|
448
|
+
{ label: 'Accelerometer', value: 'accelerometer', description: 'Measures linear acceleration; used to detect harsh braking, rapid acceleration, and movement.' },
|
|
449
|
+
{ label: 'Gyroscope / IMU', value: 'gyroscope_imu', description: 'Inertial Measurement Unit estimating orientation, yaw/pitch/roll of vehicle or asset.' },
|
|
450
|
+
{ label: 'Fuel Level Sensor', value: 'fuel_level', description: 'Measures remaining fuel in tank; used for fuel monitoring and consumption tracking.' },
|
|
451
|
+
{ label: 'Tire Pressure Sensor (TPMS)', value: 'tire_pressure', description: 'Measures pressure (and often temperature) in tires for safety and maintenance.' },
|
|
452
|
+
{ label: 'Engine Diagnostic / OBD Sensor', value: 'engine_diagnostic', description: 'Reads engine fault codes, RPM, engine hours, and other diagnostics via OBD or CAN.' },
|
|
453
|
+
{ label: 'Temperature Sensor', value: 'temperature', description: 'Monitors ambient or equipment temperature; used for refrigerated cargo, battery health etc.' },
|
|
454
|
+
{ label: 'Humidity Sensor', value: 'humidity', description: 'Detects moisture/humidity levels in cargo or enclosed spaces for condition monitoring.' },
|
|
455
|
+
{ label: 'Door / Hatch Sensor', value: 'door_hatch', description: 'Monitors open/close status of doors, hatches or compartments for security/tracking.' },
|
|
456
|
+
{ label: 'Vibration / Shock Sensor', value: 'vibration_shock', description: 'Measures vibration or shock events; suitable for freight, containers or equipment stability monitoring.' },
|
|
457
|
+
{ label: 'Battery Voltage Sensor', value: 'battery_voltage', description: 'Monitors battery or electrical system voltage to detect low power or charging issues.' },
|
|
458
|
+
{ label: 'Geofence / Entry-Exit Event Sensor', value: 'geofence_event', description: 'Triggers when asset enters/exits defined geographic zone; used for location-based alerts.' },
|
|
459
|
+
{ label: 'Idle Time Sensor', value: 'idle_time', description: 'Tracks engine on with vehicle stationary; used to measure idling and optimize fuel/usage.' },
|
|
460
|
+
{ label: 'Driver Behavior Sensor', value: 'driver_behavior', description: 'Aggregates data (speed, braking, cornering) to score driving behavior and safety.' },
|
|
461
|
+
];
|
|
462
|
+
|
|
463
|
+
export const deviceStatuses = [
|
|
464
|
+
{ label: 'Inactive', value: 'inactive', description: 'Device record exists but has not yet been activated or assigned.' },
|
|
465
|
+
{ label: 'Active', value: 'active', description: 'Device is online and actively communicating with the platform.' },
|
|
466
|
+
{ label: 'Online', value: 'online', description: 'Device is currently connected and transmitting live data.' },
|
|
467
|
+
{ label: 'Offline', value: 'offline', description: 'Device is powered off or has not transmitted data within the expected interval.' },
|
|
468
|
+
{ label: 'Sleeping', value: 'sleeping', description: 'Device in low-power mode awaiting wake event or scheduled reporting interval.' },
|
|
469
|
+
{ label: 'Idle', value: 'idle', description: 'Device is powered and connected but not moving or transmitting new telemetry.' },
|
|
470
|
+
{ label: 'Maintenance', value: 'maintenance', description: 'Device is undergoing repair, firmware update, or service maintenance.' },
|
|
471
|
+
{ label: 'Degraded', value: 'degraded', description: 'Device is partially functional; intermittent connectivity or incomplete data.' },
|
|
472
|
+
{ label: 'Error', value: 'error', description: 'Device reported fault, hardware issue, or repeated communication errors.' },
|
|
473
|
+
{ label: 'Disconnected', value: 'disconnected', description: 'Device lost connection to network or telematic gateway.' },
|
|
474
|
+
{ label: 'Decommissioned', value: 'decommissioned', description: 'Device permanently retired or removed from active fleet use.' },
|
|
475
|
+
{ label: 'Disabled', value: 'disabled', description: 'Device manually disabled by user or admin; data not being accepted.' },
|
|
476
|
+
{ label: 'Pending Activation', value: 'pending_activation', description: 'Device provisioned but not yet verified or linked to telematic source.' },
|
|
477
|
+
{ label: 'Provisioning', value: 'provisioning', description: 'Device configuration or initialization is in progress.' },
|
|
478
|
+
];
|
|
479
|
+
|
|
480
|
+
export const sensorStatuses = [
|
|
481
|
+
{ label: 'Active', value: 'active', description: 'Sensor is online and transmitting readings as expected.' },
|
|
482
|
+
{ label: 'Inactive', value: 'inactive', description: 'Sensor exists but is not currently operational or reporting.' },
|
|
483
|
+
{ label: 'Online', value: 'online', description: 'Sensor is connected and sending live data via its parent device.' },
|
|
484
|
+
{ label: 'Offline', value: 'offline', description: 'Sensor has stopped sending data or is unreachable.' },
|
|
485
|
+
{ label: 'Calibrating', value: 'calibrating', description: 'Sensor undergoing calibration or self-test to ensure measurement accuracy.' },
|
|
486
|
+
{ label: 'Faulty', value: 'faulty', description: 'Sensor hardware failure or inconsistent readings detected.' },
|
|
487
|
+
{ label: 'Degraded', value: 'degraded', description: 'Sensor partially functional; data irregularities or unstable connection.' },
|
|
488
|
+
{ label: 'Maintenance', value: 'maintenance', description: 'Sensor temporarily disabled for maintenance, cleaning, or recalibration.' },
|
|
489
|
+
{ label: 'Error', value: 'error', description: 'Critical failure or unrecoverable error reported by sensor or gateway.' },
|
|
490
|
+
{ label: 'Disconnected', value: 'disconnected', description: 'Sensor communication link lost with device or telematic gateway.' },
|
|
491
|
+
{ label: 'Disabled', value: 'disabled', description: 'Sensor manually disabled; no data being collected.' },
|
|
492
|
+
{ label: 'Decommissioned', value: 'decommissioned', description: 'Sensor permanently retired, replaced, or removed from service.' },
|
|
493
|
+
];
|
|
494
|
+
|
|
406
495
|
export default function fleetOpsOptions(key) {
|
|
407
496
|
const allOptions = {
|
|
408
497
|
driverTypes,
|
|
@@ -434,6 +523,12 @@ export default function fleetOpsOptions(key) {
|
|
|
434
523
|
dimensionUnits,
|
|
435
524
|
weightUnits,
|
|
436
525
|
serviceAreaTypes,
|
|
526
|
+
telematicStatuses,
|
|
527
|
+
telematicHealthStates,
|
|
528
|
+
deviceTypes,
|
|
529
|
+
sensorTypes,
|
|
530
|
+
deviceStatuses,
|
|
531
|
+
sensorStatuses,
|
|
437
532
|
};
|
|
438
533
|
|
|
439
534
|
return allOptions[key] ?? [];
|
|
@@ -4,6 +4,8 @@ import { setOwner } from '@ember/application';
|
|
|
4
4
|
import { debug } from '@ember/debug';
|
|
5
5
|
|
|
6
6
|
export default function setupCustomerPortal(app, engine, universe) {
|
|
7
|
+
if (!customerPortalInstalled(app)) return;
|
|
8
|
+
|
|
7
9
|
universe.afterBoot(function (u) {
|
|
8
10
|
const portal = u.getEngineInstance('@fleetbase/customer-portal-engine');
|
|
9
11
|
if (!portal) {
|
|
@@ -58,3 +60,8 @@ function createEngineBoundComponent(engineInstance, ComponentClass) {
|
|
|
58
60
|
}
|
|
59
61
|
};
|
|
60
62
|
}
|
|
63
|
+
|
|
64
|
+
function customerPortalInstalled(app) {
|
|
65
|
+
const extensions = app.extensions ?? [];
|
|
66
|
+
return extensions.find(({ name }) => name === '@fleetbase/customer-portal-engine');
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/device/panel-header';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/map/drawer/device-event-listing';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/map/drawer/position-listing';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/positions-replay';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/sensor/panel-header';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/helpers/get-fleet-ops-option-label';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/routes/management/vehicles/index/details/positions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/templates/management/vehicles/index/details/positions';
|
package/composer.json
CHANGED
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.21",
|
|
4
4
|
"description": "Fleet & Transport Management Extension for Fleetbase",
|
|
5
5
|
"fleetbase": {
|
|
6
6
|
"route": "fleet-ops"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/core": "^7.23.2",
|
|
45
|
-
"@fleetbase/ember-core": "
|
|
46
|
-
"@fleetbase/ember-ui": "
|
|
47
|
-
"@fleetbase/fleetops-data": "^0.1.
|
|
45
|
+
"@fleetbase/ember-core": "^0.3.6",
|
|
46
|
+
"@fleetbase/ember-ui": "^0.3.7",
|
|
47
|
+
"@fleetbase/fleetops-data": "^0.1.21",
|
|
48
48
|
"@fleetbase/leaflet-routing-machine": "^3.2.17",
|
|
49
49
|
"@fortawesome/ember-fontawesome": "^2.0.0",
|
|
50
50
|
"@fortawesome/fontawesome-svg-core": "6.4.0",
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
return [
|
|
4
|
+
'providers' => [
|
|
5
|
+
[
|
|
6
|
+
'key' => 'flespi',
|
|
7
|
+
'label' => 'Flespi',
|
|
8
|
+
'type' => 'native',
|
|
9
|
+
'driver_class' => \Fleetbase\FleetOps\Support\Telematics\Providers\FlespiProvider::class,
|
|
10
|
+
'icon' => 'https://flespi.com/favicon.ico',
|
|
11
|
+
'description' => 'Flespi is a robust telematics platform offering device management, data processing, and API integration.',
|
|
12
|
+
'docs_url' => 'https://flespi.com/docs',
|
|
13
|
+
'required_fields' => [
|
|
14
|
+
[
|
|
15
|
+
'name' => 'token',
|
|
16
|
+
'label' => 'Flespi Token',
|
|
17
|
+
'type' => 'password',
|
|
18
|
+
'placeholder' => 'Enter your Flespi API token',
|
|
19
|
+
'required' => true,
|
|
20
|
+
'validation' => 'required|string|min:20',
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
'name' => 'webhook_secret',
|
|
24
|
+
'label' => 'Webhook Secret (Optional)',
|
|
25
|
+
'type' => 'password',
|
|
26
|
+
'placeholder' => 'Enter webhook secret for signature validation',
|
|
27
|
+
'required' => false,
|
|
28
|
+
],
|
|
29
|
+
],
|
|
30
|
+
'supports_webhooks' => true,
|
|
31
|
+
'supports_discovery' => true,
|
|
32
|
+
'metadata' => [
|
|
33
|
+
'rate_limit' => 100,
|
|
34
|
+
'pagination' => 'offset',
|
|
35
|
+
],
|
|
36
|
+
],
|
|
37
|
+
|
|
38
|
+
[
|
|
39
|
+
'key' => 'geotab',
|
|
40
|
+
'label' => 'Geotab',
|
|
41
|
+
'type' => 'native',
|
|
42
|
+
'driver_class' => \Fleetbase\FleetOps\Support\Telematics\Providers\GeotabProvider::class,
|
|
43
|
+
'icon' => 'https://www.geotab.com/favicon.ico',
|
|
44
|
+
'description' => 'Geotab provides fleet management solutions with GPS tracking, driver safety, and compliance features.',
|
|
45
|
+
'docs_url' => 'https://developers.geotab.com/',
|
|
46
|
+
'required_fields' => [
|
|
47
|
+
[
|
|
48
|
+
'name' => 'database',
|
|
49
|
+
'label' => 'Database Name',
|
|
50
|
+
'type' => 'text',
|
|
51
|
+
'placeholder' => 'Enter your Geotab database name',
|
|
52
|
+
'required' => true,
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
'name' => 'username',
|
|
56
|
+
'label' => 'Username',
|
|
57
|
+
'type' => 'text',
|
|
58
|
+
'placeholder' => 'Enter your Geotab username',
|
|
59
|
+
'required' => true,
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
'name' => 'password',
|
|
63
|
+
'label' => 'Password',
|
|
64
|
+
'type' => 'password',
|
|
65
|
+
'placeholder' => 'Enter your Geotab password',
|
|
66
|
+
'required' => true,
|
|
67
|
+
],
|
|
68
|
+
],
|
|
69
|
+
'supports_webhooks' => false,
|
|
70
|
+
'supports_discovery' => true,
|
|
71
|
+
'metadata' => [
|
|
72
|
+
'rate_limit' => 50,
|
|
73
|
+
'auth_type' => 'session',
|
|
74
|
+
],
|
|
75
|
+
],
|
|
76
|
+
|
|
77
|
+
[
|
|
78
|
+
'key' => 'samsara',
|
|
79
|
+
'label' => 'Samsara',
|
|
80
|
+
'type' => 'native',
|
|
81
|
+
'driver_class' => \Fleetbase\FleetOps\Support\Telematics\Providers\SamsaraProvider::class,
|
|
82
|
+
'icon' => 'https://www.samsara.com/favicon.ico',
|
|
83
|
+
'description' => 'Samsara offers IoT solutions for fleet operations, including GPS tracking, dashcams, and asset monitoring.',
|
|
84
|
+
'docs_url' => 'https://developers.samsara.com/',
|
|
85
|
+
'required_fields' => [
|
|
86
|
+
[
|
|
87
|
+
'name' => 'api_token',
|
|
88
|
+
'label' => 'API Token',
|
|
89
|
+
'type' => 'password',
|
|
90
|
+
'placeholder' => 'Enter your Samsara API token',
|
|
91
|
+
'required' => true,
|
|
92
|
+
'validation' => 'required|string|min:20',
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
'name' => 'webhook_secret',
|
|
96
|
+
'label' => 'Webhook Secret (Optional)',
|
|
97
|
+
'type' => 'password',
|
|
98
|
+
'placeholder' => 'Enter webhook secret for signature validation',
|
|
99
|
+
'required' => false,
|
|
100
|
+
],
|
|
101
|
+
],
|
|
102
|
+
'supports_webhooks' => true,
|
|
103
|
+
'supports_discovery' => true,
|
|
104
|
+
'metadata' => [
|
|
105
|
+
'rate_limit' => 60,
|
|
106
|
+
'pagination' => 'cursor',
|
|
107
|
+
],
|
|
108
|
+
],
|
|
109
|
+
]
|
|
110
|
+
];
|
|
111
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration {
|
|
8
|
+
/**
|
|
9
|
+
* Run the migrations.
|
|
10
|
+
*
|
|
11
|
+
* @return void
|
|
12
|
+
*/
|
|
13
|
+
public function up()
|
|
14
|
+
{
|
|
15
|
+
// Update telematics table
|
|
16
|
+
Schema::table('telematics', function (Blueprint $table) {
|
|
17
|
+
$table->json('credentials')->after('config');
|
|
18
|
+
$table->string('public_id')->after('uuid')->nullable()->index();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Update devices table
|
|
22
|
+
Schema::table('devices', function (Blueprint $table) {
|
|
23
|
+
$table->string('public_id')->after('uuid')->nullable()->index();
|
|
24
|
+
$table->foreignUuid('company_uuid')->nullable()->after('_key')->constrained('companies', 'uuid')->nullOnDelete();
|
|
25
|
+
$table->foreignUuid('photo_uuid')->nullable()->after('telematic_uuid')->constrained('files', 'uuid')->nullOnDelete();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Update sensors table
|
|
29
|
+
Schema::table('sensors', function (Blueprint $table) {
|
|
30
|
+
$table->string('public_id')->after('uuid')->nullable()->index();
|
|
31
|
+
$table->foreignUuid('photo_uuid')->nullable()->after('company_uuid')->constrained('files', 'uuid')->nullOnDelete();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Update device events table
|
|
35
|
+
Schema::table('device_events', function (Blueprint $table) {
|
|
36
|
+
$table->string('public_id')->after('uuid')->nullable()->index();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Reverse the migrations.
|
|
42
|
+
*
|
|
43
|
+
* @return void
|
|
44
|
+
*/
|
|
45
|
+
public function down()
|
|
46
|
+
{
|
|
47
|
+
// Remove columns from telematics
|
|
48
|
+
Schema::table('telematics', function (Blueprint $table) {
|
|
49
|
+
$table->dropColumn(['credentials', 'public_id']);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Remove columns from devices
|
|
53
|
+
Schema::table('devices', function (Blueprint $table) {
|
|
54
|
+
$table->dropForeign(['company_uuid']);
|
|
55
|
+
$table->dropForeign(['photo_uuid']);
|
|
56
|
+
$table->dropColumn(['public_id', 'photo_uuid', 'company_uuid']);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Remove columns from sensors
|
|
60
|
+
Schema::table('sensors', function (Blueprint $table) {
|
|
61
|
+
$table->dropForeign(['photo_uuid']);
|
|
62
|
+
$table->dropColumn(['public_id', 'photo_uuid']);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Remove columns from device events
|
|
66
|
+
Schema::table('device_events', function (Blueprint $table) {
|
|
67
|
+
$table->dropColumn(['public_id']);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\DB;
|
|
6
|
+
use Illuminate\Support\Facades\Schema;
|
|
7
|
+
|
|
8
|
+
return new class extends Migration {
|
|
9
|
+
public function up(): void
|
|
10
|
+
{
|
|
11
|
+
/**
|
|
12
|
+
* Devices: rename columns WITHOUT doctrine/dbal (MySQL 8+).
|
|
13
|
+
*/
|
|
14
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN device_name TO name');
|
|
15
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN device_type TO type');
|
|
16
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN device_location TO location');
|
|
17
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN device_model TO model');
|
|
18
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN device_provider TO provider');
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Devices: add new scalar cols + spatial POINT (nullable first!).
|
|
22
|
+
*/
|
|
23
|
+
Schema::table('devices', function (Blueprint $table) {
|
|
24
|
+
$table->string('internal_id')->nullable()->after('device_id');
|
|
25
|
+
$table->string('imei')->nullable()->after('device_id');
|
|
26
|
+
$table->string('imsi')->nullable()->after('device_id');
|
|
27
|
+
$table->string('firmware_version')->nullable()->after('device_id');
|
|
28
|
+
|
|
29
|
+
// must be nullable now; we'll backfill and then make NOT NULL
|
|
30
|
+
$table->point('last_position')->nullable()->after('serial_number');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Backfill existing rows so NOT NULL will succeed
|
|
34
|
+
DB::statement('UPDATE devices SET last_position = ST_SRID(POINT(0, 0), 4326) WHERE last_position IS NULL');
|
|
35
|
+
|
|
36
|
+
// Make column NOT NULL (and optionally enforce SRID at column level)
|
|
37
|
+
// If you want to enforce SRID on the column itself, uncomment the SRID variant:
|
|
38
|
+
// DB::statement('ALTER TABLE devices MODIFY last_position POINT NOT NULL SRID 4326');
|
|
39
|
+
DB::statement('ALTER TABLE devices MODIFY last_position POINT NOT NULL');
|
|
40
|
+
|
|
41
|
+
// NOW add the spatial index (requires NOT NULL)
|
|
42
|
+
Schema::table('devices', function (Blueprint $table) {
|
|
43
|
+
$table->spatialIndex('last_position', 'devices_last_position_spx');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Sensors: drop legacy column, add fields + POINT (nullable), backfill, NOT NULL, index.
|
|
48
|
+
*/
|
|
49
|
+
Schema::table('sensors', function (Blueprint $table) {
|
|
50
|
+
if (Schema::hasColumn('sensors', 'sensor_type')) {
|
|
51
|
+
$table->dropColumn('sensor_type');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
$table->foreignUuid('telematic_uuid')->nullable()->after('company_uuid')->constrained('telematics', 'uuid')->nullOnDelete();
|
|
55
|
+
$table->string('firmware_version')->nullable()->after('name');
|
|
56
|
+
$table->string('imei')->nullable()->after('name');
|
|
57
|
+
$table->string('imsi')->nullable()->after('name');
|
|
58
|
+
$table->string('serial_number')->nullable()->after('name');
|
|
59
|
+
$table->string('internal_id')->nullable()->after('name');
|
|
60
|
+
$table->string('status')->nullable()->after('last_value');
|
|
61
|
+
|
|
62
|
+
$table->point('last_position')->nullable()->after('serial_number');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
DB::statement('UPDATE sensors SET last_position = ST_SRID(POINT(0, 0), 4326) WHERE last_position IS NULL');
|
|
66
|
+
DB::statement('ALTER TABLE sensors MODIFY last_position POINT NOT NULL');
|
|
67
|
+
|
|
68
|
+
Schema::table('sensors', function (Blueprint $table) {
|
|
69
|
+
$table->spatialIndex('last_position', 'sensors_last_position_spx');
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public function down(): void
|
|
74
|
+
{
|
|
75
|
+
/**
|
|
76
|
+
* Devices: drop spatial index then column, drop added scalars, rename back.
|
|
77
|
+
*/
|
|
78
|
+
Schema::table('devices', function (Blueprint $table) {
|
|
79
|
+
// drop index BEFORE dropping column
|
|
80
|
+
$table->dropSpatialIndex('devices_last_position_spx');
|
|
81
|
+
$table->dropColumn('last_position');
|
|
82
|
+
|
|
83
|
+
$table->dropColumn(['internal_id', 'imei', 'imsi', 'firmware_version']);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN name TO device_name');
|
|
87
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN type TO device_type');
|
|
88
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN location TO device_location');
|
|
89
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN model TO device_model');
|
|
90
|
+
DB::statement('ALTER TABLE devices RENAME COLUMN provider TO device_provider');
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Sensors: drop spatial index/column, drop new fields, restore sensor_type.
|
|
94
|
+
*/
|
|
95
|
+
Schema::table('sensors', function (Blueprint $table) {
|
|
96
|
+
$table->dropSpatialIndex('sensors_last_position_spx');
|
|
97
|
+
$table->dropColumn('last_position');
|
|
98
|
+
|
|
99
|
+
$table->dropForeign(['telematic_uuid']);
|
|
100
|
+
$table->dropColumn(['telematic_uuid']);
|
|
101
|
+
|
|
102
|
+
$table->dropColumn(['serial_number', 'internal_id', 'imei', 'imsi', 'firmware_version', 'status']);
|
|
103
|
+
|
|
104
|
+
$table->string('sensor_type')->nullable()->after('slug');
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration {
|
|
8
|
+
/**
|
|
9
|
+
* Run the migrations.
|
|
10
|
+
*/
|
|
11
|
+
public function up(): void
|
|
12
|
+
{
|
|
13
|
+
Schema::table('device_events', function (Blueprint $table) {
|
|
14
|
+
$table->foreignUuid('company_uuid')->nullable()->after('_key')->constrained('companies', 'uuid')->nullOnDelete();
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Reverse the migrations.
|
|
20
|
+
*/
|
|
21
|
+
public function down(): void
|
|
22
|
+
{
|
|
23
|
+
Schema::table('device_events', function (Blueprint $table) {
|
|
24
|
+
$table->dropForeign(['company_uuid']);
|
|
25
|
+
$table->dropColumn(['company_uuid']);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|