@fleetbase/fleetops-engine 0.3.4 → 0.3.6

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 (166) hide show
  1. package/README.md +4 -4
  2. package/addon/components/admin/navigator-app.hbs +5 -0
  3. package/addon/components/admin/navigator-app.js +27 -0
  4. package/addon/components/driver-form-panel.js +13 -19
  5. package/addon/components/fleet-listing-panel.hbs +2 -2
  6. package/addon/components/layout/fleet-ops-sidebar/fleet-listing.hbs +1 -0
  7. package/addon/components/layout/fleet-ops-sidebar/fleet-listing.js +3 -0
  8. package/addon/components/layout/fleet-ops-sidebar.hbs +4 -4
  9. package/addon/components/layout/fleet-ops-sidebar.js +2 -0
  10. package/addon/components/leaflet-draw-control.js +2 -3
  11. package/addon/components/live-map.js +7 -4
  12. package/addon/components/modals/driver-assign-order.hbs +2 -2
  13. package/addon/components/modals/order-import.hbs +5 -5
  14. package/addon/components/modals/order-new-activity.hbs +1 -1
  15. package/addon/components/order-config/entities-editor.js +3 -5
  16. package/addon/components/route-list.hbs +2 -2
  17. package/addon/components/vendor-form-panel.js +1 -1
  18. package/addon/controllers/application.js +2 -2
  19. package/addon/controllers/base-controller.js +31 -0
  20. package/addon/controllers/management/contacts/index/details.js +2 -2
  21. package/addon/controllers/management/contacts/index/edit.js +2 -2
  22. package/addon/controllers/management/contacts/index/new.js +2 -2
  23. package/addon/controllers/management/contacts/index.js +9 -2
  24. package/addon/controllers/management/drivers/index/details.js +2 -2
  25. package/addon/controllers/management/drivers/index/edit.js +28 -2
  26. package/addon/controllers/management/drivers/index/new.js +2 -2
  27. package/addon/controllers/management/drivers/index.js +18 -24
  28. package/addon/controllers/management/fleets/index/details.js +2 -2
  29. package/addon/controllers/management/fleets/index/edit.js +2 -2
  30. package/addon/controllers/management/fleets/index/new.js +2 -2
  31. package/addon/controllers/management/fleets/index.js +16 -9
  32. package/addon/controllers/management/fuel-reports/index/details.js +2 -2
  33. package/addon/controllers/management/fuel-reports/index/edit.js +2 -2
  34. package/addon/controllers/management/fuel-reports/index/new.js +2 -2
  35. package/addon/controllers/management/fuel-reports/index.js +9 -2
  36. package/addon/controllers/management/issues/index/details.js +2 -2
  37. package/addon/controllers/management/issues/index/edit.js +2 -2
  38. package/addon/controllers/management/issues/index/new.js +2 -2
  39. package/addon/controllers/management/issues/index.js +9 -9
  40. package/addon/controllers/management/places/index/details.js +2 -2
  41. package/addon/controllers/management/places/index/edit.js +2 -2
  42. package/addon/controllers/management/places/index/new.js +2 -2
  43. package/addon/controllers/management/places/index.js +8 -2
  44. package/addon/controllers/management/vehicles/index/details.js +2 -2
  45. package/addon/controllers/management/vehicles/index/edit.js +2 -2
  46. package/addon/controllers/management/vehicles/index/new.js +2 -2
  47. package/addon/controllers/management/vehicles/index.js +24 -32
  48. package/addon/controllers/management/vendors/index/details.js +2 -2
  49. package/addon/controllers/management/vendors/index/edit.js +2 -2
  50. package/addon/controllers/management/vendors/index/new.js +2 -2
  51. package/addon/controllers/management/vendors/index.js +9 -8
  52. package/addon/controllers/management.js +2 -2
  53. package/addon/controllers/operations/orders/index/config/types.js +2 -2
  54. package/addon/controllers/operations/orders/index/config.js +2 -2
  55. package/addon/controllers/operations/orders/index/new.js +64 -44
  56. package/addon/controllers/operations/orders/index/view.js +11 -4
  57. package/addon/controllers/operations/orders/index.js +2 -2
  58. package/addon/controllers/operations/scheduler/index.js +2 -2
  59. package/addon/controllers/operations/service-rates/index/edit.js +12 -18
  60. package/addon/controllers/operations/service-rates/index/new.js +16 -22
  61. package/addon/controllers/operations/service-rates/index.js +9 -2
  62. package/addon/engine.js +6 -0
  63. package/addon/helpers/waypoint-label.js +6 -1
  64. package/addon/routes/application.js +4 -15
  65. package/addon/routes/management/contacts/index.js +9 -5
  66. package/addon/routes/management/drivers/index.js +7 -3
  67. package/addon/routes/management/fleets/index.js +9 -5
  68. package/addon/routes/management/fuel-reports/index.js +9 -5
  69. package/addon/routes/management/issues/index.js +9 -5
  70. package/addon/routes/management/places/index.js +9 -5
  71. package/addon/routes/management/vehicles/index/details.js +2 -2
  72. package/addon/routes/management/vehicles/index.js +11 -2
  73. package/addon/routes/management/vendors/index.js +9 -6
  74. package/addon/routes/operations/orders/index/view.js +6 -2
  75. package/addon/routes/operations/orders/index.js +7 -1
  76. package/addon/routes/operations/orders.js +0 -1
  77. package/addon/routes/operations/service-rates/index.js +9 -27
  78. package/addon/routes/operations/service-rates.js +1 -8
  79. package/addon/styles/fleetops-engine.css +14 -7
  80. package/addon/templates/management/contacts/index.hbs +1 -0
  81. package/addon/templates/management/drivers/index.hbs +2 -1
  82. package/addon/templates/management/fleets/index.hbs +23 -3
  83. package/addon/templates/management/fuel-reports/index.hbs +1 -0
  84. package/addon/templates/management/issues/index.hbs +22 -2
  85. package/addon/templates/management/places/index.hbs +9 -1
  86. package/addon/templates/management/vehicles/index.hbs +22 -2
  87. package/addon/templates/management/vendors/index.hbs +22 -2
  88. package/addon/templates/operations/orders/index/new.hbs +7 -7
  89. package/addon/templates/operations/orders/index/view.hbs +17 -16
  90. package/addon/templates/operations/service-rates/index.hbs +11 -3
  91. package/addon/utils/waypoint-label.js +3 -0
  92. package/app/components/layout/fleet-ops-sidebar/fleet-listing.js +1 -0
  93. package/app/controllers/{operations/zones/index.js → base-controller.js} +1 -1
  94. package/app/utils/waypoint-label.js +1 -0
  95. package/composer.json +1 -1
  96. package/config/environment.js +11 -1
  97. package/extension.json +1 -1
  98. package/index.js +1 -0
  99. package/package.json +47 -41
  100. package/server/migrations/2023_04_27_053456_create_contacts_table.php +2 -2
  101. package/server/migrations/2023_04_27_053456_create_drivers_table.php +5 -5
  102. package/server/migrations/2023_04_27_053456_create_entities_table.php +5 -5
  103. package/server/migrations/2023_04_27_053456_create_fleet_drivers_table.php +2 -2
  104. package/server/migrations/2023_04_27_053456_create_fleets_table.php +3 -3
  105. package/server/migrations/2023_04_27_053456_create_fuel_reports_table.php +3 -3
  106. package/server/migrations/2023_04_27_053456_create_issues_table.php +4 -4
  107. package/server/migrations/2023_04_27_053456_create_orders_table.php +8 -8
  108. package/server/migrations/2023_04_27_053456_create_payloads_table.php +5 -5
  109. package/server/migrations/2023_04_27_053456_create_places_table.php +1 -1
  110. package/server/migrations/2023_04_27_053456_create_purchase_rates_table.php +4 -4
  111. package/server/migrations/2023_04_27_053456_create_service_areas_table.php +2 -2
  112. package/server/migrations/2023_04_27_053456_create_service_quote_items_table.php +1 -1
  113. package/server/migrations/2023_04_27_053456_create_service_quotes_table.php +3 -3
  114. package/server/migrations/2023_04_27_053456_create_service_rate_fees_table.php +1 -1
  115. package/server/migrations/2023_04_27_053456_create_service_rate_parcel_fees_table.php +1 -1
  116. package/server/migrations/2023_04_27_053456_create_service_rates_table.php +3 -3
  117. package/server/migrations/2023_04_27_053456_create_tracking_numbers_table.php +3 -3
  118. package/server/migrations/2023_04_27_053456_create_tracking_statuses_table.php +2 -2
  119. package/server/migrations/2023_04_27_053456_create_vehicles_table.php +3 -3
  120. package/server/migrations/2023_04_27_053456_create_vendors_table.php +5 -5
  121. package/server/migrations/2023_04_27_053456_create_waypoints_table.php +4 -4
  122. package/server/migrations/2023_04_27_053456_create_zones_table.php +2 -2
  123. package/server/migrations/2023_11_17_053001_add_category_uuid_to_entities_table.php +33 -0
  124. package/server/migrations/2023_11_28_074244_add_supplier_uuid_column_to_entities_table.php +33 -0
  125. package/server/migrations/2023_12_14_100209_add_meta_column_on_driver_table.php +30 -0
  126. package/server/src/Http/Controllers/Api/v1/DriverController.php +7 -4
  127. package/server/src/Http/Controllers/Api/v1/EntityController.php +2 -0
  128. package/server/src/Http/Controllers/Api/v1/OrderController.php +118 -42
  129. package/server/src/Http/Controllers/Api/v1/PayloadController.php +41 -43
  130. package/server/src/Http/Controllers/Api/v1/TrackingStatusController.php +43 -2
  131. package/server/src/Http/Controllers/Internal/v1/DriverController.php +0 -1
  132. package/server/src/Http/Controllers/Internal/v1/MorphController.php +48 -16
  133. package/server/src/Http/Controllers/Internal/v1/NavigatorController.php +41 -0
  134. package/server/src/Http/Controllers/Internal/v1/OrderController.php +3 -2
  135. package/server/src/Http/Controllers/Internal/v1/PlaceController.php +2 -2
  136. package/server/src/Http/Requests/CreateDriverRequest.php +2 -0
  137. package/server/src/Http/Requests/CreateOrderRequest.php +18 -4
  138. package/server/src/Http/Requests/CreatePayloadRequest.php +23 -7
  139. package/server/src/Http/Requests/CreatePlaceRequest.php +9 -5
  140. package/server/src/Http/Requests/CreateTrackingStatusRequest.php +69 -12
  141. package/server/src/Http/Requests/CreateVehicleRequest.php +5 -3
  142. package/server/src/Http/Resources/v1/Entity.php +3 -0
  143. package/server/src/Http/Resources/v1/Fleet.php +19 -17
  144. package/server/src/Http/Resources/v1/Order.php +3 -2
  145. package/server/src/Models/Driver.php +21 -2
  146. package/server/src/Models/Entity.php +18 -23
  147. package/server/src/Models/Order.php +2 -2
  148. package/server/src/Models/Payload.php +27 -9
  149. package/server/src/Models/Place.php +28 -5
  150. package/server/src/Models/TrackingStatus.php +9 -3
  151. package/server/src/Models/Vehicle.php +4 -2
  152. package/server/src/Models/VehicleDevice.php +28 -0
  153. package/server/src/Models/VehicleDeviceEvent.php +1 -1
  154. package/server/src/Models/Vendor.php +16 -0
  155. package/server/src/Observers/DriverObserver.php +1 -1
  156. package/server/src/routes.php +8 -0
  157. package/tsconfig.declarations.json +10 -0
  158. package/addon/components/file-icon.js +0 -1
  159. package/addon/controllers/operations/zones/index.js +0 -475
  160. package/addon/routes/operations/dispatch.js +0 -3
  161. package/addon/routes/operations/zones/index.js +0 -25
  162. package/addon/routes/operations/zones.js +0 -7
  163. package/addon/templates/operations/dispatch.hbs +0 -1
  164. package/addon/templates/operations/zones/index.hbs +0 -72
  165. package/addon/templates/operations/zones.hbs +0 -1
  166. package/app/components/file-icon.js +0 -1
