@fleetbase/fleetops-engine 0.2.9 → 0.3.1

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.
Files changed (70) hide show
  1. package/addon/components/context-panel.hbs +1 -1
  2. package/addon/components/driver-card-mini.js +34 -13
  3. package/addon/components/driver-form-panel.hbs +3 -3
  4. package/addon/components/driver-form-panel.js +87 -29
  5. package/addon/components/driver-panel.hbs +5 -5
  6. package/addon/components/driver-panel.js +118 -31
  7. package/addon/components/live-map.js +221 -10
  8. package/addon/components/map-container/toolbar/visibility-control-panel.hbs +66 -0
  9. package/addon/components/map-container/toolbar/visibility-control-panel.js +74 -0
  10. package/addon/components/map-container/toolbar/zones-panel.hbs +10 -10
  11. package/addon/components/map-container/toolbar/zones-panel.js +90 -61
  12. package/addon/components/map-container/toolbar.hbs +12 -7
  13. package/addon/components/modals/vehicle-form.hbs +35 -35
  14. package/addon/components/vehicle-form-panel.hbs +6 -7
  15. package/addon/components/vehicle-form-panel.js +86 -26
  16. package/addon/components/vehicle-panel.hbs +5 -5
  17. package/addon/components/vehicle-panel.js +124 -31
  18. package/addon/controllers/management/drivers/index/details.js +53 -0
  19. package/addon/controllers/management/drivers/index/edit.js +77 -46
  20. package/addon/controllers/management/drivers/index/new.js +39 -79
  21. package/addon/controllers/management/drivers/index.js +17 -221
  22. package/addon/controllers/management/fleets/index/edit.js +1 -1
  23. package/addon/controllers/management/fleets/index/new.js +1 -1
  24. package/addon/controllers/management/fuel-reports/index.js +2 -2
  25. package/addon/controllers/management/vehicles/index/details.js +49 -0
  26. package/addon/controllers/management/vehicles/index/edit.js +104 -1
  27. package/addon/controllers/management/vehicles/index/new.js +71 -0
  28. package/addon/controllers/operations/orders/index/new.js +1 -1
  29. package/addon/controllers/operations/orders/index/view.js +17 -7
  30. package/addon/controllers/operations/orders/index.js +109 -48
  31. package/addon/controllers/operations/service-rates/index/edit.js +1 -1
  32. package/addon/controllers/operations/service-rates/index/new.js +1 -1
  33. package/addon/helpers/is-visibility-control-visible.js +18 -0
  34. package/addon/routes/application.js +1 -1
  35. package/addon/routes/home.js +1 -1
  36. package/addon/routes/management/drivers/index/details.js +5 -0
  37. package/addon/routes/operations/service-rates/index.js +1 -1
  38. package/addon/routes/operations/zones/index.js +1 -1
  39. package/addon/services/context-panel.js +81 -14
  40. package/addon/templates/management/drivers/index/details.hbs +1 -1
  41. package/addon/templates/management/drivers/index/edit.hbs +1 -1
  42. package/addon/templates/management/drivers/index/new.hbs +1 -1
  43. package/addon/templates/management/vehicles/index/details.hbs +1 -1
  44. package/addon/templates/management/vehicles/index/edit.hbs +1 -1
  45. package/addon/templates/management/vehicles/index/new.hbs +1 -1
  46. package/addon/templates/operations/orders/index/view.hbs +2 -2
  47. package/addon/templates/operations/orders/index.hbs +1 -1
  48. package/addon/utils/apply-context-component-arguments.js +31 -0
  49. package/addon/utils/context-component-callback.js +16 -0
  50. package/app/components/map-container/toolbar/visibility-control-panel.js +1 -0
  51. package/app/helpers/is-visibility-control-visible.js +1 -0
  52. package/app/utils/apply-context-component-arguments.js +1 -0
  53. package/app/utils/context-component-callback.js +1 -0
  54. package/composer.json +2 -2
  55. package/extension.json +1 -1
  56. package/package.json +3 -3
  57. package/server/migrations/2023_09_14_074512_update_vehicles_table.php +89 -88
  58. package/server/migrations/2023_10_25_093014_create_vehicle_device_events_table.php +56 -0
  59. package/server/src/Http/Resources/v1/Vehicle.php +1 -0
  60. package/server/src/Models/Fleet.php +2 -0
  61. package/server/src/Models/VehicleDevice.php +17 -3
  62. package/server/src/Models/VehicleDeviceEvent.php +90 -0
  63. package/server/src/Notifications/OrderAssigned.php +21 -0
  64. package/server/src/Notifications/OrderCanceled.php +21 -0
  65. package/server/src/Notifications/OrderDispatchFailed.php +21 -0
  66. package/server/src/Notifications/OrderDispatched.php +21 -0
  67. package/server/src/Notifications/OrderPing.php +21 -0
  68. package/server/src/Notifications/OrderSplit.php +32 -5
  69. package/server/src/Providers/FleetOpsServiceProvider.php +22 -0
  70. package/server/src/Providers/NotificationServiceProvider.php +43 -0
