@fleetbase/storefront-engine 0.3.2 → 0.3.4
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/.php-cs-fixer.php +2 -0
- package/addon/components/modals/create-first-store.hbs +1 -1
- package/addon/components/modals/create-network.hbs +1 -1
- package/addon/components/modals/create-store.hbs +1 -1
- package/addon/components/modals/manage-addons.hbs +1 -1
- package/addon/components/modals/store-form.hbs +2 -2
- package/addon/components/storefront-order-summary.hbs +73 -0
- package/addon/components/storefront-order-summary.js +3 -0
- package/addon/components/widget/orders.js +1 -1
- package/addon/controllers/networks/index/network/index.js +5 -1
- package/addon/controllers/products/index/category/edit.js +1 -1
- package/addon/controllers/products/index/category/new.js +4 -5
- package/addon/controllers/settings/index.js +5 -1
- package/addon/engine.js +4 -0
- package/addon/templates/networks/index/network/index.hbs +1 -1
- package/addon/templates/products/index/category/new.hbs +10 -5
- package/addon/templates/settings/index.hbs +14 -4
- package/app/components/storefront-order-summary.js +1 -0
- package/composer.json +6 -4
- package/extension.json +1 -1
- package/package.json +3 -3
- package/server/migrations/2023_05_03_025307_create_carts_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_checkouts_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_gateways_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_network_stores_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_networks_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_notification_channels_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_payment_methods_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_product_addon_categories_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_product_addons_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_product_hours_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_product_store_locations_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_product_variant_options_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_product_variants_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_products_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_reviews_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_store_hours_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_store_locations_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_stores_table.php +1 -2
- package/server/migrations/2023_05_03_025307_create_votes_table.php +1 -2
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_carts_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_checkouts_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_gateways_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_network_stores_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_networks_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_notification_channels_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_payment_methods_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_addon_categories_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_addons_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_hours_table.php +1 -2
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_store_locations_table.php +1 -2
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_variant_options_table.php +1 -2
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_variants_table.php +1 -2
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_products_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_reviews_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_store_hours_table.php +1 -2
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_store_locations_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_stores_table.php +3 -4
- package/server/migrations/2023_05_03_025310_add_foreign_keys_to_votes_table.php +3 -4
- package/server/seeders/OrderConfigSeeder.php +270 -0
- package/server/src/Expansions/ContactFilterExpansion.php +1 -1
- package/server/src/Expansions/EntityExpansion.php +3 -2
- package/server/src/Expansions/OrderFilterExpansion.php +1 -1
- package/server/src/Expansions/VendorFilterExpansion.php +1 -1
- package/server/src/Http/Controllers/v1/CartController.php +0 -12
- package/server/src/Http/Controllers/v1/CheckoutController.php +37 -38
- package/server/src/Http/Resources/Network.php +1 -0
- package/server/src/Http/Resources/Store.php +1 -0
- package/server/src/Models/Cart.php +3 -11
- package/server/src/Models/Product.php +2 -5
- package/server/src/Observers/NetworkObserver.php +1 -1
- package/translations/en-us.yaml +2 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
package/server/migrations/2023_05_03_025310_add_foreign_keys_to_notification_channels_table.php
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
package/server/migrations/2023_05_03_025310_add_foreign_keys_to_product_addon_categories_table.php
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
|
+
use Fleetbase\Support\Utils;
|
|
3
4
|
use Illuminate\Database\Migrations\Migration;
|
|
4
|
-
use Illuminate\Database\Schema\Blueprint;
|
|
5
5
|
use Illuminate\Database\Query\Expression;
|
|
6
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
6
7
|
use Illuminate\Support\Facades\Schema;
|
|
7
|
-
use Fleetbase\Support\Utils;
|
|
8
8
|
|
|
9
|
-
return new class extends Migration
|
|
10
|
-
{
|
|
9
|
+
return new class() extends Migration {
|
|
11
10
|
/**
|
|
12
11
|
* Run the migrations.
|
|
13
12
|
*
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Fleetbase\Storefront\Seeders;
|
|
4
|
+
|
|
5
|
+
use Fleetbase\FleetOps\Models\OrderConfig;
|
|
6
|
+
use Fleetbase\Models\Company;
|
|
7
|
+
use Illuminate\Database\Seeder;
|
|
8
|
+
use Illuminate\Support\Str;
|
|
9
|
+
|
|
10
|
+
class OrderConfigSeeder extends Seeder
|
|
11
|
+
{
|
|
12
|
+
/**
|
|
13
|
+
* Run the database seeds.
|
|
14
|
+
*
|
|
15
|
+
* @return void
|
|
16
|
+
*/
|
|
17
|
+
public function run()
|
|
18
|
+
{
|
|
19
|
+
$companies = Company::all();
|
|
20
|
+
foreach ($companies as $company) {
|
|
21
|
+
static::createStorefrontConfig($company);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Creates or retrieves an existing storefront configuration for a given company.
|
|
27
|
+
*
|
|
28
|
+
* This method checks if a storefront configuration (OrderConfig) already exists for the given company.
|
|
29
|
+
* If it exists, the method returns the existing configuration. Otherwise, it creates a new configuration with
|
|
30
|
+
* predefined settings for a storefront order process. The configuration includes various stages like 'created',
|
|
31
|
+
* 'started', 'canceled', 'completed', etc., each defined with specific attributes like key, code, color, logic,
|
|
32
|
+
* events, status, actions, details, and more. These stages help manage the order lifecycle in a storefront context.
|
|
33
|
+
*
|
|
34
|
+
* @param Company $company The company for which the storefront configuration is being created or retrieved.
|
|
35
|
+
* @return OrderConfig The storefront order configuration associated with the specified company.
|
|
36
|
+
*/
|
|
37
|
+
public static function createStorefrontConfig(Company $company): OrderConfig
|
|
38
|
+
{
|
|
39
|
+
return OrderConfig::firstOrCreate(
|
|
40
|
+
[
|
|
41
|
+
'company_uuid' => $company->uuid,
|
|
42
|
+
'key' => 'storefront',
|
|
43
|
+
'namespace' => 'system:order-config:storefront',
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
'name' => 'Storefront',
|
|
47
|
+
'key' => 'storefront',
|
|
48
|
+
'namespace' => 'system:order-config:storefront',
|
|
49
|
+
'description' => 'Storefront order configuration for hyperlocal delivery and pickup',
|
|
50
|
+
'core_service' => 1,
|
|
51
|
+
'status' => 'private',
|
|
52
|
+
'version' => '0.0.1',
|
|
53
|
+
'tags' => ['storefront', 'ecommerce', 'hyperlocal'],
|
|
54
|
+
'entities' => [],
|
|
55
|
+
'meta' => [],
|
|
56
|
+
'flow' => [
|
|
57
|
+
'created' => [
|
|
58
|
+
'key' => 'created',
|
|
59
|
+
'code' => 'created',
|
|
60
|
+
'color' => '#1f2937',
|
|
61
|
+
'logic' => [],
|
|
62
|
+
'events' => [],
|
|
63
|
+
'status' => 'Order Created',
|
|
64
|
+
'actions' => [],
|
|
65
|
+
'details' => 'New order was created.',
|
|
66
|
+
'options' => [],
|
|
67
|
+
'complete' => false,
|
|
68
|
+
'entities' => [],
|
|
69
|
+
'sequence' => 0,
|
|
70
|
+
'activities' => ['dispatched'],
|
|
71
|
+
'internalId' => Str::uuid(),
|
|
72
|
+
'pod_method' => 'scan',
|
|
73
|
+
'require_pod' => false,
|
|
74
|
+
],
|
|
75
|
+
'started' => [
|
|
76
|
+
'key' => 'started',
|
|
77
|
+
'code' => 'started',
|
|
78
|
+
'color' => '#1f2937',
|
|
79
|
+
'logic' => [],
|
|
80
|
+
'events' => [],
|
|
81
|
+
'status' => 'Order Started',
|
|
82
|
+
'actions' => [],
|
|
83
|
+
'details' => 'Order has been started',
|
|
84
|
+
'options' => [],
|
|
85
|
+
'complete' => false,
|
|
86
|
+
'entities' => [],
|
|
87
|
+
'sequence' => 0,
|
|
88
|
+
'activities' => ['canceled', 'preparing'],
|
|
89
|
+
'internalId' => Str::uuid(),
|
|
90
|
+
'pod_method' => 'scan',
|
|
91
|
+
'require_pod' => false,
|
|
92
|
+
],
|
|
93
|
+
'canceled' => [
|
|
94
|
+
'key' => 'canceled',
|
|
95
|
+
'code' => 'canceled',
|
|
96
|
+
'color' => '#1f2937',
|
|
97
|
+
'logic' => [],
|
|
98
|
+
'events' => ['order.canceled'],
|
|
99
|
+
'status' => 'Order canceled',
|
|
100
|
+
'actions' => [],
|
|
101
|
+
'details' => 'Order could not be accepted',
|
|
102
|
+
'options' => [],
|
|
103
|
+
'complete' => false,
|
|
104
|
+
'entities' => [],
|
|
105
|
+
'sequence' => 0,
|
|
106
|
+
'activities' => [],
|
|
107
|
+
'internalId' => Str::uuid(),
|
|
108
|
+
'pod_method' => 'scan',
|
|
109
|
+
'require_pod' => false,
|
|
110
|
+
],
|
|
111
|
+
'completed' => [
|
|
112
|
+
'key' => 'completed',
|
|
113
|
+
'code' => 'completed',
|
|
114
|
+
'color' => '#1f2937',
|
|
115
|
+
'logic' => [],
|
|
116
|
+
'events' => [],
|
|
117
|
+
'status' => 'Order completed',
|
|
118
|
+
'actions' => [],
|
|
119
|
+
'details' => 'Driver has completed the order',
|
|
120
|
+
'options' => [],
|
|
121
|
+
'complete' => true,
|
|
122
|
+
'entities' => [],
|
|
123
|
+
'sequence' => 0,
|
|
124
|
+
'activities' => [],
|
|
125
|
+
'internalId' => Str::uuid(),
|
|
126
|
+
'pod_method' => 'scan',
|
|
127
|
+
'require_pod' => false,
|
|
128
|
+
],
|
|
129
|
+
'picked_up' => [
|
|
130
|
+
'key' => 'completed',
|
|
131
|
+
'code' => 'picked_up',
|
|
132
|
+
'color' => '#1f2937',
|
|
133
|
+
'logic' => [],
|
|
134
|
+
'events' => [],
|
|
135
|
+
'status' => 'Order picked up',
|
|
136
|
+
'actions' => [],
|
|
137
|
+
'details' => 'Order has been picked up by customer',
|
|
138
|
+
'options' => [],
|
|
139
|
+
'complete' => true,
|
|
140
|
+
'entities' => [],
|
|
141
|
+
'sequence' => 0,
|
|
142
|
+
'activities' => [],
|
|
143
|
+
'internalId' => Str::uuid(),
|
|
144
|
+
'pod_method' => 'scan',
|
|
145
|
+
'require_pod' => false,
|
|
146
|
+
],
|
|
147
|
+
'preparing' => [
|
|
148
|
+
'key' => 'preparing',
|
|
149
|
+
'code' => 'preparing',
|
|
150
|
+
'color' => '#1f2937',
|
|
151
|
+
'logic' => [],
|
|
152
|
+
'events' => [],
|
|
153
|
+
'status' => 'Order is being prepared',
|
|
154
|
+
'actions' => [],
|
|
155
|
+
'details' => 'Order has been received by {storefront.name} and is being prepared',
|
|
156
|
+
'options' => [],
|
|
157
|
+
'complete' => false,
|
|
158
|
+
'entities' => [],
|
|
159
|
+
'sequence' => 0,
|
|
160
|
+
'activities' => ['driver_enroute_to_store', 'pickup_ready'],
|
|
161
|
+
'internalId' => Str::uuid(),
|
|
162
|
+
'pod_method' => 'scan',
|
|
163
|
+
'require_pod' => false,
|
|
164
|
+
],
|
|
165
|
+
'dispatched' => [
|
|
166
|
+
'key' => 'dispatched',
|
|
167
|
+
'code' => 'dispatched',
|
|
168
|
+
'color' => '#1f2937',
|
|
169
|
+
'logic' => [],
|
|
170
|
+
'events' => [],
|
|
171
|
+
'status' => 'Order Dispatched',
|
|
172
|
+
'actions' => [],
|
|
173
|
+
'details' => 'Order has been dispatched.',
|
|
174
|
+
'options' => [],
|
|
175
|
+
'complete' => false,
|
|
176
|
+
'entities' => [],
|
|
177
|
+
'sequence' => 0,
|
|
178
|
+
'activities' => ['started'],
|
|
179
|
+
'internalId' => Str::uuid(),
|
|
180
|
+
'pod_method' => 'scan',
|
|
181
|
+
'require_pod' => false,
|
|
182
|
+
],
|
|
183
|
+
'pickup_ready' => [
|
|
184
|
+
'key' => 'ready',
|
|
185
|
+
'code' => 'pickup_ready',
|
|
186
|
+
'color' => '#1f2937',
|
|
187
|
+
'logic' => [
|
|
188
|
+
[
|
|
189
|
+
'type' => 'if',
|
|
190
|
+
'conditions' => [
|
|
191
|
+
[
|
|
192
|
+
'field' => 'meta.is_pickup',
|
|
193
|
+
'value' => 'true',
|
|
194
|
+
'operator' => 'equal',
|
|
195
|
+
],
|
|
196
|
+
],
|
|
197
|
+
],
|
|
198
|
+
],
|
|
199
|
+
'events' => [],
|
|
200
|
+
'status' => 'Order is ready for pickup',
|
|
201
|
+
'actions' => [],
|
|
202
|
+
'details' => 'Order is ready to be picked up by customer',
|
|
203
|
+
'options' => [],
|
|
204
|
+
'complete' => false,
|
|
205
|
+
'entities' => [],
|
|
206
|
+
'sequence' => 0,
|
|
207
|
+
'activities' => ['picked_up'],
|
|
208
|
+
'internalId' => Str::uuid(),
|
|
209
|
+
'pod_method' => 'scan',
|
|
210
|
+
'require_pod' => false,
|
|
211
|
+
],
|
|
212
|
+
'driver_enroute' => [
|
|
213
|
+
'key' => 'driver_enroute',
|
|
214
|
+
'code' => 'driver_enroute',
|
|
215
|
+
'color' => '#1f2937',
|
|
216
|
+
'logic' => [],
|
|
217
|
+
'events' => [],
|
|
218
|
+
'status' => 'Driver en-route',
|
|
219
|
+
'actions' => [],
|
|
220
|
+
'details' => 'Driver is on the way to the customer',
|
|
221
|
+
'options' => [],
|
|
222
|
+
'complete' => false,
|
|
223
|
+
'entities' => [],
|
|
224
|
+
'sequence' => 0,
|
|
225
|
+
'activities' => ['completed'],
|
|
226
|
+
'internalId' => Str::uuid(),
|
|
227
|
+
'pod_method' => 'scan',
|
|
228
|
+
'require_pod' => false,
|
|
229
|
+
],
|
|
230
|
+
'driver_picked_up' => [
|
|
231
|
+
'key' => 'driver_picked_up',
|
|
232
|
+
'code' => 'driver_picked_up',
|
|
233
|
+
'color' => '#1f2937',
|
|
234
|
+
'logic' => [],
|
|
235
|
+
'events' => [],
|
|
236
|
+
'status' => 'Driver picked up',
|
|
237
|
+
'actions' => [],
|
|
238
|
+
'details' => 'Driver has picked up order',
|
|
239
|
+
'options' => [],
|
|
240
|
+
'complete' => false,
|
|
241
|
+
'entities' => [],
|
|
242
|
+
'sequence' => 0,
|
|
243
|
+
'activities' => ['driver_enroute'],
|
|
244
|
+
'internalId' => Str::uuid(),
|
|
245
|
+
'pod_method' => 'scan',
|
|
246
|
+
'require_pod' => false,
|
|
247
|
+
],
|
|
248
|
+
'driver_enroute_to_store' => [
|
|
249
|
+
'key' => 'driver_enroute',
|
|
250
|
+
'code' => 'driver_enroute_to_store',
|
|
251
|
+
'color' => '#1f2937',
|
|
252
|
+
'logic' => [],
|
|
253
|
+
'events' => [],
|
|
254
|
+
'status' => 'Driver en-route',
|
|
255
|
+
'actions' => [],
|
|
256
|
+
'details' => 'Driver en-route to store',
|
|
257
|
+
'options' => [],
|
|
258
|
+
'complete' => false,
|
|
259
|
+
'entities' => [],
|
|
260
|
+
'sequence' => 0,
|
|
261
|
+
'activities' => ['driver_picked_up'],
|
|
262
|
+
'internalId' => Str::uuid(),
|
|
263
|
+
'pod_method' => 'scan',
|
|
264
|
+
'require_pod' => false,
|
|
265
|
+
],
|
|
266
|
+
],
|
|
267
|
+
]
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
@@ -21,7 +21,7 @@ class ContactFilterExpansion implements Expansion
|
|
|
21
21
|
*
|
|
22
22
|
* @return \Closure
|
|
23
23
|
*/
|
|
24
|
-
public function storefront()
|
|
24
|
+
public static function storefront()
|
|
25
25
|
{
|
|
26
26
|
return function (?string $storefront) {
|
|
27
27
|
/* @var \Fleetbase\FleetOps\Http\Filter\ContactFilter $this */
|
|
@@ -23,9 +23,9 @@ class EntityExpansion implements Expansion
|
|
|
23
23
|
*
|
|
24
24
|
* @return Entity
|
|
25
25
|
*/
|
|
26
|
-
public function fromStorefrontProduct()
|
|
26
|
+
public static function fromStorefrontProduct()
|
|
27
27
|
{
|
|
28
|
-
return static function (Product $product) {
|
|
28
|
+
return static function (Product $product, $meta = []) {
|
|
29
29
|
return new Entity([
|
|
30
30
|
'company_uuid' => session('company'),
|
|
31
31
|
'photo_uuid' => $product->primary_image_uuid,
|
|
@@ -39,6 +39,7 @@ class EntityExpansion implements Expansion
|
|
|
39
39
|
'meta' => [
|
|
40
40
|
'product_id' => $product->public_id,
|
|
41
41
|
'image_url' => $product->primary_image_url,
|
|
42
|
+
...$meta,
|
|
42
43
|
],
|
|
43
44
|
]);
|
|
44
45
|
};
|
|
@@ -21,7 +21,7 @@ class OrderFilterExpansion implements Expansion
|
|
|
21
21
|
*
|
|
22
22
|
* @return \Closure
|
|
23
23
|
*/
|
|
24
|
-
public function storefront()
|
|
24
|
+
public static function storefront()
|
|
25
25
|
{
|
|
26
26
|
return function (?string $storefront) {
|
|
27
27
|
/* @var \Fleetbase\FleetOps\Http\Filter\OrderFilter $this */
|
|
@@ -21,7 +21,7 @@ class VendorFilterExpansion implements Expansion
|
|
|
21
21
|
*
|
|
22
22
|
* @return \Closure
|
|
23
23
|
*/
|
|
24
|
-
public function storefront()
|
|
24
|
+
public static function storefront()
|
|
25
25
|
{
|
|
26
26
|
return function (?string $storefront) {
|
|
27
27
|
/* @var \Fleetbase\FleetOps\Http\Filter\VendorFilter $this */
|
|
@@ -19,9 +19,6 @@ class CartController extends Controller
|
|
|
19
19
|
{
|
|
20
20
|
$cart = Cart::retrieve($uniqueId, true);
|
|
21
21
|
|
|
22
|
-
// reset currency
|
|
23
|
-
$cart->resetCurrency();
|
|
24
|
-
|
|
25
22
|
return new StorefrontCart($cart);
|
|
26
23
|
}
|
|
27
24
|
|
|
@@ -49,9 +46,6 @@ class CartController extends Controller
|
|
|
49
46
|
return response()->error($e->getMessage());
|
|
50
47
|
}
|
|
51
48
|
|
|
52
|
-
// reset currency
|
|
53
|
-
$cart->resetCurrency();
|
|
54
|
-
|
|
55
49
|
return new StorefrontCart($cart);
|
|
56
50
|
}
|
|
57
51
|
|
|
@@ -80,9 +74,6 @@ class CartController extends Controller
|
|
|
80
74
|
return response()->error($e->getMessage());
|
|
81
75
|
}
|
|
82
76
|
|
|
83
|
-
// reset currency
|
|
84
|
-
$cart->resetCurrency();
|
|
85
|
-
|
|
86
77
|
return new StorefrontCart($cart);
|
|
87
78
|
}
|
|
88
79
|
|
|
@@ -107,9 +98,6 @@ class CartController extends Controller
|
|
|
107
98
|
return response()->error($e->getMessage());
|
|
108
99
|
}
|
|
109
100
|
|
|
110
|
-
// reset currency
|
|
111
|
-
$cart->resetCurrency();
|
|
112
|
-
|
|
113
101
|
return new StorefrontCart($cart);
|
|
114
102
|
}
|
|
115
103
|
|