@fleetbase/storefront-engine 0.2.4 → 0.2.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.
- package/README.md +4 -4
- package/addon/components/modals/import-products.hbs +1 -1
- package/addon/components/schedule-manager.hbs +2 -2
- package/addon/components/widget/customers.hbs +1 -1
- package/addon/components/widget/customers.js +7 -4
- package/addon/components/widget/orders.js +4 -0
- package/addon/controllers/base-controller.js +31 -0
- package/addon/controllers/networks/index/network.js +2 -2
- package/addon/controllers/networks/index.js +3 -2
- package/addon/controllers/products/index/category/new.js +14 -11
- package/addon/controllers/products/index/category.js +2 -2
- package/addon/controllers/products/index/index.js +2 -2
- package/addon/controllers/products/index.js +2 -3
- package/addon/models/network.js +0 -1
- package/addon/models/product-addon-category.js +10 -1
- package/addon/models/product-variant.js +0 -2
- package/addon/models/product.js +35 -2
- package/addon/routes/customers/index.js +11 -1
- package/addon/routes/networks/index.js +9 -0
- package/addon/routes/orders/index.js +11 -1
- package/addon/routes/products/index.js +8 -2
- package/addon/serializers/product.js +16 -0
- package/addon/services/storefront.js +81 -0
- package/addon/templates/networks/index/network/stores.hbs +2 -2
- package/addon/templates/networks/index/network.hbs +1 -1
- package/addon/templates/products/index/category/new.hbs +3 -3
- package/addon/templates/products/index/category.hbs +20 -3
- package/app/controllers/base-controller.js +1 -0
- package/assets/sounds/storefront_order_alert.mp3 +0 -0
- package/composer.json +3 -3
- package/config/environment.js +11 -1
- package/extension.json +1 -1
- package/index.js +15 -0
- package/package.json +132 -125
- package/server/src/Auth/Schemas/Storefront.php +31 -39
- package/server/src/Console/Commands/NotifyStorefrontOrderNearby.php +9 -11
- package/server/src/Expansions/ContactFilterExpansion.php +36 -0
- package/server/src/Expansions/EntityExpansion.php +12 -12
- package/server/src/Expansions/OrderFilterExpansion.php +31 -0
- package/server/src/Expansions/VendorFilterExpansion.php +36 -0
- package/server/src/Http/Controllers/ActionController.php +9 -11
- package/server/src/Http/Controllers/AddonCategoryController.php +1 -1
- package/server/src/Http/Controllers/CustomerController.php +1 -1
- package/server/src/Http/Controllers/GatewayController.php +1 -1
- package/server/src/Http/Controllers/MetricsController.php +17 -17
- package/server/src/Http/Controllers/NetworkController.php +16 -26
- package/server/src/Http/Controllers/NotificationChannelController.php +1 -1
- package/server/src/Http/Controllers/OrderController.php +18 -22
- package/server/src/Http/Controllers/ProductAddonCategoryController.php +1 -2
- package/server/src/Http/Controllers/ProductAddonController.php +1 -2
- package/server/src/Http/Controllers/ProductController.php +89 -44
- package/server/src/Http/Controllers/ProductHourController.php +1 -1
- package/server/src/Http/Controllers/ProductVariantController.php +1 -1
- package/server/src/Http/Controllers/ProductVariantOptionController.php +1 -1
- package/server/src/Http/Controllers/ReviewController.php +1 -1
- package/server/src/Http/Controllers/StoreController.php +1 -2
- package/server/src/Http/Controllers/StoreHourController.php +1 -1
- package/server/src/Http/Controllers/StoreLocationController.php +1 -1
- package/server/src/Http/Controllers/StorefrontController.php +0 -2
- package/server/src/Http/Controllers/VoteController.php +1 -1
- package/server/src/Http/Controllers/v1/CartController.php +16 -26
- package/server/src/Http/Controllers/v1/CategoryController.php +3 -4
- package/server/src/Http/Controllers/v1/CheckoutController.php +283 -286
- package/server/src/Http/Controllers/v1/CustomerController.php +54 -67
- package/server/src/Http/Controllers/v1/GatewayControllerController.php +0 -2
- package/server/src/Http/Controllers/v1/NetworkController.php +26 -23
- package/server/src/Http/Controllers/v1/PaymentMethodController.php +0 -2
- package/server/src/Http/Controllers/v1/ProductController.php +1 -4
- package/server/src/Http/Controllers/v1/ReviewController.php +31 -35
- package/server/src/Http/Controllers/v1/ServiceQuoteController.php +57 -53
- package/server/src/Http/Controllers/v1/StoreController.php +8 -16
- package/server/src/Http/Filter/AddonCategoryFilter.php +1 -1
- package/server/src/Http/Filter/OrderFilter.php +2 -2
- package/server/src/Http/Middleware/SetStorefrontSession.php +9 -20
- package/server/src/Http/Requests/AddStoreToNetworkCategory.php +3 -3
- package/server/src/Http/Requests/CreateCustomerRequest.php +5 -7
- package/server/src/Http/Requests/CreateReviewRequest.php +4 -5
- package/server/src/Http/Requests/GetServiceQuoteFromCart.php +2 -2
- package/server/src/Http/Requests/InitializeCheckoutRequest.php +5 -5
- package/server/src/Http/Requests/NetworkActionRequest.php +2 -2
- package/server/src/Http/Requests/VerifyCreateCustomerRequest.php +2 -2
- package/server/src/Http/Resources/Cart.php +20 -11
- package/server/src/Http/Resources/Category.php +12 -11
- package/server/src/Http/Resources/Customer.php +15 -14
- package/server/src/Http/Resources/Gateway.php +12 -11
- package/server/src/Http/Resources/Media.php +9 -8
- package/server/src/Http/Resources/Network.php +33 -28
- package/server/src/Http/Resources/Product.php +89 -81
- package/server/src/Http/Resources/Review.php +14 -13
- package/server/src/Http/Resources/ReviewCustomer.php +12 -11
- package/server/src/Http/Resources/Store.php +39 -33
- package/server/src/Http/Resources/StoreHour.php +9 -8
- package/server/src/Http/Resources/StoreLocation.php +9 -9
- package/server/src/Imports/ProductsImport.php +0 -2
- package/server/src/Jobs/DownloadProductImageUrl.php +7 -4
- package/server/src/Listeners/HandleOrderCompleted.php +2 -1
- package/server/src/Listeners/HandleOrderDispatched.php +2 -1
- package/server/src/Listeners/HandleOrderDriverAssigned.php +2 -1
- package/server/src/Listeners/HandleOrderStarted.php +4 -3
- package/server/src/Mail/StorefrontNetworkInvite.php +7 -6
- package/server/src/Models/AddonCategory.php +2 -4
- package/server/src/Models/Cart.php +117 -124
- package/server/src/Models/Checkout.php +14 -12
- package/server/src/Models/Customer.php +9 -9
- package/server/src/Models/Gateway.php +22 -22
- package/server/src/Models/Network.php +41 -52
- package/server/src/Models/NetworkStore.php +6 -5
- package/server/src/Models/NotificationChannel.php +11 -9
- package/server/src/Models/PaymentMethod.php +9 -7
- package/server/src/Models/Product.php +152 -30
- package/server/src/Models/ProductAddon.php +14 -11
- package/server/src/Models/ProductAddonCategory.php +9 -8
- package/server/src/Models/ProductHour.php +6 -5
- package/server/src/Models/ProductStoreLocation.php +7 -5
- package/server/src/Models/ProductVariant.php +15 -11
- package/server/src/Models/ProductVariantOption.php +12 -9
- package/server/src/Models/Review.php +9 -7
- package/server/src/Models/Store.php +68 -84
- package/server/src/Models/StoreHour.php +6 -5
- package/server/src/Models/StoreLocation.php +12 -8
- package/server/src/Models/StorefrontModel.php +1 -1
- package/server/src/Models/Vote.php +8 -6
- package/server/src/Notifications/StorefrontOrderCanceled.php +15 -19
- package/server/src/Notifications/StorefrontOrderCompleted.php +15 -19
- package/server/src/Notifications/StorefrontOrderCreated.php +31 -36
- package/server/src/Notifications/StorefrontOrderDriverAssigned.php +15 -20
- package/server/src/Notifications/StorefrontOrderEnroute.php +14 -19
- package/server/src/Notifications/StorefrontOrderNearby.php +16 -21
- package/server/src/Notifications/StorefrontOrderPreparing.php +15 -18
- package/server/src/Notifications/StorefrontOrderReadyForPickup.php +15 -18
- package/server/src/Observers/NetworkObserver.php +2 -3
- package/server/src/Observers/ProductObserver.php +17 -33
- package/server/src/Providers/EventServiceProvider.php +15 -4
- package/server/src/Providers/StorefrontServiceProvider.php +8 -10
- package/server/src/Support/Metrics.php +12 -12
- package/server/src/Support/OrderConfig.php +3 -2
- package/server/src/Support/QPay.php +22 -20
- package/server/src/Support/Storefront.php +18 -17
- package/server/src/routes.php +1 -1
- package/tsconfig.declarations.json +10 -0
|
@@ -3,20 +3,22 @@
|
|
|
3
3
|
namespace Fleetbase\Storefront\Models;
|
|
4
4
|
|
|
5
5
|
use Fleetbase\Casts\Json;
|
|
6
|
-
use Fleetbase\
|
|
6
|
+
use Fleetbase\FleetOps\Support\Utils;
|
|
7
7
|
use Fleetbase\Models\Company;
|
|
8
8
|
use Fleetbase\Models\File;
|
|
9
|
-
use Fleetbase\
|
|
10
|
-
use Fleetbase\Traits\HasUuid;
|
|
9
|
+
use Fleetbase\Models\User;
|
|
11
10
|
use Fleetbase\Traits\HasApiModelBehavior;
|
|
12
11
|
use Fleetbase\Traits\HasPublicid;
|
|
12
|
+
use Fleetbase\Traits\HasUuid;
|
|
13
13
|
|
|
14
14
|
class Gateway extends StorefrontModel
|
|
15
15
|
{
|
|
16
|
-
use HasUuid
|
|
16
|
+
use HasUuid;
|
|
17
|
+
use HasPublicid;
|
|
18
|
+
use HasApiModelBehavior;
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
|
-
* The type of public Id to generate
|
|
21
|
+
* The type of public Id to generate.
|
|
20
22
|
*
|
|
21
23
|
* @var string
|
|
22
24
|
*/
|
|
@@ -30,7 +32,7 @@ class Gateway extends StorefrontModel
|
|
|
30
32
|
protected $table = 'gateways';
|
|
31
33
|
|
|
32
34
|
/**
|
|
33
|
-
* These attributes that can be queried
|
|
35
|
+
* These attributes that can be queried.
|
|
34
36
|
*
|
|
35
37
|
* @var array
|
|
36
38
|
*/
|
|
@@ -50,12 +52,12 @@ class Gateway extends StorefrontModel
|
|
|
50
52
|
*/
|
|
51
53
|
protected $casts = [
|
|
52
54
|
'sandbox' => 'boolean',
|
|
53
|
-
'meta'
|
|
54
|
-
'config'
|
|
55
|
+
'meta' => Json::class,
|
|
56
|
+
'config' => Json::class,
|
|
55
57
|
];
|
|
56
58
|
|
|
57
59
|
/**
|
|
58
|
-
* Dynamic attributes that are appended to object
|
|
60
|
+
* Dynamic attributes that are appended to object.
|
|
59
61
|
*
|
|
60
62
|
* @var array
|
|
61
63
|
*/
|
|
@@ -106,13 +108,13 @@ class Gateway extends StorefrontModel
|
|
|
106
108
|
public function getLogoUrlAttribute()
|
|
107
109
|
{
|
|
108
110
|
$default = $this->logoFile->url ?? null;
|
|
109
|
-
$backup
|
|
111
|
+
$backup = 'https://flb-assets.s3.ap-southeast-1.amazonaws.com/static/image-file-icon.png';
|
|
110
112
|
|
|
111
113
|
return $default ?? $backup;
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
/**
|
|
115
|
-
* Sets the owner type
|
|
117
|
+
* Sets the owner type.
|
|
116
118
|
*/
|
|
117
119
|
public function setOwnerTypeAttribute($type)
|
|
118
120
|
{
|
|
@@ -121,7 +123,7 @@ class Gateway extends StorefrontModel
|
|
|
121
123
|
|
|
122
124
|
public function getConfigAttribute($config)
|
|
123
125
|
{
|
|
124
|
-
$config
|
|
126
|
+
$config = Json::decode($config);
|
|
125
127
|
$sortedKeys = collect($config)->keys()->sort(function ($key) use ($config) {
|
|
126
128
|
return Utils::isBooleanValue($config[$key]) ? 1 : 0;
|
|
127
129
|
});
|
|
@@ -145,21 +147,19 @@ class Gateway extends StorefrontModel
|
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
/**
|
|
148
|
-
* Generates a new cash/cash on delivery gateway
|
|
149
|
-
*
|
|
150
|
-
* @return Gateway
|
|
150
|
+
* Generates a new cash/cash on delivery gateway.
|
|
151
151
|
*/
|
|
152
152
|
public static function cash($attributes = ['sandbox' => 0]): Gateway
|
|
153
153
|
{
|
|
154
154
|
return new static([
|
|
155
|
-
'public_id'
|
|
156
|
-
'name'
|
|
157
|
-
'code'
|
|
158
|
-
'type'
|
|
159
|
-
'sandbox'
|
|
160
|
-
'return_url'
|
|
155
|
+
'public_id' => 'gateway_cash',
|
|
156
|
+
'name' => 'Cash',
|
|
157
|
+
'code' => 'cash',
|
|
158
|
+
'type' => 'cash',
|
|
159
|
+
'sandbox' => $attributes['sandbox'],
|
|
160
|
+
'return_url' => null,
|
|
161
161
|
'callback_url' => null,
|
|
162
|
-
...$attributes
|
|
162
|
+
...$attributes,
|
|
163
163
|
]);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
namespace Fleetbase\Storefront\Models;
|
|
4
4
|
|
|
5
5
|
use Fleetbase\Casts\Json;
|
|
6
|
+
use Fleetbase\FleetOps\Support\Utils;
|
|
6
7
|
use Fleetbase\Models\Category;
|
|
7
|
-
use Fleetbase\Models\User;
|
|
8
8
|
use Fleetbase\Models\Company;
|
|
9
9
|
use Fleetbase\Models\File;
|
|
10
10
|
use Fleetbase\Models\Invite;
|
|
11
|
-
use Fleetbase\
|
|
12
|
-
use Fleetbase\Traits\HasOptionsAttributes;
|
|
13
|
-
use Fleetbase\Traits\HasUuid;
|
|
11
|
+
use Fleetbase\Models\User;
|
|
14
12
|
use Fleetbase\Traits\HasApiModelBehavior;
|
|
13
|
+
use Fleetbase\Traits\HasOptionsAttributes;
|
|
15
14
|
use Fleetbase\Traits\HasPublicid;
|
|
15
|
+
use Fleetbase\Traits\HasUuid;
|
|
16
16
|
use Fleetbase\Traits\Searchable;
|
|
17
17
|
use Illuminate\Support\Str;
|
|
18
18
|
use Spatie\Sluggable\HasSlug;
|
|
@@ -20,10 +20,15 @@ use Spatie\Sluggable\SlugOptions;
|
|
|
20
20
|
|
|
21
21
|
class Network extends StorefrontModel
|
|
22
22
|
{
|
|
23
|
-
use HasUuid
|
|
23
|
+
use HasUuid;
|
|
24
|
+
use HasPublicId;
|
|
25
|
+
use HasApiModelBehavior;
|
|
26
|
+
use HasOptionsAttributes;
|
|
27
|
+
use HasSlug;
|
|
28
|
+
use Searchable;
|
|
24
29
|
|
|
25
30
|
/**
|
|
26
|
-
* The type of public Id to generate
|
|
31
|
+
* The type of public Id to generate.
|
|
27
32
|
*
|
|
28
33
|
* @var string
|
|
29
34
|
*/
|
|
@@ -37,7 +42,7 @@ class Network extends StorefrontModel
|
|
|
37
42
|
protected $table = 'networks';
|
|
38
43
|
|
|
39
44
|
/**
|
|
40
|
-
* These attributes that can be queried
|
|
45
|
+
* These attributes that can be queried.
|
|
41
46
|
*
|
|
42
47
|
* @var array
|
|
43
48
|
*/
|
|
@@ -56,15 +61,15 @@ class Network extends StorefrontModel
|
|
|
56
61
|
* @var array
|
|
57
62
|
*/
|
|
58
63
|
protected $casts = [
|
|
59
|
-
'options'
|
|
64
|
+
'options' => Json::class,
|
|
60
65
|
'translations' => Json::class,
|
|
61
|
-
'alertable'
|
|
62
|
-
'tags'
|
|
63
|
-
'online'
|
|
66
|
+
'alertable' => Json::class,
|
|
67
|
+
'tags' => 'array',
|
|
68
|
+
'online' => 'boolean',
|
|
64
69
|
];
|
|
65
70
|
|
|
66
71
|
/**
|
|
67
|
-
* Dynamic attributes that are appended to object
|
|
72
|
+
* Dynamic attributes that are appended to object.
|
|
68
73
|
*
|
|
69
74
|
* @var array
|
|
70
75
|
*/
|
|
@@ -205,7 +210,7 @@ class Network extends StorefrontModel
|
|
|
205
210
|
}
|
|
206
211
|
|
|
207
212
|
/**
|
|
208
|
-
* @var
|
|
213
|
+
* @var int
|
|
209
214
|
*/
|
|
210
215
|
public function getStoresCountAttribute()
|
|
211
216
|
{
|
|
@@ -213,40 +218,30 @@ class Network extends StorefrontModel
|
|
|
213
218
|
}
|
|
214
219
|
|
|
215
220
|
/**
|
|
216
|
-
* Adds a new store to the network
|
|
217
|
-
*
|
|
218
|
-
* @param Store $store
|
|
219
|
-
* @param Category|null $category
|
|
220
|
-
* @return NetworkStore
|
|
221
|
+
* Adds a new store to the network.
|
|
221
222
|
*/
|
|
222
|
-
public function addStore(Store $store,
|
|
223
|
+
public function addStore(Store $store, Category $category = null): NetworkStore
|
|
223
224
|
{
|
|
224
225
|
return NetworkStore::updateOrCreate(
|
|
225
226
|
[
|
|
226
227
|
'network_uuid' => $this->uuid,
|
|
227
|
-
'store_uuid'
|
|
228
|
+
'store_uuid' => $store->uuid,
|
|
228
229
|
],
|
|
229
230
|
[
|
|
230
|
-
'network_uuid'
|
|
231
|
-
'store_uuid'
|
|
232
|
-
'category_uuid' => $category instanceof Category ? $category->uuid : null
|
|
231
|
+
'network_uuid' => $this->uuid,
|
|
232
|
+
'store_uuid' => $store->uuid,
|
|
233
|
+
'category_uuid' => $category instanceof Category ? $category->uuid : null,
|
|
233
234
|
]
|
|
234
235
|
);
|
|
235
236
|
}
|
|
236
237
|
|
|
237
238
|
/**
|
|
238
|
-
*'Create a new network store category for this store record
|
|
239
|
+
*'Create a new network store category for this store record.
|
|
239
240
|
*
|
|
240
|
-
* @param string $name
|
|
241
|
-
* @param string $description
|
|
242
|
-
* @param array|null $meta
|
|
243
|
-
* @param array|null $translations
|
|
244
|
-
* @param Category|null $parent
|
|
245
241
|
* @param File|string|null $icon
|
|
246
|
-
* @param string
|
|
247
|
-
* @return Category
|
|
242
|
+
* @param string $iconColor
|
|
248
243
|
*/
|
|
249
|
-
public function createCategory(string $name, string $description = '', ?array $meta = [],
|
|
244
|
+
public function createCategory(string $name, string $description = '', ?array $meta = [], ?array $translations = [], Category $parent = null, $icon = null, $iconColor = '#000000'): Category
|
|
250
245
|
{
|
|
251
246
|
$iconFile = null;
|
|
252
247
|
$iconName = null;
|
|
@@ -260,34 +255,28 @@ class Network extends StorefrontModel
|
|
|
260
255
|
}
|
|
261
256
|
|
|
262
257
|
return Category::create([
|
|
263
|
-
'company_uuid'
|
|
264
|
-
'owner_uuid'
|
|
265
|
-
'owner_type'
|
|
266
|
-
'parent_uuid'
|
|
258
|
+
'company_uuid' => $this->company_uuid,
|
|
259
|
+
'owner_uuid' => $this->uuid,
|
|
260
|
+
'owner_type' => Utils::getMutationType('network:storefront'),
|
|
261
|
+
'parent_uuid' => $parent instanceof Category ? $parent->uuid : null,
|
|
267
262
|
'icon_file_uuid' => $iconFile->uuid,
|
|
268
|
-
'for'
|
|
269
|
-
'name'
|
|
270
|
-
'description'
|
|
271
|
-
'translations'
|
|
272
|
-
'meta'
|
|
273
|
-
'icon'
|
|
274
|
-
'icon_color'
|
|
263
|
+
'for' => 'storefront_network',
|
|
264
|
+
'name' => $name,
|
|
265
|
+
'description' => $description,
|
|
266
|
+
'translations' => $translations,
|
|
267
|
+
'meta' => $meta,
|
|
268
|
+
'icon' => $iconName,
|
|
269
|
+
'icon_color' => $iconColor,
|
|
275
270
|
]);
|
|
276
271
|
}
|
|
277
272
|
|
|
278
273
|
/**
|
|
279
|
-
* Create a new network store category if it doesn't already exists for this store record
|
|
274
|
+
* Create a new network store category if it doesn't already exists for this store record.
|
|
280
275
|
*
|
|
281
|
-
* @param string $name
|
|
282
|
-
* @param string $description
|
|
283
|
-
* @param array|null $meta
|
|
284
|
-
* @param array|null $translations
|
|
285
|
-
* @param Category|null $parent
|
|
286
276
|
* @param File|string|null $icon
|
|
287
|
-
* @param string
|
|
288
|
-
* @return Category
|
|
277
|
+
* @param string $iconColor
|
|
289
278
|
*/
|
|
290
|
-
public function createCategoryStrict(string $name, string $description = '', ?array $meta = [],
|
|
279
|
+
public function createCategoryStrict(string $name, string $description = '', ?array $meta = [], ?array $translations = [], Category $parent = null, $icon = null, $iconColor = '#000000'): Category
|
|
291
280
|
{
|
|
292
281
|
$existingCategory = Category::where(['company_uuid' => $this->company_uuid, 'owner_uuid' => $this->uuid, 'name' => $name])->first();
|
|
293
282
|
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
namespace Fleetbase\Storefront\Models;
|
|
4
4
|
|
|
5
5
|
use Fleetbase\Models\Category;
|
|
6
|
-
use Fleetbase\Traits\HasUuid;
|
|
7
6
|
use Fleetbase\Traits\HasApiModelBehavior;
|
|
7
|
+
use Fleetbase\Traits\HasUuid;
|
|
8
8
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
|
9
9
|
|
|
10
10
|
class NetworkStore extends Pivot
|
|
11
11
|
{
|
|
12
|
-
use HasUuid
|
|
12
|
+
use HasUuid;
|
|
13
|
+
use HasApiModelBehavior;
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* The database table used by the model.
|
|
@@ -19,7 +20,7 @@ class NetworkStore extends Pivot
|
|
|
19
20
|
protected $table = 'network_stores';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
|
-
* These attributes that can be queried
|
|
23
|
+
* These attributes that can be queried.
|
|
23
24
|
*
|
|
24
25
|
* @var array
|
|
25
26
|
*/
|
|
@@ -40,7 +41,7 @@ class NetworkStore extends Pivot
|
|
|
40
41
|
protected $casts = [];
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
|
-
* Dynamic attributes that are appended to object
|
|
44
|
+
* Dynamic attributes that are appended to object.
|
|
44
45
|
*
|
|
45
46
|
* @var array
|
|
46
47
|
*/
|
|
@@ -49,7 +50,7 @@ class NetworkStore extends Pivot
|
|
|
49
50
|
/**
|
|
50
51
|
* Create a new instance of the model.
|
|
51
52
|
*
|
|
52
|
-
* @param array $attributes
|
|
53
|
+
* @param array $attributes the attributes to set on the model
|
|
53
54
|
*
|
|
54
55
|
* @return void
|
|
55
56
|
*/
|
|
@@ -4,17 +4,19 @@ namespace Fleetbase\Storefront\Models;
|
|
|
4
4
|
|
|
5
5
|
use Fleetbase\Casts\Json;
|
|
6
6
|
use Fleetbase\Casts\PolymorphicType;
|
|
7
|
-
use Fleetbase\Models\User;
|
|
8
|
-
use Fleetbase\Models\Company;
|
|
9
7
|
use Fleetbase\FleetOps\Support\Utils;
|
|
8
|
+
use Fleetbase\Models\Company;
|
|
9
|
+
use Fleetbase\Models\User;
|
|
10
|
+
use Fleetbase\Traits\HasApiModelBehavior;
|
|
10
11
|
use Fleetbase\Traits\HasOptionsAttributes;
|
|
11
12
|
use Fleetbase\Traits\HasUuid;
|
|
12
|
-
use Fleetbase\Traits\HasApiModelBehavior;
|
|
13
13
|
use Illuminate\Support\Str;
|
|
14
14
|
|
|
15
15
|
class NotificationChannel extends StorefrontModel
|
|
16
16
|
{
|
|
17
|
-
use HasUuid
|
|
17
|
+
use HasUuid;
|
|
18
|
+
use HasApiModelBehavior;
|
|
19
|
+
use HasOptionsAttributes;
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* The database table used by the model.
|
|
@@ -24,7 +26,7 @@ class NotificationChannel extends StorefrontModel
|
|
|
24
26
|
protected $table = 'notification_channels';
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
|
-
* These attributes that can be queried
|
|
29
|
+
* These attributes that can be queried.
|
|
28
30
|
*
|
|
29
31
|
* @var array
|
|
30
32
|
*/
|
|
@@ -44,12 +46,12 @@ class NotificationChannel extends StorefrontModel
|
|
|
44
46
|
*/
|
|
45
47
|
protected $casts = [
|
|
46
48
|
// 'config' => Json::class,
|
|
47
|
-
'options'
|
|
48
|
-
'owner_type' => PolymorphicType::class
|
|
49
|
+
'options' => Json::class,
|
|
50
|
+
'owner_type' => PolymorphicType::class,
|
|
49
51
|
];
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
|
-
* Dynamic attributes that are appended to object
|
|
54
|
+
* Dynamic attributes that are appended to object.
|
|
53
55
|
*
|
|
54
56
|
* @var array
|
|
55
57
|
*/
|
|
@@ -97,7 +99,7 @@ class NotificationChannel extends StorefrontModel
|
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
/**
|
|
100
|
-
* Sets the owner type
|
|
102
|
+
* Sets the owner type.
|
|
101
103
|
*/
|
|
102
104
|
public function setOwnerTypeAttribute($type)
|
|
103
105
|
{
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
namespace Fleetbase\Storefront\Models;
|
|
4
4
|
|
|
5
5
|
use Fleetbase\Casts\Json;
|
|
6
|
-
use Fleetbase\Models\User;
|
|
7
6
|
use Fleetbase\Models\Company;
|
|
8
|
-
use Fleetbase\
|
|
7
|
+
use Fleetbase\Models\User;
|
|
9
8
|
use Fleetbase\Traits\HasApiModelBehavior;
|
|
10
9
|
use Fleetbase\Traits\HasPublicid;
|
|
10
|
+
use Fleetbase\Traits\HasUuid;
|
|
11
11
|
|
|
12
12
|
class PaymentMethod extends StorefrontModel
|
|
13
13
|
{
|
|
14
|
-
use HasUuid
|
|
14
|
+
use HasUuid;
|
|
15
|
+
use HasPublicid;
|
|
16
|
+
use HasApiModelBehavior;
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
|
-
* The type of public Id to generate
|
|
19
|
+
* The type of public Id to generate.
|
|
18
20
|
*
|
|
19
21
|
* @var string
|
|
20
22
|
*/
|
|
@@ -28,7 +30,7 @@ class PaymentMethod extends StorefrontModel
|
|
|
28
30
|
protected $table = 'payment_methods';
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
|
-
* These attributes that can be queried
|
|
33
|
+
* These attributes that can be queried.
|
|
32
34
|
*
|
|
33
35
|
* @var array
|
|
34
36
|
*/
|
|
@@ -47,11 +49,11 @@ class PaymentMethod extends StorefrontModel
|
|
|
47
49
|
* @var array
|
|
48
50
|
*/
|
|
49
51
|
protected $casts = [
|
|
50
|
-
'meta' => Json::class
|
|
52
|
+
'meta' => Json::class,
|
|
51
53
|
];
|
|
52
54
|
|
|
53
55
|
/**
|
|
54
|
-
* Dynamic attributes that are appended to object
|
|
56
|
+
* Dynamic attributes that are appended to object.
|
|
55
57
|
*
|
|
56
58
|
* @var array
|
|
57
59
|
*/
|