@@ -37,6 +37,27 @@ class OrderPing extends Notification implements ShouldQueue
37
37
  */
38
38
  public $distance;
39
39
 
40
+ /**
41
+ * Notification name.
42
+ *
43
+ * @var string
44
+ */
45
+ public static string $name = 'Order Ping';
46
+
47
+ /**
48
+ * Notification description.
49
+ *
50
+ * @var string
51
+ */
52
+ public static string $description = 'Notify when an order has been pinged.';
53
+
54
+ /**
55
+ * Notification package.
56
+ *
57
+ * @var string
58
+ */
59
+ public static string $package = 'fleet-ops';
60
+
40
61
  /**
41
62
  * Create a new notification instance.
42
63
  *
@@ -11,6 +11,34 @@ class OrderSplit extends Notification
11
11
  {
12
12
  use Queueable;
13
13
 
14
+ /**
15
+ * The order instance this notification is for.
16
+ *
17
+ * @var \Fleetbase\Models\Order
18
+ */
19
+ public $order;
20
+
21
+ /**
22
+ * Notification name.
23
+ *
24
+ * @var string
25
+ */
26
+ public static string $name = 'Order Split';
27
+
28
+ /**
29
+ * Notification description.
30
+ *
31
+ * @var string
32
+ */
33
+ public static string $description = 'Notify when an order has been splited.';
34
+
35
+ /**
36
+ * Notification package.
37
+ *
38
+ * @var string
39
+ */
40
+ public static string $package = 'fleet-ops';
41
+
14
42
  /**
15
43
  * Create a new notification instance.
16
44
  *
@@ -38,9 +66,9 @@ class OrderSplit extends Notification
38
66
  public function toMail($notifiable)
39
67
  {
40
68
  return (new MailMessage())
41
- ->line('The introduction to the notification.')
42
- ->action('Notification Action', url('/'))
43
- ->line('Thank you for using our application!');
69
+ ->line('The introduction to the notification.')
70
+ ->action('Notification Action', url('/'))
71
+ ->line('Thank you for using our application!');
44
72
  }
45
73
 
46
74
  /**
@@ -50,7 +78,6 @@ class OrderSplit extends Notification
50
78
  */
51
79
  public function toArray($notifiable)
52
80
  {
53
- return [
54
- ];
81
+ return [];
55
82
  }
56
83
  }
@@ -5,6 +5,7 @@ namespace Fleetbase\FleetOps\Providers;
5
5
  use Brick\Geo\Engine\GeometryEngineRegistry;
6
6
  use Brick\Geo\Engine\GEOSEngine;
7
7
  use Fleetbase\Providers\CoreServiceProvider;
8
+ use Fleetbase\Support\NotificationRegistry;
8
9
 
