diff --git a/.env.example b/.env.example index da3433d65..46a9fc46f 100644 --- a/.env.example +++ b/.env.example @@ -70,3 +70,5 @@ LINKEDIN_CALLBACK_URL=https://yourhost.com/customer/social-login/linkedin/callba GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= GITHUB_CALLBACK_URL=https://yourhost.com/customer/social-login/github/callback +INTEGRATION_SECRET= +HTTP_MANAGER_ADDRESS= \ No newline at end of file diff --git a/packages/Sarga/API/Http/Controllers/IntegrationController.php b/packages/Sarga/API/Http/Controllers/IntegrationController.php index 25c63e253..5fd49a9ba 100644 --- a/packages/Sarga/API/Http/Controllers/IntegrationController.php +++ b/packages/Sarga/API/Http/Controllers/IntegrationController.php @@ -93,4 +93,8 @@ class IntegrationController extends Controller } } + public function updateOrderStatus(){ + Log::info(request()->input()); + } + } \ No newline at end of file diff --git a/packages/Sarga/API/Http/routes.php b/packages/Sarga/API/Http/routes.php index f2a5da919..459f7014d 100644 --- a/packages/Sarga/API/Http/routes.php +++ b/packages/Sarga/API/Http/routes.php @@ -136,6 +136,7 @@ Route::group(['prefix' => 'api'], function () { Route::put('upload',[IntegrationController::class,'bulk_upload']); Route::put('create',[IntegrationController::class,'create']); Route::put('update',[IntegrationController::class,'update']); + Route::post('order',[IntegrationController::class,'updateOrderStatus']); }); }); diff --git a/packages/Sarga/Admin/src/Http/Resources/CustomerResource.php b/packages/Sarga/Admin/src/Http/Resources/CustomerResource.php new file mode 100644 index 000000000..bd33dc9cd --- /dev/null +++ b/packages/Sarga/Admin/src/Http/Resources/CustomerResource.php @@ -0,0 +1,18 @@ + $this->name, + 'phone' => $this->phone, + 'token' => env('INTEGRATION_SECRET') + ]; + } + +} \ No newline at end of file diff --git a/packages/Sarga/Admin/src/Http/Resources/OrderItemResource.php b/packages/Sarga/Admin/src/Http/Resources/OrderItemResource.php new file mode 100644 index 000000000..0b0e1cc55 --- /dev/null +++ b/packages/Sarga/Admin/src/Http/Resources/OrderItemResource.php @@ -0,0 +1,19 @@ + $this->order_id, + 'ty_item_number', + 'quantity' => $this->qty_order_id, + 'price' => $this->total, + 'order_date' => $this->created_at, + ]; + } +} \ No newline at end of file diff --git a/packages/Sarga/Admin/src/Http/Resources/OrderResource.php b/packages/Sarga/Admin/src/Http/Resources/OrderResource.php new file mode 100644 index 000000000..39ceff931 --- /dev/null +++ b/packages/Sarga/Admin/src/Http/Resources/OrderResource.php @@ -0,0 +1,17 @@ + $this->customer()->phone, + 'items' => OrderItemResource::collection($this->items), + 'token' => env('INTEGRATION_SECRET') + ]; + } +} \ No newline at end of file diff --git a/packages/Sarga/Admin/src/Listeners/Customer.php b/packages/Sarga/Admin/src/Listeners/Customer.php new file mode 100644 index 000000000..49efea28a --- /dev/null +++ b/packages/Sarga/Admin/src/Listeners/Customer.php @@ -0,0 +1,26 @@ +addTemplate('sarga_admin::catalog.categories.scrap.create'); // });