From 65d693047c558702a32342fd3d34767b831927d4 Mon Sep 17 00:00:00 2001 From: AntyAnti <146710479+AntyAnti@users.noreply.github.com> Date: Thu, 13 Aug 2026 13:45:34 +0200 Subject: [PATCH] [create-pull-request] automated change --- init.php | 8 ++ .../Entity/AbandonedCartSnapshot.php | 109 ++++++++++++++++++ .../Entity/AbandonedCartSnapshot/Coupon.php | 59 ++++++++++ .../Entity/AbandonedCartSnapshot/Customer.php | 45 ++++++++ .../Entity/AbandonedCartSnapshot/Items.php | 31 +++++ .../AbandonedCartSnapshot/Items/Item.php | 45 ++++++++ .../GetListOfAllAbandonedCarts.php | 40 +++++++ .../GetListOfAllAbandonedCartsResponse.php | 48 ++++++++ .../Data.php | 21 ++++ src/Endpoint/EndpointMap.php | 1 + src/Sdk.php | 23 ++++ 11 files changed, 430 insertions(+) create mode 100644 src/Component/Entity/AbandonedCartSnapshot.php create mode 100644 src/Component/Entity/AbandonedCartSnapshot/Coupon.php create mode 100644 src/Component/Entity/AbandonedCartSnapshot/Customer.php create mode 100644 src/Component/Entity/AbandonedCartSnapshot/Items.php create mode 100644 src/Component/Entity/AbandonedCartSnapshot/Items/Item.php create mode 100644 src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCarts.php create mode 100644 src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse.php create mode 100644 src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse/Data.php diff --git a/init.php b/init.php index 1ee344d..8f9d968 100644 --- a/init.php +++ b/init.php @@ -21,6 +21,11 @@ require_once __DIR__ . '/src/Authorization/TokenHasExpiredException.php'; require_once __DIR__ . '/src/Authorization/TokenNotFoundException.php'; require_once __DIR__ . '/src/Authorization/UnauthorizedException.php'; +require_once __DIR__ . '/src/Component/Entity/AbandonedCartSnapshot.php'; +require_once __DIR__ . '/src/Component/Entity/AbandonedCartSnapshot/Coupon.php'; +require_once __DIR__ . '/src/Component/Entity/AbandonedCartSnapshot/Customer.php'; +require_once __DIR__ . '/src/Component/Entity/AbandonedCartSnapshot/Items.php'; +require_once __DIR__ . '/src/Component/Entity/AbandonedCartSnapshot/Items/Item.php'; require_once __DIR__ . '/src/Component/Entity/ActionPrice.php'; require_once __DIR__ . '/src/Component/Entity/Address.php'; require_once __DIR__ . '/src/Component/Entity/Article.php'; @@ -373,6 +378,9 @@ require_once __DIR__ . '/src/Component/ValueObject/TypeWeightRequest.php'; require_once __DIR__ . '/src/Component/ValueObject/TypeWeightUnlimited.php'; require_once __DIR__ . '/src/Component/ValueObject/ValueObjectInterface.php'; +require_once __DIR__ . '/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCarts.php'; +require_once __DIR__ . '/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse.php'; +require_once __DIR__ . '/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse/Data.php'; require_once __DIR__ . '/src/Endpoint/AlternativeProducts/AddAlternativeProduct.php'; require_once __DIR__ . '/src/Endpoint/AlternativeProducts/AddAlternativeProductRequest/AddAlternativeProductRequest.php'; require_once __DIR__ . '/src/Endpoint/AlternativeProducts/AddAlternativeProductRequest/AddAlternativeProductRequest/Data.php'; diff --git a/src/Component/Entity/AbandonedCartSnapshot.php b/src/Component/Entity/AbandonedCartSnapshot.php new file mode 100644 index 0000000..3c004b5 --- /dev/null +++ b/src/Component/Entity/AbandonedCartSnapshot.php @@ -0,0 +1,109 @@ +date; + } + + public function setDate(TypeDateTime $date): static + { + $this->date = $date; + return $this; + } + + public function getAge(): int + { + return $this->age; + } + + public function setAge(int $age): static + { + $this->age = $age; + return $this; + } + + public function getItems(): Items + { + return $this->items; + } + + public function setItems(Items $items): static + { + $this->items = $items; + return $this; + } + + public function getCartValue(): TypePrice + { + return $this->cartValue; + } + + public function setCartValue(TypePrice $cartValue): static + { + $this->cartValue = $cartValue; + return $this; + } + + public function getCoupon(): ?Coupon + { + return $this->coupon; + } + + public function setCoupon(?Coupon $coupon): static + { + $this->coupon = $coupon; + return $this; + } + + public function getCustomer(): Customer + { + return $this->customer; + } + + public function setCustomer(Customer $customer): static + { + $this->customer = $customer; + return $this; + } + + public function getReturns(): int + { + return $this->returns; + } + + public function setReturns(int $returns): static + { + $this->returns = $returns; + return $this; + } + + public function getLastStep(): int + { + return $this->lastStep; + } + + public function setLastStep(int $lastStep): static + { + $this->lastStep = $lastStep; + return $this; + } +} diff --git a/src/Component/Entity/AbandonedCartSnapshot/Coupon.php b/src/Component/Entity/AbandonedCartSnapshot/Coupon.php new file mode 100644 index 0000000..dc183c5 --- /dev/null +++ b/src/Component/Entity/AbandonedCartSnapshot/Coupon.php @@ -0,0 +1,59 @@ +code; + } + + public function setCode(string $code): static + { + $this->code = $code; + return $this; + } + + public function getDiscountType(): string + { + return $this->discountType; + } + + public function setDiscountType(string $discountType): static + { + $this->discountType = $discountType; + return $this; + } + + public function getAmount(): TypePriceNullable + { + return $this->amount; + } + + public function setAmount(TypePriceNullable $amount): static + { + $this->amount = $amount; + return $this; + } + + public function getRatio(): ?TypePriceRatio + { + return $this->ratio; + } + + public function setRatio(?TypePriceRatio $ratio): static + { + $this->ratio = $ratio; + return $this; + } +} diff --git a/src/Component/Entity/AbandonedCartSnapshot/Customer.php b/src/Component/Entity/AbandonedCartSnapshot/Customer.php new file mode 100644 index 0000000..14ef965 --- /dev/null +++ b/src/Component/Entity/AbandonedCartSnapshot/Customer.php @@ -0,0 +1,45 @@ +name; + } + + public function setName(string $name): static + { + $this->name = $name; + return $this; + } + + public function getEmail(): ?string + { + return $this->email; + } + + public function setEmail(?string $email): static + { + $this->email = $email; + return $this; + } + + public function getPhone(): ?string + { + return $this->phone; + } + + public function setPhone(?string $phone): static + { + $this->phone = $phone; + return $this; + } +} diff --git a/src/Component/Entity/AbandonedCartSnapshot/Items.php b/src/Component/Entity/AbandonedCartSnapshot/Items.php new file mode 100644 index 0000000..53b417c --- /dev/null +++ b/src/Component/Entity/AbandonedCartSnapshot/Items.php @@ -0,0 +1,31 @@ + + * @property Item[] $data + * @method Item[] toArray() + * @method void set(int $key, Item $item) + * @method null|Item get(int $key) + * @method void add(Item $item) + * @method null|Item remove(int $key) + * @method bool removeItem(Item $item, bool $strict = true) + * @method bool contains(Item $item, bool $strict = true) + * @method null|Item offsetGet(int $offset) + * @method void offsetSet(int $offset, Item $value) + */ +class Items extends EntityCollection +{ + /** + * @param mixed $data + * @return class-string + */ + public function getItemType(mixed $data): string + { + return 'Shoptet\Api\Sdk\Php\Component\Entity\AbandonedCartSnapshot\Items\Item'; + } +} diff --git a/src/Component/Entity/AbandonedCartSnapshot/Items/Item.php b/src/Component/Entity/AbandonedCartSnapshot/Items/Item.php new file mode 100644 index 0000000..1b3ce58 --- /dev/null +++ b/src/Component/Entity/AbandonedCartSnapshot/Items/Item.php @@ -0,0 +1,45 @@ +code; + } + + public function setCode(string $code): static + { + $this->code = $code; + return $this; + } + + public function getName(): string + { + return $this->name; + } + + public function setName(string $name): static + { + $this->name = $name; + return $this; + } + + public function getAmount(): float + { + return $this->amount; + } + + public function setAmount(float $amount): static + { + $this->amount = $amount; + return $this; + } +} diff --git a/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCarts.php b/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCarts.php new file mode 100644 index 0000000..af7326b --- /dev/null +++ b/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCarts.php @@ -0,0 +1,40 @@ + false, 'visitTimeFrom' => false, 'visitTimeTo' => false]; + + public function getRequestEntityClass(): null + { + return null; + } + + public function getResponseEntityClass(): string + { + return GetListOfAllAbandonedCartsResponse::class; + } + + public function getEndpoint(): string + { + return '/api/abandoned-carts/snapshot'; + } + + public function getSnapshotResultEntityClass(): string + { + return AbandonedCartSnapshot::class; + } +} diff --git a/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse.php b/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse.php new file mode 100644 index 0000000..03156e1 --- /dev/null +++ b/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse.php @@ -0,0 +1,48 @@ +data; + } + + public function setData(?Data $data): static + { + $this->data = $data; + return $this; + } + + public function getErrors(): ?Errors + { + return $this->errors; + } + + public function setErrors(?Errors $errors): static + { + $this->errors = $errors; + return $this; + } + + public function getMetadata(): ?Metadata + { + return $this->metadata; + } + + public function setMetadata(?Metadata $metadata): static + { + $this->metadata = $metadata; + return $this; + } +} diff --git a/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse/Data.php b/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse/Data.php new file mode 100644 index 0000000..621a75d --- /dev/null +++ b/src/Endpoint/AbandonedCarts/GetListOfAllAbandonedCartsResponse/GetListOfAllAbandonedCartsResponse/Data.php @@ -0,0 +1,21 @@ +jobId; + } + + public function setJobId(string $jobId): static + { + $this->jobId = $jobId; + return $this; + } +} diff --git a/src/Endpoint/EndpointMap.php b/src/Endpoint/EndpointMap.php index 990ace3..f739adc 100644 --- a/src/Endpoint/EndpointMap.php +++ b/src/Endpoint/EndpointMap.php @@ -149,6 +149,7 @@ class EndpointMap '/api/suppliers' => 'Shoptet\Api\Sdk\Php\Endpoint\Suppliers\GetListOfSuppliers', '/api/brands' => 'Shoptet\Api\Sdk\Php\Endpoint\Brands\GetListofBrands', '/api/brands/{code}' => 'Shoptet\Api\Sdk\Php\Endpoint\Brands\GetDetailOfBrand', + '/api/abandoned-carts/snapshot' => 'Shoptet\Api\Sdk\Php\Endpoint\AbandonedCarts\GetListOfAllAbandonedCarts', '/api/customers' => 'Shoptet\Api\Sdk\Php\Endpoint\Customers\GetListOfCustomers', '/api/customers/snapshot' => 'Shoptet\Api\Sdk\Php\Endpoint\Customers\GetListOfAllCustomers', '/api/customers/{guid}' => 'Shoptet\Api\Sdk\Php\Endpoint\Customers\GetCustomerDetail', diff --git a/src/Sdk.php b/src/Sdk.php index 428be0c..86b5514 100644 --- a/src/Sdk.php +++ b/src/Sdk.php @@ -11,6 +11,7 @@ use Shoptet\Api\Sdk\Php\Authorization\OAuth; use Shoptet\Api\Sdk\Php\Authorization\Token\FileTokenStorage; use Shoptet\Api\Sdk\Php\Authorization\Token\TokenStorage; +use Shoptet\Api\Sdk\Php\Endpoint\AbandonedCarts\GetListOfAllAbandonedCarts; use Shoptet\Api\Sdk\Php\Endpoint\AlternativeProducts\AddAlternativeProduct; use Shoptet\Api\Sdk\Php\Endpoint\AlternativeProducts\AddAlternativeProductRequest\AddAlternativeProductRequest; use Shoptet\Api\Sdk\Php\Endpoint\AlternativeProducts\GetListOfProductAlternativeProducts; @@ -6011,6 +6012,28 @@ public static function createBrandBatch( ->execute(); } + /** + * @param array{ + * language?: string, + * visitTimeFrom?: string, + * visitTimeTo?: string, + * } $queryParams + * + * @return ResponseInterface + * + * @throws LogicException + * @throws RuntimeException + * + * @see https://api.docs.shoptet.com/shoptet-api/openapi/Abandoned-carts/getlistofallabandonedcarts + */ + public static function getListOfAllAbandonedCarts(array $queryParams = []): ResponseInterface + { + return self::getEndpointFactory() + ->createEndpoint(GetListOfAllAbandonedCarts::class) + ->setQueryParams($queryParams) + ->execute(); + } + /** * @param array{ * language?: string,