@@ -1,11 +1,12 @@
1
1
  /* eslint-env node */
2
2
  'use strict';
3
- const { name } = require('../package');
3
+ const { name, fleetbase } = require('../package');
4
4
 
5
5
  module.exports = function (environment) {
6
6
  let ENV = {
7
7
  modulePrefix: name,
8
8
  environment,
9
+ mountedEngineRoutePrefix: getMountedEngineRoutePrefix(),
9
10
 
10
11
  defaultValues: {
11
12
  driverImage: getenv('DEFAULT_DRIVER_IMAGE', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png'),
@@ -20,6 +21,15 @@ module.exports = function (environment) {
20
21
  return ENV;
21
22
  };
22
23
 
24
+ function getMountedEngineRoutePrefix() {
25
+ let mountedEngineRoutePrefix = 'fleet-ops';
26
+ if (fleetbase && typeof fleetbase.route === 'string') {
27
+ mountedEngineRoutePrefix = fleetbase.route;
28
+ }
29
+
30
+ return `console.${mountedEngineRoutePrefix}.`;
31
+ }
32
+
23
33
  function getenv(variable, defaultValue = null) {
24
34
  return process.env[variable] !== undefined ? process.env[variable] : defaultValue;
25
35
  }
package/extension.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "Fleet-Ops",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Fleet & Transport Management Extension for Fleetbase",
5
5
  "repository": "https://github.com/fleetbase/fleetops",
6
6
  "license": "MIT",
package/index.js CHANGED
@@ -69,6 +69,7 @@ module.exports = buildEngine({
69
69
  new Funnel(leafletImagesPath, {
70
70
  srcDir: '/',
71
71
  destDir: '/leaflet-images',
72
+ allowEmpty: true,
72
73
  })
73
74
  );
74
75
  trees.push(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetbase/fleetops-engine",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Fleet & Transport Management Extension for Fleetbase",
5
5
  "fleetbase": {
6
6
  "route": "fleet-ops",
@@ -25,23 +25,26 @@
25
25
  },
26
26
  "scripts": {
27
27
  "build": "ember build --environment=production",
28
- "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
29
- "lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
28
+ "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
29
+ "lint:css": "stylelint \"**/*.css\"",
30
+ "lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
31
+ "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
30
32
  "lint:hbs": "ember-template-lint .",
31
33
  "lint:hbs:fix": "ember-template-lint . --fix",
32
34
  "lint:js": "eslint . --cache",
33
35
  "lint:js:fix": "eslint . --fix",
34
36
  "start": "ember serve",
35
- "test": "npm-run-all lint test:*",
37
+ "test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
36
38
  "test:ember": "ember test",
37
39
  "test:ember-compatibility": "ember try:each",
38
40
  "publish:npm": "npm config set registry https://registry.npmjs.org/ && npm publish",
39
41
  "publish:github": "npm config set '@fleetbase:registry' https://npm.pkg.github.com/ && npm publish"
40
42
  },
41
43
  "dependencies": {
42
- "@fleetbase/ember-core": "^0.1.8",
43
- "@fleetbase/ember-ui": "^0.2.5",
44
- "@fleetbase/fleetops-data": "^0.1.4",
44
+ "@babel/core": "^7.23.2",
45
+ "@fleetbase/ember-core": "^0.1.9",
46
+ "@fleetbase/ember-ui": "^0.2.8",
47
+ "@fleetbase/fleetops-data": "^0.1.6",
45
48
  "@fleetbase/leaflet-routing-machine": "^3.2.16",
46
49
  "@fortawesome/ember-fontawesome": "^0.4.1",
47
50
  "@fortawesome/fontawesome-svg-core": "^6.4.0",
@@ -50,14 +53,14 @@
50
53
  "@zestia/ember-dragula": "^12.0.0",
51
54
  "broccoli-funnel": "^3.0.8",
52
55
  "broccoli-merge-trees": "^4.2.0",
53
- "ember-cli-babel": "^7.26.11",
54
- "ember-cli-es6-transform": "^1.0.0",
55
- "ember-cli-htmlbars": "^6.1.0",
56
- "ember-intl": "^6.0.0-beta.6",
56
+ "ember-cli-babel": "^8.2.0",
57
+ "ember-cli-htmlbars": "^6.3.0",
58
+ "ember-intl": "6.3.2",
57
59
  "ember-leaflet": "^5.1.1",
58
60
  "ember-radio-button": "^3.0.0-beta.1",
59
61
  "ember-tag-input": "^3.1.0",
60
62
  "ember-wormhole": "^0.6.0",
63
+ "ember-drag-sort": "^3.0.1",
61
64
  "leaflet": "^1.9.4",
62
65
  "leaflet-contextmenu": "^1.4.0",
63
66
  "leaflet-draw": "^1.0.4",
@@ -65,56 +68,59 @@
65
68
  "leaflet-rotatedmarker": "^0.2.0"
66
69
  },
67
70
  "devDependencies": {
71
+ "@babel/eslint-parser": "^7.22.15",
72
+ "@babel/plugin-proposal-decorators": "^7.23.2",
68
73
  "@ember/optional-features": "^2.0.0",
69
- "@ember/test-helpers": "^2.8.1",
70
- "@embroider/test-setup": "^1.8.3",
74
+ "@ember/test-helpers": "^3.2.0",
75
+ "@embroider/test-setup": "^3.0.2",
71
76
  "@glimmer/component": "^1.1.2",
72
77
  "@glimmer/tracking": "^1.1.2",
73
- "babel-eslint": "^10.1.0",
74
78
  "broccoli-asset-rev": "^3.0.0",
79
+ "concurrently": "^8.2.2",
75
80
  "dragula": "^3.7.3",
76
- "ember-auto-import": "^2.4.2",
77
- "ember-cli": "~4.6.0",
78
- "ember-cli-dependency-checker": "^3.3.1",
81
+ "ember-auto-import": "^2.6.3",
82
+ "ember-cli": "~5.4.1",
83
+ "ember-cli-clean-css": "^3.0.0",
84
+ "ember-cli-dependency-checker": "^3.3.2",
79
85
  "ember-cli-inject-live-reload": "^2.1.0",
80
86
  "ember-cli-sri": "^2.1.1",
81
87
  "ember-cli-terser": "^4.0.2",
82
88
  "ember-composable-helpers": "^5.0.0",
83
- "ember-concurrency": "^2.3.7",
89
+ "ember-concurrency": "^3.1.1",
84
90
  "ember-concurrency-decorators": "^2.0.3",
85
- "ember-data": "~4.6.0",
86
- "ember-disable-prototype-extensions": "^1.1.3",
87
- "ember-drag-sort": "^3.0.1",
88
- "ember-engines": "^0.8.23",
91
+ "ember-data": "^4.12.5",
92
+ "ember-engines": "^0.9.0",
89
93
  "ember-load-initializers": "^2.1.2",
90
- "ember-math-helpers": "^2.18.2",
91
- "ember-page-title": "^7.0.0",
92
- "ember-qunit": "^5.1.5",
93
- "ember-resolver": "^8.0.3",
94
+ "ember-math-helpers": "^4.0.0",
95
+ "ember-page-title": "^8.0.0",
96
+ "ember-qunit": "^8.0.1",
97
+ "ember-resolver": "^11.0.1",
94
98
  "ember-responsive": "^5.0.0",
95
- "ember-source": "~4.6.0",
99
+ "ember-source": "~5.4.0",
96
100
  "ember-source-channel-url": "^3.0.0",
97
- "ember-template-lint": "^4.10.1",
98
- "ember-try": "^2.0.0",
99
- "eslint": "^7.32.0",
100
- "eslint-config-prettier": "^8.5.0",
101
- "eslint-plugin-ember": "^11.0.2",
102
- "eslint-plugin-node": "^11.1.0",
103
- "eslint-plugin-prettier": "^4.2.1",
104
- "eslint-plugin-qunit": "^7.3.1",
101
+ "ember-template-lint": "^5.11.2",
102
+ "ember-try": "^3.0.0",
103
+ "eslint": "^8.52.0",
104
+ "eslint-config-prettier": "^9.0.0",
105
+ "eslint-plugin-ember": "^11.11.1",
106
+ "eslint-plugin-n": "^16.2.0",
107
+ "eslint-plugin-prettier": "^5.0.1",
108
+ "eslint-plugin-qunit": "^8.0.1",
105
109
  "loader.js": "^4.7.0",
106
- "npm-run-all": "^4.1.5",
107
- "prettier": "^2.7.1",
108
- "qunit": "^2.19.1",
110
+ "prettier": "^3.0.3",
111
+ "qunit": "^2.20.0",
109
112
  "qunit-dom": "^2.0.0",
110
113
  "resolve": "^1.22.2",
111
- "webpack": "^5.74.0"
114
+ "stylelint": "^15.11.0",
115
+ "stylelint-config-standard": "^34.0.0",
116
+ "stylelint-prettier": "^4.0.2",
117
+ "webpack": "^5.89.0"
112
118
  },
113
119
  "peerDependencies": {
114
- "ember-engines": "^0.8.23"
120
+ "ember-engines": "^0.9.0"
115
121
  },
116
122
  "engines": {
117
- "node": "14.* || >= 16"
123
+ "node": ">= 18"
118
124
  },
119
125
  "ember": {
120
126
  "edition": "octane"
@@ -19,9 +19,9 @@ return new class extends Migration
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
21
  $table->string('internal_id')->nullable();
22
- $table->string('company_uuid', 191)->nullable()->index('contacts_company_uuid_foreign');
22
+ $table->uuid('company_uuid')->nullable()->index('contacts_company_uuid_foreign');
23
23
  $table->char('user_uuid', 36)->nullable()->index();
24
- $table->string('photo_uuid', 191)->nullable()->index('contacts_photo_uuid_foreign');
24
+ $table->uuid('photo_uuid')->nullable()->index('contacts_photo_uuid_foreign');
25
25
  $table->string('name')->nullable();
26
26
  $table->string('title')->nullable();
27
27
  $table->string('email', 191)->nullable()->index();
@@ -19,12 +19,12 @@ return new class extends Migration
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
21
  $table->string('internal_id')->nullable();
22
- $table->string('company_uuid', 191)->nullable()->index('drivers_company_uuid_foreign');
23
- $table->string('vehicle_uuid', 191)->nullable()->index('drivers_vehicle_uuid_foreign');
24
- $table->string('vendor_uuid', 191)->nullable()->index('drivers_vendor_uuid_foreign');
22
+ $table->uuid('company_uuid')->nullable()->index('drivers_company_uuid_foreign');
23
+ $table->uuid('vehicle_uuid')->nullable()->index('drivers_vehicle_uuid_foreign');
24
+ $table->uuid('vendor_uuid')->nullable()->index('drivers_vendor_uuid_foreign');
25
25
  $table->string('vendor_type')->nullable();
26
- $table->string('current_job_uuid', 191)->nullable()->index('drivers_current_job_uuid_foreign');
27
- $table->string('user_uuid', 191)->nullable()->index();
26
+ $table->uuid('current_job_uuid')->nullable()->index('drivers_current_job_uuid_foreign');
27
+ $table->uuid('user_uuid')->nullable()->index();
28
28
  $table->string('auth_token')->nullable();
29
29
  $table->string('drivers_license_number')->nullable();
30
30
  $table->string('signup_token_used')->nullable();
@@ -18,13 +18,13 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->index();
21
- $table->string('payload_uuid', 191)->nullable()->index('entities_payload_uuid_foreign');
22
- $table->string('company_uuid', 191)->nullable()->index();
23
- $table->string('driver_assigned_uuid', 191)->nullable()->index('entities_driver_assigned_uuid_foreign');
24
- $table->string('destination_uuid', 191)->nullable()->index();
21
+ $table->uuid('payload_uuid')->nullable()->index('entities_payload_uuid_foreign');
22
+ $table->uuid('company_uuid')->nullable()->index();
23
+ $table->uuid('driver_assigned_uuid')->nullable()->index('entities_driver_assigned_uuid_foreign');
24
+ $table->uuid('destination_uuid')->nullable()->index();
25
25
  $table->string('customer_uuid')->nullable();
26
26
  $table->string('customer_type')->nullable();
27
- $table->string('tracking_number_uuid', 191)->nullable()->index('entities_tracking_number_uuid_foreign');
27
+ $table->uuid('tracking_number_uuid')->nullable()->index('entities_tracking_number_uuid_foreign');
28
28
  $table->mediumText('photo_uuid')->nullable();
29
29
  $table->string('_import_id', 191)->nullable()->index();
30
30
  $table->string('internal_id', 191)->nullable()->index();
@@ -17,8 +17,8 @@ return new class extends Migration
17
17
  $table->increments('id');
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
- $table->string('fleet_uuid', 191)->nullable()->index();
21
- $table->string('driver_uuid', 191)->nullable()->index();
20
+ $table->uuid('fleet_uuid')->nullable()->index();
21
+ $table->uuid('driver_uuid')->nullable()->index();
22
22
  $table->softDeletes();
23
23
  $table->timestamp('created_at')->nullable()->index();
24
24
  $table->timestamp('updated_at')->nullable();
@@ -18,9 +18,9 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
- $table->string('company_uuid', 191)->nullable()->index();
22
- $table->string('service_area_uuid', 191)->nullable()->index('fleets_service_area_uuid_foreign');
23
- $table->string('zone_uuid', 191)->nullable()->index('fleets_zone_uuid_foreign');
21
+ $table->uuid('company_uuid')->nullable()->index();
22
+ $table->uuid('service_area_uuid')->nullable()->index('fleets_service_area_uuid_foreign');
23
+ $table->uuid('zone_uuid')->nullable()->index('fleets_zone_uuid_foreign');
24
24
  $table->string('image_uuid')->nullable();
25
25
  $table->string('name')->nullable();
26
26
  $table->string('color')->nullable();
@@ -18,9 +18,9 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
- $table->string('company_uuid', 191)->nullable()->index();
22
- $table->string('driver_uuid', 191)->nullable()->index('fuel_reports_driver_uuid_foreign');
23
- $table->string('vehicle_uuid', 191)->nullable()->index('fuel_reports_vehicle_uuid_foreign');
21
+ $table->uuid('company_uuid')->nullable()->index();
22
+ $table->uuid('driver_uuid')->nullable()->index('fuel_reports_driver_uuid_foreign');
23
+ $table->uuid('vehicle_uuid')->nullable()->index('fuel_reports_vehicle_uuid_foreign');
24
24
  $table->string('odometer')->nullable();
25
25
  $table->point('location');
26
26
  $table->string('latitude')->nullable();
@@ -19,10 +19,10 @@ return new class extends Migration
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
21
  $table->string('issue_id', 191)->nullable()->unique();
22
- $table->string('company_uuid', 191)->nullable()->index();
23
- $table->string('driver_uuid', 191)->nullable()->index('issues_driver_uuid_foreign');
24
- $table->string('vehicle_uuid', 191)->nullable()->index('issues_vehicle_uuid_foreign');
25
- $table->string('assigned_to_uuid', 191)->nullable()->index('issues_assigned_to_uuid_foreign');
22
+ $table->uuid('company_uuid')->nullable()->index();
23
+ $table->uuid('driver_uuid')->nullable()->index('issues_driver_uuid_foreign');
24
+ $table->uuid('vehicle_uuid')->nullable()->index('issues_vehicle_uuid_foreign');
25
+ $table->uuid('assigned_to_uuid')->nullable()->index('issues_assigned_to_uuid_foreign');
26
26
  $table->string('odometer')->nullable();
27
27
  $table->point('location');
28
28
  $table->string('latitude')->nullable();
@@ -18,21 +18,21 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->unique();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
- $table->string('company_uuid', 191)->nullable()->index();
21
+ $table->uuid('company_uuid')->nullable()->index();
22
22
  $table->char('created_by_uuid', 36)->nullable()->index();
23
23
  $table->char('updated_by_uuid', 36)->nullable()->index();
24
24
  $table->string('internal_id')->nullable();
25
- $table->string('customer_uuid', 191)->nullable()->index();
25
+ $table->uuid('customer_uuid')->nullable()->index();
26
26
  $table->string('customer_type')->nullable();
27
27
  $table->string('facilitator_uuid')->nullable();
28
28
  $table->string('facilitator_type')->nullable();
29
- $table->string('session_uuid', 191)->nullable()->index('orders_session_uuid_foreign');
30
- $table->string('payload_uuid', 191)->nullable()->index('orders_payload_uuid_foreign');
29
+ $table->uuid('session_uuid')->nullable()->index('orders_session_uuid_foreign');
30
+ $table->uuid('payload_uuid')->nullable()->index('orders_payload_uuid_foreign');
31
31
  $table->char('route_uuid', 36)->nullable()->index('orders_route_uuid_foreign');
32
- $table->string('transaction_uuid', 191)->nullable()->index('orders_transaction_uuid_foreign');
33
- $table->string('purchase_rate_uuid', 191)->nullable()->index('orders_purchase_rate_uuid_foreign');
34
- $table->string('tracking_number_uuid', 191)->nullable()->index('orders_tracking_number_uuid_foreign');
35
- $table->string('driver_assigned_uuid', 191)->nullable()->index('orders_driver_assigned_uuid_foreign');
32
+ $table->uuid('transaction_uuid')->nullable()->index('orders_transaction_uuid_foreign');
33
+ $table->uuid('purchase_rate_uuid')->nullable()->index('orders_purchase_rate_uuid_foreign');
34
+ $table->uuid('tracking_number_uuid')->nullable()->index('orders_tracking_number_uuid_foreign');
35
+ $table->uuid('driver_assigned_uuid')->nullable()->index('orders_driver_assigned_uuid_foreign');
36
36
  $table->json('meta')->nullable();
37
37
  $table->json('options')->nullable();
38
38
  $table->boolean('dispatched')->default(false);
@@ -18,11 +18,11 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->index();
21
- $table->string('company_uuid', 191)->nullable()->index();
22
- $table->string('pickup_uuid', 191)->nullable()->index('payloads_from_place_uuid_index');
23
- $table->string('dropoff_uuid', 191)->nullable()->index('payloads_to_place_uuid_index');
24
- $table->string('return_uuid', 191)->nullable()->index('payloads_return_uuid_foreign');
25
- $table->string('current_waypoint_uuid', 191)->nullable()->index();
21
+ $table->uuid('company_uuid')->nullable()->index();
22
+ $table->uuid('pickup_uuid')->nullable()->index('payloads_from_place_uuid_index');
23
+ $table->uuid('dropoff_uuid')->nullable()->index('payloads_to_place_uuid_index');
24
+ $table->uuid('return_uuid')->nullable()->index('payloads_return_uuid_foreign');
25
+ $table->uuid('current_waypoint_uuid')->nullable()->index();
26
26
  $table->string('provider', 191)->nullable()->index();
27
27
  $table->string('payment_method')->nullable();
28
28
  $table->integer('cod_amount')->nullable();
@@ -19,7 +19,7 @@ return new class extends Migration
19
19
  $table->string('uuid', 191)->nullable()->unique();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
21
  $table->string('_import_id', 191)->nullable()->index();
22
- $table->string('company_uuid', 191)->nullable()->index();
22
+ $table->uuid('company_uuid')->nullable()->index();
23
23
  $table->char('owner_uuid', 36)->nullable()->index();
24
24
  $table->string('owner_type')->nullable();
25
25
  $table->string('name')->nullable();
@@ -21,10 +21,10 @@ return new class extends Migration
21
21
  $table->json('meta')->nullable();
22
22
  $table->string('customer_uuid')->nullable();
23
23
  $table->string('customer_type')->nullable();
24
- $table->string('company_uuid', 191)->nullable()->index('purchase_rates_company_uuid_foreign');
25
- $table->string('transaction_uuid', 191)->nullable()->index('purchase_rates_transaction_uuid_foreign');
26
- $table->string('service_quote_uuid', 191)->nullable()->index('purchase_rates_service_quote_uuid_foreign');
27
- $table->string('payload_uuid', 191)->nullable()->index('purchase_rates_payload_uuid_foreign');
24
+ $table->uuid('company_uuid')->nullable()->index('purchase_rates_company_uuid_foreign');
25
+ $table->uuid('transaction_uuid')->nullable()->index('purchase_rates_transaction_uuid_foreign');
26
+ $table->uuid('service_quote_uuid')->nullable()->index('purchase_rates_service_quote_uuid_foreign');
27
+ $table->uuid('payload_uuid')->nullable()->index('purchase_rates_payload_uuid_foreign');
28
28
  $table->string('status')->nullable();
29
29
  $table->softDeletes();
30
30
  $table->timestamp('created_at')->nullable()->index();
@@ -18,14 +18,14 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
- $table->string('company_uuid', 191)->nullable()->index('service_areas_company_uuid_foreign');
21
+ $table->uuid('company_uuid')->nullable()->index('service_areas_company_uuid_foreign');
22
22
  $table->string('name')->nullable();
23
23
  $table->string('type')->nullable();
24
24
  $table->string('country')->nullable();
25
25
  $table->multiPolygon('border')->nullable();
26
26
  $table->string('color')->nullable();
27
27
  $table->string('stroke_color')->nullable();
28
- $table->string('parent_uuid', 191)->nullable()->index('service_areas_parent_uuid_foreign');
28
+ $table->uuid('parent_uuid')->nullable()->index('service_areas_parent_uuid_foreign');
29
29
  $table->string('status')->nullable();
30
30
  $table->softDeletes();
31
31
  $table->timestamp('created_at')->nullable()->index();
@@ -17,7 +17,7 @@ return new class extends Migration
17
17
  $table->increments('id');
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
- $table->string('service_quote_uuid', 191)->nullable()->index();
20
+ $table->uuid('service_quote_uuid')->nullable()->index();
21
21
  $table->string('amount')->nullable();
22
22
  $table->string('currency')->nullable();
23
23
  $table->string('details')->nullable();
@@ -19,9 +19,9 @@ return new class extends Migration
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
21
  $table->string('request_id', 191)->nullable()->index('service_quotes_request_id_foreign');
22
- $table->string('company_uuid', 191)->nullable()->index('service_quotes_company_uuid_foreign');
23
- $table->string('payload_uuid', 191)->nullable()->index('service_quotes_payload_uuid_foreign');
24
- $table->string('service_rate_uuid', 191)->nullable()->index();
22
+ $table->uuid('company_uuid')->nullable()->index('service_quotes_company_uuid_foreign');
23
+ $table->uuid('payload_uuid')->nullable()->index('service_quotes_payload_uuid_foreign');
24
+ $table->uuid('service_rate_uuid')->nullable()->index();
25
25
  $table->integer('amount')->nullable();
26
26
  $table->string('currency')->nullable();
27
27
  $table->json('meta')->nullable();
@@ -17,7 +17,7 @@ return new class extends Migration
17
17
  $table->increments('id');
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
- $table->string('service_rate_uuid', 191)->nullable()->index();
20
+ $table->uuid('service_rate_uuid')->nullable()->index();
21
21
  $table->integer('distance')->nullable();
22
22
  $table->integer('min')->nullable();
23
23
  $table->integer('max')->nullable();
@@ -17,7 +17,7 @@ return new class extends Migration
17
17
  $table->increments('id');
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
- $table->string('service_rate_uuid', 191)->nullable()->index();
20
+ $table->uuid('service_rate_uuid')->nullable()->index();
21
21
  $table->string('size')->nullable();
22
22
  $table->string('length')->nullable();
23
23
  $table->string('width')->nullable();
@@ -18,9 +18,9 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
- $table->string('company_uuid', 191)->nullable()->index();
22
- $table->string('service_area_uuid', 191)->nullable()->index();
23
- $table->string('zone_uuid', 191)->nullable()->index();
21
+ $table->uuid('company_uuid')->nullable()->index();
22
+ $table->uuid('service_area_uuid')->nullable()->index();
23
+ $table->uuid('zone_uuid')->nullable()->index();
24
24
  $table->string('service_name')->nullable();
25
25
  $table->string('service_type', 191)->nullable()->index();
26
26
  $table->integer('base_fee')->default(0)->nullable();
@@ -18,10 +18,10 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
- $table->string('company_uuid', 191)->nullable()->index();
22
- $table->string('owner_uuid', 191)->nullable()->index('tracking_numbers_owner_uuid_foreign');
21
+ $table->uuid('company_uuid')->nullable()->index();
22
+ $table->uuid('owner_uuid')->nullable()->index('tracking_numbers_owner_uuid_foreign');
23
23
  $table->string('owner_type')->nullable();
24
- $table->string('status_uuid', 191)->nullable()->index('tracking_numbers_status_uuid_foreign');
24
+ $table->uuid('status_uuid')->nullable()->index('tracking_numbers_status_uuid_foreign');
25
25
  $table->string('tracking_number', 191)->nullable()->index();
26
26
  $table->string('region')->nullable();
27
27
  $table->mediumText('qr_code')->nullable();
@@ -18,8 +18,8 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->index();
21
- $table->string('company_uuid', 191)->nullable()->index('tracking_statuses_company_uuid_foreign');
22
- $table->string('tracking_number_uuid', 191)->nullable()->index('tracking_statuses_tracking_number_uuid_foreign');
21
+ $table->uuid('company_uuid')->nullable()->index('tracking_statuses_company_uuid_foreign');
22
+ $table->uuid('tracking_number_uuid')->nullable()->index('tracking_statuses_tracking_number_uuid_foreign');
23
23
  $table->char('proof_uuid', 36)->nullable();
24
24
  $table->json('meta')->nullable();
25
25
  $table->string('status', 191)->nullable()->index();
@@ -18,9 +18,9 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->index();
21
- $table->string('company_uuid', 191)->nullable()->index();
22
- $table->string('vendor_uuid', 191)->nullable()->index('vehicles_vendor_uuid_foreign');
23
- $table->string('photo_uuid', 191)->nullable()->index('vehicles_photo_uuid_foreign');
21
+ $table->uuid('company_uuid')->nullable()->index();
22
+ $table->uuid('vendor_uuid')->nullable()->index('vehicles_vendor_uuid_foreign');
23
+ $table->uuid('photo_uuid')->nullable()->index('vehicles_photo_uuid_foreign');
24
24
  $table->string('avatar_url', 300)->nullable();
25
25
  $table->string('make', 191)->nullable()->index();
26
26
  $table->string('model', 191)->nullable()->index();
@@ -18,11 +18,11 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
- $table->string('company_uuid', 191)->nullable()->index();
22
- $table->string('place_uuid', 191)->nullable()->index('vendors_place_uuid_foreign');
23
- $table->string('type_uuid', 191)->nullable()->index('vendors_type_uuid_foreign');
24
- $table->string('connect_company_uuid', 191)->nullable()->index('vendors_connect_company_uuid_foreign');
25
- $table->string('logo_uuid', 191)->nullable()->index('vendors_logo_uuid_foreign');
21
+ $table->uuid('company_uuid')->nullable()->index();
22
+ $table->uuid('place_uuid')->nullable()->index('vendors_place_uuid_foreign');
23
+ $table->uuid('type_uuid')->nullable()->index('vendors_type_uuid_foreign');
24
+ $table->uuid('connect_company_uuid')->nullable()->index('vendors_connect_company_uuid_foreign');
25
+ $table->uuid('logo_uuid')->nullable()->index('vendors_logo_uuid_foreign');
26
26
  $table->string('name')->nullable();
27
27
  $table->string('internal_id', 191)->nullable()->index();
28
28
  $table->string('business_id')->nullable();
@@ -18,10 +18,10 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id')->nullable();
21
- $table->string('company_uuid', 191)->nullable()->index('waypoints_company_uuid_foreign');
22
- $table->string('place_uuid', 191)->nullable()->index('waypoints_place_uuid_foreign');
23
- $table->string('payload_uuid', 191)->nullable()->index('waypoints_payload_uuid_foreign');
24
- $table->string('tracking_number_uuid', 191)->nullable()->index();
21
+ $table->uuid('company_uuid')->nullable()->index('waypoints_company_uuid_foreign');
22
+ $table->uuid('place_uuid')->nullable()->index('waypoints_place_uuid_foreign');
23
+ $table->uuid('payload_uuid')->nullable()->index('waypoints_payload_uuid_foreign');
24
+ $table->uuid('tracking_number_uuid')->nullable()->index();
25
25
  $table->string('_import_id', 191)->nullable()->index();
26
26
  $table->string('type')->nullable();
27
27
  $table->integer('order')->nullable();
@@ -18,8 +18,8 @@ return new class extends Migration
18
18
  $table->string('_key')->nullable();
19
19
  $table->string('uuid', 191)->nullable()->index();
20
20
  $table->string('public_id', 191)->nullable()->unique();
21
- $table->string('company_uuid', 191)->nullable()->index('zones_company_uuid_foreign');
22
- $table->string('service_area_uuid', 191)->nullable()->index();
21
+ $table->uuid('company_uuid')->nullable()->index('zones_company_uuid_foreign');
22
+ $table->uuid('service_area_uuid')->nullable()->index();
23
23
  $table->string('name')->nullable();
24
24
  $table->mediumText('description')->nullable();
25
25
  $table->polygon('border')->nullable();
@@ -0,0 +1,33 @@
1
+ <?php
2
+
3
+ use Illuminate\Database\Migrations\Migration;
4
+ use Illuminate\Database\Schema\Blueprint;
5
+ use Illuminate\Support\Facades\Schema;
6
+
7
+ class AddCategoryUuidToEntitiesTable extends Migration
8
+ {
9
+ /**
10
+ * Run the migrations.
11
+ *
12
+ * @return void
13
+ */
14
+ public function up()
15
+ {
16
+ Schema::table('entities', function (Blueprint $table) {
17
+ $table->foreignUuid('category_uuid')->nullable()->after('photo_uuid')->references('uuid')->on('categories');
18
+ });
19
+ }
20
+
21
+ /**
22
+ * Reverse the migrations.
23
+ *
24
+ * @return void
25
+ */
26
+ public function down()
27
+ {
28
+ Schema::table('entities', function (Blueprint $table) {
29
+ $table->dropForeign(['category_uuid']);
30
+ $table->dropColumn(['category_uuid']);
31
+ });
32
+ }
33
+ }