9
10
  if (!class_exists(CoreServiceProvider::class)) {
10
11
  throw new \Exception('FleetOps cannot be loaded without `fleetbase/core-api` installed!');
@@ -78,6 +79,7 @@ class FleetOpsServiceProvider extends CoreServiceProvider
78
79
  $schedule->command('fleetops:dispatch-adhoc')->everyMinute();
79
80
  $schedule->command('fleetops:update-estimations')->everyFifteenMinutes();
80
81
  });
82
+ $this->registerNotifications();
81
83
  $this->registerExpansionsFrom(__DIR__ . '/../Expansions');
82
84
  $this->loadRoutesFrom(__DIR__ . '/../routes.php');
83
85
  $this->loadMigrationsFrom(__DIR__ . '/../../migrations');
@@ -91,4 +93,24 @@ class FleetOpsServiceProvider extends CoreServiceProvider
91
93
  // Register the GeometryEngine for GEOSEngine
92
94
  GeometryEngineRegistry::set(new GEOSEngine());
93
95
  }
96
+
97
+ public function registerNotifications()
98
+ {
99
+ // Register Notifications
100
+ NotificationRegistry::register([
101
+ \Fleetbase\FleetOps\Notifications\OrderAssigned::class,
102
+ \Fleetbase\FleetOps\Notifications\OrderCanceled::class,
103
+ \Fleetbase\FleetOps\Notifications\OrderDispatched::class,
104
+ \Fleetbase\FleetOps\Notifications\OrderDispatchFailed::class,
105
+ \Fleetbase\FleetOps\Notifications\OrderPing::class,
106
+ ]);
107
+
108
+ // Register Notifiables
109
+ NotificationRegistry::registerNotifiable([
110
+ \Fleetbase\FleetOps\Models\Contact::class,
111
+ \Fleetbase\FleetOps\Models\Driver::class,
112
+ \Fleetbase\FleetOps\Models\Vendor::class,
113
+ \Fleetbase\FleetOps\Models\Fleet::class,
114
+ ]);
115
+ }
94
116
  }
@@ -0,0 +1,43 @@
1
+ <?php
2
+
3
+ namespace Fleetbase\FleetOps\Providers;
4
+
5
+ use Fleetbase\Support\NotificationRegistry;
6
+ use Fleetbase\Providers\CoreServiceProvider;
7
+
8
+ if (!class_exists(CoreServiceProvider::class)) {
9
+ throw new \Exception('FleetOps cannot be loaded without `fleetbase/core-api` installed!');
10
+ }
11
+
12
+ /**
13
+ * NotificationServiceProvider service provider.
14
+ */
15
+ class NotificationServiceProvider extends CoreServiceProvider
16
+ {
17
+ /**
18
+ * Bootstrap any package services.
19
+ *
20
+ * @return void
21
+ *
22
+ * @throws \Exception if the `fleetbase/core-api` package is not installed
23
+ */
24
+ public function boot()
25
+ {
26
+ // Register Notifications
27
+ NotificationRegistry::register([
28
+ \Fleetbase\FleetOps\Notifications\OrderAssigned::class,
29
+ \Fleetbase\FleetOps\Notifications\OrderCanceled::class,
30
+ \Fleetbase\FleetOps\Notifications\OrderDispatched::class,
31
+ \Fleetbase\FleetOps\Notifications\OrderDispatchFailed::class,
32
+ \Fleetbase\FleetOps\Notifications\OrderPing::class,
33
+ ]);
34
+
35
+ // Register Notifiables
36
+ NotificationRegistry::registerNotifiable([
37
+ \Fleetbase\FleetOps\Models\Contact::class,
38
+ \Fleetbase\FleetOps\Models\Driver::class,
39
+ \Fleetbase\FleetOps\Models\Vendor::class,
40
+ \Fleetbase\FleetOps\Models\Fleet::class,
41
+ ]);
42
+ }
43
+ }