From fda4b0a3c06395059ec5dc180ea3626edd534454 Mon Sep 17 00:00:00 2001 From: Yevhenii Kovalenko Date: Wed, 4 Sep 2024 09:53:34 +0200 Subject: [PATCH] Change endpoint for parcel points --- .github/workflows/phpunit.yml | 6 +- .github/workflows/static-analysis.yml | 4 +- composer.json | 31 +- phpunit.xml.dist | 13 +- src/Client/RequestTransformer.php | 6 +- src/ConfigProvider.php | 31 +- src/DependencyInjection/Configuration.php | 15 +- src/Enum/CountryCode.php | 47 - src/Enum/CountryCodeEnum.php | 15 + src/Enum/DayType.php | 56 - src/Enum/DayTypeEnum.php | 30 + src/Enum/FeatureEnum.php | 25 + src/Enum/ParcelShopAction.php | 29 - src/Enum/ParcelShopTypeEnum.php | 11 + src/Logger/GlsLogger.php | 11 +- src/Request/GetParcelShops.php | 60 +- src/Request/RequestInterface.php | 2 - src/Response/DTO/Address.php | 73 +- src/Response/DTO/Coordinates.php | 15 +- src/Response/DTO/Openings.php | 38 +- src/Response/DTO/ParcelShop.php | 197 +-- src/Response/DTO/RawParcelShop.php | 33 +- src/Response/DTO/RawResponse.php | 18 + src/Serializer/Normalizer/EnumNormalizer.php | 61 - src/Serializer/Serializer.php | 8 +- src/Service/ParcelShopsService.php | 86 +- src/Util/BooleanTransformer.php | 30 - .../DependencyInjection/ConfigurationTest.php | 26 +- tests/Integration/Service/ParcelShopsTest.php | 104 +- tests/Integration/Service/data/openings.json | 37 - .../Integration/Service/data/parcelShops.json | 1429 ++++++++++------ .../data/parcelShops_expected_parcels.json | 1486 +++++++---------- tests/MockGuzzleTrait.php | 2 +- 33 files changed, 1877 insertions(+), 2158 deletions(-) delete mode 100644 src/Enum/CountryCode.php create mode 100644 src/Enum/CountryCodeEnum.php delete mode 100644 src/Enum/DayType.php create mode 100644 src/Enum/DayTypeEnum.php create mode 100644 src/Enum/FeatureEnum.php delete mode 100644 src/Enum/ParcelShopAction.php create mode 100644 src/Enum/ParcelShopTypeEnum.php create mode 100644 src/Response/DTO/RawResponse.php delete mode 100644 src/Serializer/Normalizer/EnumNormalizer.php delete mode 100644 src/Util/BooleanTransformer.php delete mode 100644 tests/Integration/Service/data/openings.json diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 35acac9..337749b 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -11,14 +11,12 @@ jobs: strategy: matrix: php-version: - - "7.4" - - "8.0" - - "8.1" + - "8.2" deps: - "normal" include: - deps: "low" - php-version: "7.4" + php-version: "8.2" steps: - name: "Checkout" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 7f7fb9d..f744fb4 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -11,9 +11,7 @@ jobs: strategy: matrix: php-version: - - "7.4" - - "8.0" - - "8.1" + - "8.2" steps: - name: "Checkout" uses: "actions/checkout@v2" diff --git a/composer.json b/composer.json index 551177a..48d6e2f 100755 --- a/composer.json +++ b/composer.json @@ -4,26 +4,25 @@ "type": "symfony-bundle", "license": "MIT", "require": { - "php": ">=7.4|^8.0", + "php": ">=8.2", "ext-json": "*", - "guzzlehttp/guzzle": "^6.0|^7.0", - "marc-mabe/php-enum": "^3.0|^4.3", - "psr/log": "^1.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0", - "webmozart/assert": "^1.3", - "symfony/property-access": "^5.4|^6.0" + "guzzlehttp/guzzle": "^6.0|^7.9.2", + "psr/log": "^1.1.4", + "symfony/http-kernel": "6.4.*", + "symfony/property-access": "6.4.*", + "symfony/property-info": "6.4.*", + "symfony/serializer": "6.4.*", + "webmozart/assert": "^1.11" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4", - "matthiasnoback/symfony-config-test": "^4.3", - "phpro/grumphp": "^1.5.0", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-webmozart-assert": "^1.0", - "phpunit/phpunit": "^9.5", + "friendsofphp/php-cs-fixer": "^3.63.2", + "matthiasnoback/symfony-config-test": "^5.2", + "phpro/grumphp": "^2.7.0", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-webmozart-assert": "^1.2.10", + "phpunit/phpunit": "^10.5.30", "roave/security-advisories": "dev-master", - "symfony/phpunit-bridge": "6.1.*" + "symfony/phpunit-bridge": "6.4.*" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index fb59539..580e574 100755 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,17 +1,9 @@ @@ -23,7 +15,4 @@ - - - diff --git a/src/Client/RequestTransformer.php b/src/Client/RequestTransformer.php index 03bf5d9..6273f91 100644 --- a/src/Client/RequestTransformer.php +++ b/src/Client/RequestTransformer.php @@ -17,7 +17,7 @@ class RequestTransformer public function __construct( Serializer $serializer, - ConfigProvider $configuration + ConfigProvider $configuration, ) { $this->serializer = $serializer; $this->configuration = $configuration; @@ -27,10 +27,6 @@ public function transform(RequestInterface $request): HttpRequest { $uri = $this->configuration->getUrl() . $request->getEndpoint(); - if (null !== $request->getUrlQuery()) { - $uri .= '?' . $request->getUrlQuery(); - } - return new HttpRequest( $request->getMethod(), new Uri($uri), diff --git a/src/ConfigProvider.php b/src/ConfigProvider.php index ec991c1..8498b21 100644 --- a/src/ConfigProvider.php +++ b/src/ConfigProvider.php @@ -4,38 +4,31 @@ namespace Answear\GlsBundle; -use Answear\GlsBundle\Enum\CountryCode; +use Answear\GlsBundle\Enum\CountryCodeEnum; class ConfigProvider { - private const URL_MAP = [ - CountryCode::HUNGARY => 'https://online.gls-hungary.com/', - CountryCode::SLOVAKIA => 'https://online.gls-slovakia.com/', - CountryCode::CZECH => 'https://online.gls-czech.com/', - CountryCode::ROMANIA => 'https://online.gls-romania.com/', - CountryCode::SLOVENIA => 'https://online.gls-slovenia.com/', - CountryCode::CROATIA => 'https://online.gls-croatia.com/', - ]; - - private CountryCode $countryCode; + private CountryCodeEnum $countryCode; public function __construct(string $countryCode) { - $this->countryCode = CountryCode::byValue($countryCode); + $this->countryCode = CountryCodeEnum::from($countryCode); } - public function getCountryCode(): CountryCode + public function getCountryCode(): CountryCodeEnum { return $this->countryCode; } public function getUrl(): string { - $url = self::URL_MAP[$this->getCountryCode()->getValue()] ?? null; - if (null === $url) { - throw new \InvalidArgumentException('No url for provided country code.'); - } - - return $url; + return match ($this->getCountryCode()) { + CountryCodeEnum::Romania, + CountryCodeEnum::Hungary => 'https://map.gls-hungary.com/', + CountryCodeEnum::Slovakia => 'https://map.gls-slovakia.com/', + CountryCodeEnum::Czech => 'https://map.gls-czech.com/', + CountryCodeEnum::Slovenia => 'https://map.gls-slovenia.com/', + CountryCodeEnum::Croatia => 'https://map.gls-croatia.com/', + }; } } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index abe0eb2..5ec7f85 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -4,7 +4,7 @@ namespace Answear\GlsBundle\DependencyInjection; -use Answear\GlsBundle\Enum\CountryCode; +use Answear\GlsBundle\Enum\CountryCodeEnum; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -17,7 +17,7 @@ public function getConfigTreeBuilder(): TreeBuilder $treeBuilder->getRootNode() ->children() ->enumNode('countryCode') - ->values(CountryCode::getValues()) + ->values($this->getCountryCodes()) ->isRequired() ->end() ->scalarNode('logger')->defaultValue(null)->end() @@ -25,4 +25,15 @@ public function getConfigTreeBuilder(): TreeBuilder return $treeBuilder; } + + /** + * @return string[] + */ + private function getCountryCodes(): array + { + return array_map( + static fn(CountryCodeEnum $countryCode) => $countryCode->value, + CountryCodeEnum::cases(), + ); + } } diff --git a/src/Enum/CountryCode.php b/src/Enum/CountryCode.php deleted file mode 100644 index 2f21a27..0000000 --- a/src/Enum/CountryCode.php +++ /dev/null @@ -1,47 +0,0 @@ - self::Monday, + 2 => self::Tuesday, + 3 => self::Wednesday, + 4 => self::Thursday, + 5 => self::Friday, + 6 => self::Saturday, + 7 => self::Sunday, + default => throw new \InvalidArgumentException("Invalid day number: $dayNumber"), + }; + } +} diff --git a/src/Enum/FeatureEnum.php b/src/Enum/FeatureEnum.php new file mode 100644 index 0000000..cf09723 --- /dev/null +++ b/src/Enum/FeatureEnum.php @@ -0,0 +1,25 @@ +value; + } + + public function jsonSerialize(): array + { + return [ + 'value' => $this->value, + ]; + } +} diff --git a/src/Enum/ParcelShopAction.php b/src/Enum/ParcelShopAction.php deleted file mode 100644 index a9a633d..0000000 --- a/src/Enum/ParcelShopAction.php +++ /dev/null @@ -1,29 +0,0 @@ -getPath() . '?' . $uri->getQuery() : ''); + $url = null; + if (null !== $uri) { + $url = $uri->getPath(); + + if ($uri->getQuery()) { + $url .= '?' . $uri->getQuery(); + } + } + + return self::MESSAGE_PREFIX . $message . ' - ' . $url; } private function getParsedContent(string $content) diff --git a/src/Request/GetParcelShops.php b/src/Request/GetParcelShops.php index b2ac0c0..f14d1f2 100644 --- a/src/Request/GetParcelShops.php +++ b/src/Request/GetParcelShops.php @@ -4,46 +4,20 @@ namespace Answear\GlsBundle\Request; -use Answear\GlsBundle\Enum\CountryCode; -use Answear\GlsBundle\Enum\ParcelShopAction; +use Answear\GlsBundle\Enum\CountryCodeEnum; class GetParcelShops implements RequestInterface { - private const ENDPOINT = 'psmap/psmap_getdata.php'; + private const ENDPOINT = 'data/deliveryPoints/'; private const HTTP_METHOD = 'GET'; - private ParcelShopAction $action; - private ?CountryCode $countryCode; - private ?string $senderId; - private ?bool $pclShopIn; - private ?bool $parcelLockIn; - private ?bool $codHandler; - private ?bool $dropOff; - private ?string $shopId; - - public function __construct( - ParcelShopAction $action, - ?CountryCode $countryCode = null, - ?string $senderId = null, - ?bool $withPclShopIn = null, - ?bool $withParcelLockIn = null, - ?bool $codHandler = null, - ?bool $dropOff = null, - ?string $shopId = null - ) { - $this->action = $action; - $this->countryCode = $countryCode; - $this->senderId = $senderId; - $this->pclShopIn = $withPclShopIn; - $this->parcelLockIn = $withParcelLockIn; - $this->codHandler = $codHandler; - $this->dropOff = $dropOff; - $this->shopId = $shopId; + public function __construct(public CountryCodeEnum $countryCode) + { } public function getEndpoint(): string { - return self::ENDPOINT; + return self::ENDPOINT . $this->getJsonFile(); } public function getMethod(): string @@ -51,21 +25,15 @@ public function getMethod(): string return self::HTTP_METHOD; } - public function getUrlQuery(): ?string + private function getJsonFile(): string { - $urlQuery = http_build_query( - [ - 'action' => $this->action->getValue(), - 'ctrcode' => null === $this->countryCode ? null : $this->countryCode->getValue(), - 'senderid' => $this->senderId, - 'pclshopin' => null === $this->pclShopIn ? null : (int) $this->pclShopIn, - 'parcellockin' => null === $this->parcelLockIn ? null : (int) $this->parcelLockIn, - 'codhandler' => null === $this->codHandler ? null : (int) $this->codHandler, - 'dropoff' => null === $this->dropOff ? null : (int) $this->dropOff, - 'pclshopid' => $this->shopId, - ] - ); - - return empty($urlQuery) ? null : $urlQuery; + return match ($this->countryCode) { + CountryCodeEnum::Hungary => 'hu.json', + CountryCodeEnum::Slovakia => 'sk.json', + CountryCodeEnum::Czech => 'cz.json', + CountryCodeEnum::Romania => 'ro.json', + CountryCodeEnum::Slovenia => 'si.json', + CountryCodeEnum::Croatia => 'hr.json', + }; } } diff --git a/src/Request/RequestInterface.php b/src/Request/RequestInterface.php index 3e70546..687b99e 100644 --- a/src/Request/RequestInterface.php +++ b/src/Request/RequestInterface.php @@ -9,6 +9,4 @@ interface RequestInterface public function getEndpoint(): string; public function getMethod(): string; - - public function getUrlQuery(): ?string; } diff --git a/src/Response/DTO/Address.php b/src/Response/DTO/Address.php index e598733..f8951d8 100644 --- a/src/Response/DTO/Address.php +++ b/src/Response/DTO/Address.php @@ -6,68 +6,29 @@ class Address { - private string $zipCode; - private string $city; - private string $place; - private ?string $contact; - private ?string $phone; - private ?string $email; - public function __construct( - string $zipCode, - string $city, - string $place, - ?string $contact, - ?string $phone, - ?string $email + public string $countryCode, + public string $zipCode, + public string $city, + public string $place, + public ?string $name, + public ?string $phone, + public ?string $email, + public ?string $web, ) { - $this->zipCode = $zipCode; - $this->city = $city; - $this->place = $place; - $this->contact = $contact; - $this->phone = $phone; - $this->email = $email; } - public static function fromRawParcelShop(RawParcelShop $rawParcelShop): self + public static function fromResponse(array $response): self { return new self( - $rawParcelShop->zipcode, - $rawParcelShop->city, - $rawParcelShop->address, - $rawParcelShop->contact, - $rawParcelShop->phone, - $rawParcelShop->email + $response['countryCode'], + $response['postalCode'], + $response['city'], + $response['address'], + $response['name'] ?? null, + $response['phone'] ?? null, + $response['email'] ?? null, + $response['web'] ?? null, ); } - - public function getZipCode(): string - { - return $this->zipCode; - } - - public function getCity(): string - { - return $this->city; - } - - public function getPlace(): string - { - return $this->place; - } - - public function getContact(): ?string - { - return $this->contact; - } - - public function getPhone(): ?string - { - return $this->phone; - } - - public function getEmail(): ?string - { - return $this->email; - } } diff --git a/src/Response/DTO/Coordinates.php b/src/Response/DTO/Coordinates.php index 7ebcb84..04f105e 100644 --- a/src/Response/DTO/Coordinates.php +++ b/src/Response/DTO/Coordinates.php @@ -8,15 +8,16 @@ class Coordinates { - public float $latitude; - public float $longitude; - - public function __construct(float $latitude, float $longitude) - { + public function __construct( + public float $latitude, + public float $longitude, + ) { Assert::range($latitude, -90, 90); Assert::range($longitude, -180, 180); + } - $this->latitude = $latitude; - $this->longitude = $longitude; + public static function fromResponse(array $response): self + { + return new self($response[0], $response[1]); } } diff --git a/src/Response/DTO/Openings.php b/src/Response/DTO/Openings.php index 5f4f77d..af31725 100644 --- a/src/Response/DTO/Openings.php +++ b/src/Response/DTO/Openings.php @@ -4,36 +4,30 @@ namespace Answear\GlsBundle\Response\DTO; -use Answear\GlsBundle\Enum\DayType; +use Answear\GlsBundle\Enum\DayTypeEnum; class Openings { - private DayType $day; - private string $open; - private string $midbreak; + public DayTypeEnum $day; public function __construct( - DayType $day, - string $open, - string $midbreak + public int $number, + public string $openTime, + public string $closeTime, + public ?string $breakStart = null, + public ?string $breakEnd = null, ) { - $this->day = $day; - $this->open = $open; - $this->midbreak = $midbreak; + $this->day = DayTypeEnum::getDayByNumber($number); } - public function getDay(): DayType + public static function fromResponse(array $responseHours): self { - return $this->day; - } - - public function getOpen(): string - { - return $this->open; - } - - public function getMidbreak(): string - { - return $this->midbreak; + return new self( + (int) $responseHours[0], + $responseHours[1], + $responseHours[2], + $responseHours[3] ?? null, + $responseHours[4] ?? null + ); } } diff --git a/src/Response/DTO/ParcelShop.php b/src/Response/DTO/ParcelShop.php index bc0da9d..2576763 100644 --- a/src/Response/DTO/ParcelShop.php +++ b/src/Response/DTO/ParcelShop.php @@ -4,178 +4,61 @@ namespace Answear\GlsBundle\Response\DTO; -use Answear\GlsBundle\Enum\CountryCode; -use Answear\GlsBundle\Util\BooleanTransformer; +use Answear\GlsBundle\Enum\CountryCodeEnum; +use Answear\GlsBundle\Enum\FeatureEnum; +use Answear\GlsBundle\Enum\ParcelShopTypeEnum; class ParcelShop { - private string $shopId; - private string $name; - private CountryCode $countryCode; - private bool $codHandler; - private bool $payByBankCard; - private bool $dropOffPoint; - private string $owner; - private bool $parcelLocker; - private ?string $vendorUrl; - private ?string $pickupTime; - private ?string $info; - private Address $address; /** - * @var Openings[] + * @param Openings[] $openings */ - private array $openings = []; - private ?Coordinates $coordinates; - private ?string $holidayStarts; - private ?string $holidayEnds; - public function __construct( - string $shopId, - string $name, - CountryCode $countryCode, - bool $isCodHandler, - bool $payByBankCard, - bool $dropOffPoint, - string $owner, - bool $isParcelLocker, - ?string $vendorUrl, - ?string $pickupTime, - ?string $info, - Address $address, - array $openings, - ?Coordinates $coordinates, - ?string $holidayStarts, - ?string $holidayEnds + public string $shopId, + public string $name, + public CountryCodeEnum $countryCode, + public bool $isCodHandler, + public bool $payByBankCard, + public bool $isParcelLocker, + public ?string $pickupTime, + public ?string $info, + public Address $address, + public array $openings, + public Coordinates $coordinates, + public array $features, ) { - $this->shopId = $shopId; - $this->name = $name; - $this->countryCode = $countryCode; - $this->codHandler = $isCodHandler; - $this->payByBankCard = $payByBankCard; - $this->dropOffPoint = $dropOffPoint; - $this->owner = $owner; - $this->parcelLocker = $isParcelLocker; - $this->vendorUrl = $vendorUrl; - $this->pickupTime = $pickupTime; - $this->info = $info; - $this->address = $address; - $this->openings = $openings; - $this->coordinates = $coordinates; - $this->holidayStarts = $holidayStarts; - $this->holidayEnds = $holidayEnds; } - /** - * @param Openings[] $openings - */ - public static function fromRawParcelShop(RawParcelShop $rawParcelShop, array $openings): self + public static function fromRawParcelShop(RawParcelShop $rawParcelShop): self { - $coordinates = null; - - if (null !== $rawParcelShop->geolat && null !== $rawParcelShop->geolng) { - $coordinates = new Coordinates((float) $rawParcelShop->geolat, (float) $rawParcelShop->geolng); - } + $isCodHandler = in_array(FeatureEnum::AcceptsCash->value, $rawParcelShop->features, true); + $canPayByBankCard = in_array(FeatureEnum::AcceptsCard->value, $rawParcelShop->features, true); + $isParcelLocker = $rawParcelShop->type === ParcelShopTypeEnum::ParcelLocker->value; + $contact = Address::fromResponse($rawParcelShop->contact); + $coordinates = Coordinates::fromResponse($rawParcelShop->location); + $openings = array_map( + static fn(array $openings) => Openings::fromResponse($openings), + $rawParcelShop->hours, + ); + $countryCode = CountryCodeEnum::from($contact->countryCode); + $features = array_map( + static fn(string $feature) => FeatureEnum::tryFrom($feature), + $rawParcelShop->features, + ); return new self( - $rawParcelShop->pclshopid, + $rawParcelShop->id, $rawParcelShop->name, - CountryCode::byValue($rawParcelShop->ctrcode), - null === $rawParcelShop->iscodhandler ? false : BooleanTransformer::transformToBoolean($rawParcelShop->iscodhandler), - null === $rawParcelShop->paybybankcard ? false : BooleanTransformer::transformToBoolean($rawParcelShop->paybybankcard), - null === $rawParcelShop->dropoffpoint ? false : BooleanTransformer::transformToBoolean($rawParcelShop->dropoffpoint), - $rawParcelShop->owner, - null === $rawParcelShop->isparcellocker ? false : BooleanTransformer::transformToBoolean($rawParcelShop->isparcellocker), - $rawParcelShop->vendor_url, - $rawParcelShop->pcl_pickup_time, - $rawParcelShop->info, - Address::fromRawParcelShop($rawParcelShop), + $countryCode, + $isCodHandler, + $canPayByBankCard, + $isParcelLocker, + $rawParcelShop->pickupTime, + $rawParcelShop->description, + $contact, $openings, $coordinates, - $rawParcelShop->holidaystarts, - $rawParcelShop->holidayends + array_filter($features), ); } - - public function getShopId(): string - { - return $this->shopId; - } - - public function getName(): string - { - return $this->name; - } - - public function getCountryCode(): CountryCode - { - return $this->countryCode; - } - - public function isCodHandler(): bool - { - return $this->codHandler; - } - - public function hasPayByBankCard(): bool - { - return $this->payByBankCard; - } - - public function isDropOffPoint(): bool - { - return $this->dropOffPoint; - } - - public function getOwner(): string - { - return $this->owner; - } - - public function isParcelLocker(): bool - { - return $this->parcelLocker; - } - - public function getVendorUrl(): ?string - { - return $this->vendorUrl; - } - - public function getPickupTime(): ?string - { - return $this->pickupTime; - } - - public function getInfo(): ?string - { - return $this->info; - } - - public function getAddress(): Address - { - return $this->address; - } - - /** - * @return Openings[] - */ - public function getOpenings(): array - { - return $this->openings; - } - - public function getCoordinates(): ?Coordinates - { - return $this->coordinates; - } - - public function getHolidayStarts(): ?string - { - return $this->holidayStarts; - } - - public function getHolidayEnds(): ?string - { - return $this->holidayEnds; - } } diff --git a/src/Response/DTO/RawParcelShop.php b/src/Response/DTO/RawParcelShop.php index fcca0eb..3135bff 100644 --- a/src/Response/DTO/RawParcelShop.php +++ b/src/Response/DTO/RawParcelShop.php @@ -6,25 +6,16 @@ class RawParcelShop { - public string $pclshopid; - public string $name; - public string $ctrcode; - public string $zipcode; - public string $city; - public string $address; - public ?string $contact; - public ?string $phone; - public ?string $email; - public ?string $iscodhandler; - public ?string $paybybankcard; - public ?string $dropoffpoint; - public ?string $geolat; - public ?string $geolng; - public string $owner; - public ?string $isparcellocker; - public ?string $vendor_url; - public ?string $pcl_pickup_time; - public ?string $info; - public ?string $holidaystarts; - public ?string $holidayends; + public function __construct( + public string $id, + public string $name, + public ?string $description, + public array $contact, + public array $location, + public array $hours, + public array $features, + public string $type, + public ?string $pickupTime = null, + ) { + } } diff --git a/src/Response/DTO/RawResponse.php b/src/Response/DTO/RawResponse.php new file mode 100644 index 0000000..5b42a12 --- /dev/null +++ b/src/Response/DTO/RawResponse.php @@ -0,0 +1,18 @@ +items[] = $item; + } +} diff --git a/src/Serializer/Normalizer/EnumNormalizer.php b/src/Serializer/Normalizer/EnumNormalizer.php deleted file mode 100644 index 89f4f56..0000000 --- a/src/Serializer/Normalizer/EnumNormalizer.php +++ /dev/null @@ -1,61 +0,0 @@ - true]; - } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - if (!$object instanceof Enum) { - throw new InvalidArgumentException(sprintf('The object must implement "%s".', Enum::class)); - } - - return $object->getValue(); - } - - public function supportsNormalization($data, $format = null, array $context = []): bool - { - return $data instanceof Enum; - } - - public function supportsDenormalization($data, $type, $format = null, array $context = []): bool - { - try { - $type::get($data); - } catch (\Throwable $t) { - return false; - } - - return true; - } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - * - * @see Enum for $type - */ - public function denormalize($data, $type, $format = null, array $context = []) - { - return $type::get($data); - } - - public function hasCacheableSupportsMethod(): bool - { - return __CLASS__ === static::class; - } -} diff --git a/src/Serializer/Serializer.php b/src/Serializer/Serializer.php index ad65b5b..fa0f0bc 100644 --- a/src/Serializer/Serializer.php +++ b/src/Serializer/Serializer.php @@ -5,7 +5,6 @@ namespace Answear\GlsBundle\Serializer; use Answear\GlsBundle\Request\RequestInterface; -use Answear\GlsBundle\Serializer\Normalizer\EnumNormalizer; use Psr\Http\Message\ResponseInterface; use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor; use Symfony\Component\Serializer\Encoder\JsonEncoder; @@ -14,15 +13,13 @@ class Serializer { - private const FORMAT = 'json'; - private SymfonySerializer $serializer; public function serialize(RequestInterface $request): string { return $this->getSerializer()->serialize( $request, - self::FORMAT, + JsonEncoder::FORMAT, [Normalizer\AbstractObjectNormalizer::SKIP_NULL_VALUES => true] ); } @@ -32,7 +29,7 @@ public function decodeResponse(string $class, ResponseInterface $response) return $this->getSerializer()->deserialize( $response->getBody()->getContents(), $class, - self::FORMAT + JsonEncoder::FORMAT, ); } @@ -47,7 +44,6 @@ private function getSerializer(): SymfonySerializer Normalizer\DateTimeNormalizer::FORMAT_KEY => 'Y-m-d\\TH:i:s.uP', ] ), - new EnumNormalizer(), new Normalizer\PropertyNormalizer( null, null, diff --git a/src/Service/ParcelShopsService.php b/src/Service/ParcelShopsService.php index 35e1799..29b0394 100644 --- a/src/Service/ParcelShopsService.php +++ b/src/Service/ParcelShopsService.php @@ -6,12 +6,10 @@ use Answear\GlsBundle\Client\Client; use Answear\GlsBundle\ConfigProvider; -use Answear\GlsBundle\Enum\ParcelShopAction; use Answear\GlsBundle\Exception\ServiceUnavailableException; use Answear\GlsBundle\Request\GetParcelShops; -use Answear\GlsBundle\Response\DTO\Openings; use Answear\GlsBundle\Response\DTO\ParcelShop; -use Answear\GlsBundle\Response\DTO\RawParcelShop; +use Answear\GlsBundle\Response\DTO\RawResponse; use Answear\GlsBundle\Serializer\Serializer; class ParcelShopsService @@ -30,82 +28,22 @@ public function __construct(Client $client, Serializer $serializer, ConfigProvid /** * @return ParcelShop[] * - * @throws ServiceUnavailableException + * @throws ServiceUnavailableException|\Throwable */ - public function getParcelShopCollection( - ?bool $withPclShopIn = true, - ?bool $withParcelLockIn = true, - ?string $senderId = null, - ?bool $codHandler = null, - ?bool $dropOff = null - ): array { - $rawParcelShopCollection = $this->getList( - $withPclShopIn, - $withParcelLockIn, - $senderId, - $codHandler, - $dropOff - ); - - $parcelShopCollection = []; - foreach ($rawParcelShopCollection as $rawParcelShop) { - try { - $openings = $this->getOpenings($rawParcelShop->pclshopid); - } catch (\Throwable $throwable) { - $openings = []; - } - - $parcelShop = ParcelShop::fromRawParcelShop($rawParcelShop, $openings); - $parcelShopCollection[] = $parcelShop; - } - - return $parcelShopCollection; - } - - /** - * @return RawParcelShop[] - * - * @throws ServiceUnavailableException - */ - public function getList( - ?bool $withPclShopIn = null, - ?bool $withParcelLockIn = null, - ?string $senderId = null, - ?bool $codHandler = null, - ?bool $dropOff = null - ): array { - $request = new GetParcelShops( - ParcelShopAction::getList(), - $this->configProvider->getCountryCode(), - $senderId, - $withPclShopIn, - $withParcelLockIn, - $codHandler, - $dropOff - ); + public function getParcelShopCollection(): array + { + $request = new GetParcelShops($this->configProvider->getCountryCode()); $response = $this->client->request($request); - return $this->serializer->decodeResponse(sprintf('%s[]', RawParcelShop::class), $response); - } + /** @var RawResponse $rawResponse */ + $rawResponse = $this->serializer->decodeResponse(sprintf('%s', RawResponse::class), $response); - /** - * @return Openings[] - */ - public function getOpenings(string $shopId): array - { - $request = new GetParcelShops( - ParcelShopAction::getOpenings(), - null, - null, - null, - null, - null, - null, - $shopId - ); - $response = $this->client->request($request); + $parcelShopCollection = []; + foreach ($rawResponse->items as $rawParcelShop) { + $parcelShopCollection[] = ParcelShop::fromRawParcelShop($rawParcelShop); + } - return $this->serializer->decodeResponse(sprintf('%s[]', Openings::class), $response); + return $parcelShopCollection; } } diff --git a/src/Util/BooleanTransformer.php b/src/Util/BooleanTransformer.php deleted file mode 100644 index 96f4528..0000000 --- a/src/Util/BooleanTransformer.php +++ /dev/null @@ -1,30 +0,0 @@ -assertConfigurationIsValid($configs); @@ -34,10 +34,8 @@ public function validTest(array $configs): void self::assertSame($configs[0]['countryCode'], $configProviderDefinition->getArgument(0)); } - /** - * @test - * @dataProvider provideInvalidConfig - */ + #[Test] + #[DataProvider('provideInvalidConfig')] public function invalid(array $config, ?string $expectedMessage = null): void { $this->assertConfigurationIsInvalid( @@ -46,10 +44,8 @@ public function invalid(array $config, ?string $expectedMessage = null): void ); } - /** - * @test - * @dataProvider provideMoreInvalidConfig - */ + #[Test] + #[DataProvider('provideMoreInvalidConfig')] public function moreInvalidTest(array $configs, \Throwable $expectedException): void { $this->expectException(get_class($expectedException)); @@ -63,7 +59,7 @@ public function moreInvalidTest(array $configs, \Throwable $expectedException): $extension->load($configs, $builder); } - public function provideInvalidConfig(): iterable + public static function provideInvalidConfig(): iterable { yield [ [ @@ -100,7 +96,7 @@ public function provideInvalidConfig(): iterable ]; } - public function provideMoreInvalidConfig(): iterable + public static function provideMoreInvalidConfig(): iterable { yield [ [ @@ -113,7 +109,7 @@ public function provideMoreInvalidConfig(): iterable ]; } - public function provideValidConfig(): iterable + public static function provideValidConfig(): iterable { yield [ [ diff --git a/tests/Integration/Service/ParcelShopsTest.php b/tests/Integration/Service/ParcelShopsTest.php index a947385..73674a8 100644 --- a/tests/Integration/Service/ParcelShopsTest.php +++ b/tests/Integration/Service/ParcelShopsTest.php @@ -7,14 +7,17 @@ use Answear\GlsBundle\Client\Client; use Answear\GlsBundle\Client\RequestTransformer; use Answear\GlsBundle\ConfigProvider; -use Answear\GlsBundle\Enum\CountryCode; +use Answear\GlsBundle\Enum\CountryCodeEnum; +use Answear\GlsBundle\Enum\FeatureEnum; use Answear\GlsBundle\Logger\GlsLogger; +use Answear\GlsBundle\Response\DTO\Openings; use Answear\GlsBundle\Response\DTO\ParcelShop; use Answear\GlsBundle\Serializer\Serializer; use Answear\GlsBundle\Service\ParcelShopsService; use Answear\GlsBundle\Tests\MockGuzzleTrait; use Answear\GlsBundle\Tests\Util\FileTestUtil; use GuzzleHttp\Psr7\Response; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; @@ -32,12 +35,10 @@ public function setUp(): void parent::setUp(); $this->serializer = new Serializer(); - $this->configProvider = new ConfigProvider(CountryCode::slovenia()->getValue()); + $this->configProvider = new ConfigProvider(CountryCodeEnum::Slovenia->value); } - /** - * @test - */ + #[Test] public function successfulGetParcelShop(): void { $parcelShops = FileTestUtil::decodeJsonFromFile(__DIR__ . '/data/parcelShops.json'); @@ -47,11 +48,6 @@ public function successfulGetParcelShop(): void $this->mockGuzzleResponse( new Response(200, [], FileTestUtil::getFileContents(__DIR__ . '/data/parcelShops.json')) ); - foreach ($parcelShops as $element) { - $this->mockGuzzleResponse( - new Response(200, [], FileTestUtil::getFileContents(__DIR__ . '/data/openings.json')) - ); - } $this->assertOfficeSame($service->getParcelShopCollection()); } @@ -61,9 +57,9 @@ private function getClient(?bool $withLogger = true, array $parcelShops = []): C return new Client( new RequestTransformer( $this->serializer, - new ConfigProvider(CountryCode::slovenia()->getValue()) + new ConfigProvider(CountryCodeEnum::Slovenia->value) ), - new GlsLogger($withLogger ? $this->getLogger($parcelShops) : new NullLogger()), + new GlsLogger($withLogger ? $this->getLogger() : new NullLogger()), $this->setupGuzzleClient() ); } @@ -80,45 +76,50 @@ private function assertOfficeSame(array $parcelShops): void { $actualData = []; foreach ($parcelShops as $parcelShop) { - $address = $parcelShop->getAddress(); - $openings = $parcelShop->getOpenings(); - - $actualOpenings = []; - foreach ($openings as $opening) { - $actualOpenings[] = [ - 'day' => $opening->getDay()->getValue(), - 'open' => $opening->getOpen(), - 'midbreak' => $opening->getMidbreak(), - ]; - } + $openings = array_map( + static function (Openings $opening) { + return [ + 'number' => $opening->number, + 'day' => $opening->day->value, + 'openTime' => $opening->openTime, + 'closeTime' => $opening->closeTime, + 'breakStart' => $opening->breakStart, + 'breakEnd' => $opening->breakEnd, + ]; + }, + $parcelShop->openings + ); + + $features = array_map( + static function (FeatureEnum $feature) { + return $feature->value; + }, + $parcelShop->features, + ); $actualData[] = [ - 'shopId' => $parcelShop->getShopId(), - 'name' => $parcelShop->getName(), - 'countryCode' => $parcelShop->getCountryCode()->getValue(), - 'isCodHandler' => $parcelShop->isCodHandler(), - 'payByBankCard' => $parcelShop->hasPayByBankCard(), - 'dropOffPoint' => $parcelShop->isDropOffPoint(), - 'owner' => $parcelShop->getOwner(), - 'isParcelLocker' => $parcelShop->isParcelLocker(), - 'vendorUrl' => $parcelShop->getVendorUrl(), - 'pickupTime' => $parcelShop->getPickupTime(), - 'info' => $parcelShop->getInfo(), + 'shopId' => $parcelShop->shopId, + 'name' => $parcelShop->name, + 'countryCode' => $parcelShop->countryCode->value, + 'isCodHandler' => $parcelShop->isCodHandler, + 'payByBankCard' => $parcelShop->payByBankCard, + 'isParcelLocker' => $parcelShop->isParcelLocker, + 'pickupTime' => $parcelShop->pickupTime, + 'info' => $parcelShop->info, 'address' => [ - 'zipCode' => $address->getZipCode(), - 'city' => $address->getCity(), - 'place' => $address->getPlace(), - 'contact' => $address->getContact(), - 'phone' => $address->getPhone(), - 'email' => $address->getEmail(), + 'zipCode' => $parcelShop->address->zipCode, + 'city' => $parcelShop->address->city, + 'place' => $parcelShop->address->place, + 'phone' => $parcelShop->address->phone, + 'email' => $parcelShop->address->email, + 'web' => $parcelShop->address->web, ], - 'openings' => $actualOpenings, - 'coordinates' => null === $parcelShop->getCoordinates() ? null : [ - 'latitude' => $parcelShop->getCoordinates()->latitude, - 'longitude' => $parcelShop->getCoordinates()->longitude, + 'openings' => $openings, + 'coordinates' => [ + 'latitude' => $parcelShop->coordinates->latitude, + 'longitude' => $parcelShop->coordinates->longitude, ], - 'holidayStarts' => $parcelShop->getHolidayEnds(), - 'holidayEnds' => $parcelShop->getHolidayEnds(), + 'features' => $features, ]; } @@ -128,18 +129,13 @@ private function assertOfficeSame(array $parcelShops): void ); } - private function getLogger(array $parcelShops = []): LoggerInterface + private function getLogger(): LoggerInterface { $expected = [ - '[GLS_BUNDLE] Request - /psmap/psmap_getdata.php?action=getList&ctrcode=SI&pclshopin=1&parcellockin=1', - '[GLS_BUNDLE] Response - /psmap/psmap_getdata.php?action=getList&ctrcode=SI&pclshopin=1&parcellockin=1', + '[GLS_BUNDLE] Request - /data/deliveryPoints/si.json', + '[GLS_BUNDLE] Response - /data/deliveryPoints/si.json', ]; - foreach ($parcelShops as $parcelShop) { - $expected[] = '[GLS_BUNDLE] Request - /psmap/psmap_getdata.php?action=getOpenings&pclshopid=' . $parcelShop['pclshopid']; - $expected[] = '[GLS_BUNDLE] Response - /psmap/psmap_getdata.php?action=getOpenings&pclshopid=' . $parcelShop['pclshopid']; - } - $invalidMessages = []; $logger = $this->createMock(LoggerInterface::class); $logger->expects(self::exactly(count($expected))) diff --git a/tests/Integration/Service/data/openings.json b/tests/Integration/Service/data/openings.json deleted file mode 100644 index b9e2029..0000000 --- a/tests/Integration/Service/data/openings.json +++ /dev/null @@ -1,37 +0,0 @@ -[ - { - "day": "monday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" - } -] diff --git a/tests/Integration/Service/data/parcelShops.json b/tests/Integration/Service/data/parcelShops.json index 0fe067b..faa74c2 100644 --- a/tests/Integration/Service/data/parcelShops.json +++ b/tests/Integration/Service/data/parcelShops.json @@ -1,531 +1,898 @@ -[ - { - "pclshopid": "1000-PETROL08", - "name": "BS LJUBLJANA - ZALO\u0160KA", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "ZALO\u0160KA CESTA 60A", - "contact": null, - "phone": "01 54 21 140", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.0559", - "geolng": "14.5389", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL20", - "name": "BS LJUBLJANA AC - BARJE SEVER", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "CESTA DVEH CESARJEV 71", - "contact": null, - "phone": "01 42 36 530", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.0291", - "geolng": "14.4817", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-DELO06", - "name": "DELO PRODAJA , D.D.", - "ctrcode": "SI", - "zipcode": "1000", - "city": "Ljubljana", - "address": "Dunajska 107", - "contact": null, - "phone": null, - "email": null, - "iscodhandler": "t", - "paybybankcard": "f", - "dropoffpoint": "f", - "geolat": "46.0744", - "geolng": "14.5109", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-NOGROUPGRP", - "name": "TEST PS", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "Cesta v Prod 84", - "contact": "TT", - "phone": "015001150", - "email": "it@gls-slovenia.com", - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "f", - "geolat": "46.0739", - "geolng": "14.6088", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL27", - "name": "BS LJUBLJANA - BARJANSAKA CESTA", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "BARJANSKA CESTA 90", - "contact": null, - "phone": null, - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.034", - "geolng": "14.5002", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PARCELLOCK16", - "name": "PAKETOMAT BS Petrol Trnovo", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "Riharjeva ulica 31, Petrol", - "contact": null, - "phone": "01 500 11 50", - "email": "info@gls-slovenia.com", - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.0392", - "geolng": "14.5", - "owner": "GLS", - "isparcellocker": "t", - "vendor_url": null, - "pcl_pickup_time": null, - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL01", - "name": "Testna paketna trgovina", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "Samo za namen testranja", - "contact": "NI AKTIVEN", - "phone": null, - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "f", - "geolat": "46.0569", - "geolng": "14.5058", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "11:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL26", - "name": "BS LJUBLJANA - KAJUHOVA", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "KAJUHOVA ULICA 32S", - "contact": null, - "phone": "01 54 43 961", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.0615", - "geolng": "14.5382", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL23", - "name": "BS LJUBLJANA - \u010cRNU\u010cE, \u0160TAJERSKA", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "\u0160TAJERSKA CESTA 10", - "contact": null, - "phone": "01 56 35 610", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.1058", - "geolng": "14.5451", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL05", - "name": "BS LJUBLJANA - DUNAJSKA 130", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "DUNAJSKA CESTA 130", - "contact": null, - "phone": "01 56 53 490", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.0781", - "geolng": "14.5126", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL21", - "name": "BS LJUBLJANA AC - BARJE JUG", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "CESTA DVEH CESARJEV 73", - "contact": null, - "phone": "01 42 36 540", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.0288", - "geolng": "14.4784", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL19", - "name": "BS LJUBLJANA - RUDNIK ZAHOD", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "DOLENJSKA CESTA 242F", - "contact": null, - "phone": "01 42 12 670", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.0197", - "geolng": "14.5423", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL18", - "name": "BS LJUBLJANA - DUNAJSKA 70", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "DUNAJSKA CESTA 70", - "contact": null, - "phone": "01 43 64 770", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.069", - "geolng": "14.511", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-TRAFIKADVA10", - "name": "PS 3DVA LJUBLJANA AJDOV\u0160\u010cINA PODHOD", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "Ajdov\u0161\u010dina 1 - PODHOD", - "contact": null, - "phone": "051 282-735", - "email": "703401@trafika3dva.si", - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "f", - "geolat": "46.0538", - "geolng": "14.5046", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-PETROL17", - "name": "BS LJUBLJANA - TRNOVO", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "RIHARJEVA ULICA 31", - "contact": null, - "phone": "01 42 92 380", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.0393", - "geolng": "14.5", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "6000-PARCELLOCK01", - "name": "PAKETOMAT OMV BERTOKI", - "ctrcode": "SI", - "zipcode": "6000", - "city": "Koper", - "address": "Cesta med vinogradi 52", - "contact": null, - "phone": "01 500 11 50", - "email": "INFO@GLS-SLOVENIA.COM", - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "45.5554", - "geolng": "13.7809", - "owner": "GLS", - "isparcellocker": "t", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "9000-PETROL03", - "name": "BS MURSKA SOBOTA - PLESE", - "ctrcode": "SI", - "zipcode": "9000", - "city": "MURSKA SOBOTA", - "address": "PANONSKA ULICA 5", - "contact": null, - "phone": "02 522 10 05", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.6565", - "geolng": "16.1714", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "9000-OMV", - "name": "OMV SLOVENIJA D.O.O.", - "ctrcode": "SI", - "zipcode": "9000", - "city": "MURSKA SOBOTA", - "address": "Lendavska 60d", - "contact": null, - "phone": null, - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.6668", - "geolng": "16.177", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "9000-TRAFIKADVA02", - "name": "TRAFIKA 3DVA D.O.O.", - "ctrcode": "SI", - "zipcode": "9000", - "city": "MURSKA SOBOTA", - "address": "Kocljeva 3, Tr\u017enica", - "contact": null, - "phone": "051 282-634", - "email": "701201@trafika3dva.si", - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.6604", - "geolng": "16.1644", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "9000-PETROL02", - "name": "BS MURSKA SOBOTA AC - JUG", - "ctrcode": "SI", - "zipcode": "9000", - "city": "MURSKA SOBOTA", - "address": "BAKOVSKA ULICA 51", - "contact": null, - "phone": "02 53 71 215", - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "46.6345", - "geolng": "16.1641", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": "10:00", - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "6000-OMV01", - "name": "OMV SLOVENIJA D.O.O.", - "ctrcode": "SI", - "zipcode": "6000", - "city": "KOPER", - "address": "Istrska cesta 53", - "contact": null, - "phone": null, - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "45.539", - "geolng": "13.7287", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": null, - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "6000-OMV01", - "name": "OMV SLOVENIJA D.O.O.", - "ctrcode": "SI", - "zipcode": "6000", - "city": "KOPER", - "address": "Istrska cesta 53", - "contact": null, - "phone": null, - "email": null, - "iscodhandler": "t", - "paybybankcard": "t", - "dropoffpoint": "t", - "geolat": "45.539", - "geolng": "13.7287", - "owner": "GLS", - "isparcellocker": "f", - "vendor_url": null, - "pcl_pickup_time": null, - "info": null, - "holidaystarts": null, - "holidayends": null - }, - { - "pclshopid": "1000-OMV04", - "name": "PS OMV LJUBLJANA LITIJSKA", - "ctrcode": "SI", - "zipcode": "1000", - "city": "LJUBLJANA", - "address": "Litijska cesta 40", - "contact": null, - "phone": null, - "email": null, - "iscodhandler": null, - "paybybankcard": null, - "dropoffpoint": null, - "geolat": null, - "geolng": null, - "owner": "GLS", - "isparcellocker": null, - "vendor_url": null, - "pcl_pickup_time": null, - "info": null, - "holidaystarts": null, - "holidayends": null - } -] +{ + "items": [ + { + "id": "1000-PETROL08", + "goldId": 4192, + "name": "BS LJUBLJANA - ZALOŠKA", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "ZALOŠKA CESTA 60A", + "phone": "01 54 21 140", + "web": null + }, + "location": [ + 46.0559, + 14.5389 + ], + "hours": [ + [ + 1, + "00:00", + "24:00" + ], + [ + 2, + "00:00", + "24:00" + ], + [ + 3, + "00:00", + "24:00" + ], + [ + 4, + "00:00", + "24:00" + ], + [ + 5, + "00:00", + "24:00" + ], + [ + 6, + "00:00", + "24:00" + ], + [ + 7, + "00:00", + "24:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery", + "aa" + ], + "pickupTime": "10:00", + "type": "parcel-shop", + "externalId": "104192" + }, + { + "id": "1000-PETROL20", + "goldId": 4204, + "name": "BS LJUBLJANA AC - BARJE SEVER", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "CESTA DVEH CESARJEV 71" + }, + "location": [ + 46.0291, + 14.4817 + ], + "hours": [ + [ + 1, + "00:00", + "24:00" + ], + [ + 2, + "00:00", + "24:00" + ], + [ + 3, + "00:00", + "24:00" + ], + [ + 4, + "00:00", + "24:00" + ], + [ + 5, + "00:00", + "24:00" + ], + [ + 6, + "00:00", + "24:00" + ], + [ + 7, + "00:00", + "24:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "pickupTime": "10:00", + "type": "parcel-shop", + "externalId": "104204" + }, + { + "id": "1000-PETROL27", + "goldId": 4211, + "name": "BS LJUBLJANA - BARJANSAKA CESTA", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "BARJANSKA CESTA 90" + }, + "location": [ + 46.034, + 14.5002 + ], + "hours": [ + [ + 1, + "06:00", + "22:00" + ], + [ + 2, + "06:00", + "22:00" + ], + [ + 3, + "06:00", + "22:00" + ], + [ + 4, + "06:00", + "22:00" + ], + [ + 5, + "06:00", + "22:00" + ], + [ + 6, + "07:00", + "21:00" + ], + [ + 7, + "07:00", + "21:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "pickupTime": "10:00", + "type": "parcel-shop", + "externalId": "104211" + }, + { + "id": "1000-PARCELLOCK16", + "goldId": 3790, + "name": "PAKETOMAT BS Petrol Trnovo", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "Riharjeva ulica 31, Petrol" + }, + "location": [ + 46.0392, + 14.5 + ], + "hours": [ + [ + 1, + "00:00", + "24:00" + ], + [ + 2, + "00:00", + "24:00" + ], + [ + 3, + "00:00", + "24:00" + ], + [ + 4, + "00:00", + "24:00" + ], + [ + 5, + "00:00", + "24:00" + ], + [ + 6, + "00:00", + "24:00" + ], + [ + 7, + "00:00", + "24:00" + ] + ], + "features": [ + "acceptsCard", + "pickup", + "delivery" + ], + "type": "parcel-locker", + "externalId": "103790" + }, + { + "id": "1000-PETROL26", + "goldId": 4210, + "name": "BS LJUBLJANA - KAJUHOVA", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "KAJUHOVA ULICA 32S", + "email": "kajuhova@kajuhova.com" + }, + "location": [ + 46.0615, + 14.5382 + ], + "hours": [ + [ + 1, + "06:00", + "22:00" + ], + [ + 2, + "06:00", + "22:00" + ], + [ + 3, + "06:00", + "22:00" + ], + [ + 4, + "06:00", + "22:00" + ], + [ + 5, + "06:00", + "22:00" + ], + [ + 6, + "06:00", + "22:00" + ], + [ + 7, + "08:00", + "20:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "type": "parcel-shop", + "externalId": "104210" + }, + { + "id": "1000-PETROL23", + "goldId": 4207, + "name": "BS LJUBLJANA - ČRNUČE, ŠTAJERSKA", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "ŠTAJERSKA CESTA 10" + }, + "location": [ + 46.1058, + 14.5451 + ], + "hours": [ + [ + 1, + "06:00", + "23:00" + ], + [ + 2, + "06:00", + "23:00" + ], + [ + 3, + "06:00", + "23:00" + ], + [ + 4, + "06:00", + "23:00" + ], + [ + 5, + "06:00", + "23:00" + ], + [ + 6, + "06:00", + "23:00" + ], + [ + 7, + "08:00", + "22:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "type": "parcel-shop", + "externalId": "104207" + }, + { + "id": "1000-PETROL05", + "goldId": 4189, + "name": "BS LJUBLJANA - DUNAJSKA 130", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "DUNAJSKA CESTA 130" + }, + "location": [ + 46.0781, + 14.5126 + ], + "hours": [ + [ + 1, + "00:00", + "24:00" + ], + [ + 2, + "00:00", + "24:00" + ], + [ + 3, + "00:00", + "24:00" + ], + [ + 4, + "00:00", + "24:00" + ], + [ + 5, + "00:00", + "24:00" + ], + [ + 6, + "00:00", + "24:00" + ], + [ + 7, + "00:00", + "24:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "type": "parcel-shop", + "externalId": "104189" + }, + { + "id": "1000-PETROL21", + "goldId": 4205, + "name": "BS LJUBLJANA AC - BARJE JUG", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "CESTA DVEH CESARJEV 73" + }, + "location": [ + 46.0288, + 14.4784 + ], + "hours": [ + [ + 1, + "00:00", + "24:00" + ], + [ + 2, + "00:00", + "24:00" + ], + [ + 3, + "00:00", + "24:00" + ], + [ + 4, + "00:00", + "24:00" + ], + [ + 5, + "00:00", + "24:00" + ], + [ + 6, + "00:00", + "24:00" + ], + [ + 7, + "00:00", + "24:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "type": "parcel-shop", + "externalId": "104205" + }, + { + "id": "1000-PETROL19", + "goldId": 4203, + "name": "BS LJUBLJANA - RUDNIK ZAHOD", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "DOLENJSKA CESTA 242F" + }, + "location": [ + 46.0197, + 14.5423 + ], + "hours": [ + [ + 1, + "07:00", + "20:00" + ], + [ + 2, + "07:00", + "20:00" + ], + [ + 3, + "07:00", + "20:00" + ], + [ + 4, + "07:00", + "20:00" + ], + [ + 5, + "07:00", + "20:00" + ], + [ + 6, + "06:00", + "19:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "type": "parcel-shop", + "externalId": "104203" + }, + { + "id": "1000-PETROL18", + "goldId": 4202, + "name": "BS LJUBLJANA - DUNAJSKA 70", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "DUNAJSKA CESTA 70" + }, + "location": [ + 46.069, + 14.511 + ], + "hours": [ + [ + 1, + "06:00", + "22:00" + ], + [ + 2, + "06:00", + "22:00" + ], + [ + 3, + "06:00", + "22:00" + ], + [ + 4, + "06:00", + "22:00" + ], + [ + 5, + "06:00", + "22:00" + ], + [ + 6, + "06:00", + "22:00" + ], + [ + 7, + "07:00", + "22:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "pickupTime": "10:00", + "type": "parcel-shop", + "externalId": "104202" + }, + { + "id": "1000-TRAFIKADVA10", + "goldId": 4624, + "name": "PS 3DVA LJUBLJANA AJDOVŠČINA PODHOD", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "Ajdovščina 1 - PODHOD" + }, + "location": [ + 46.0538, + 14.5046 + ], + "hours": [], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "pickupTime": "10:00", + "type": "parcel-shop", + "externalId": "104624" + }, + { + "id": "1000-PETROL17", + "goldId": 4201, + "name": "BS LJUBLJANA - TRNOVO", + "contact": { + "countryCode": "SI", + "postalCode": "1000", + "city": "LJUBLJANA", + "address": "RIHARJEVA ULICA 31" + }, + "location": [ + 46.0393, + 14.5 + ], + "hours": [ + [ + 1, + "06:00", + "20:00" + ], + [ + 2, + "06:00", + "20:00" + ], + [ + 3, + "06:00", + "20:00" + ], + [ + 4, + "06:00", + "20:00" + ], + [ + 5, + "06:00", + "20:00" + ], + [ + 6, + "06:00", + "13:00" + ] + ], + "features": [], + "type": "parcel-shop", + "externalId": "104201" + }, + { + "id": "6000-PARCELLOCK01", + "goldId": 3750, + "name": "PAKETOMAT OMV BERTOKI", + "contact": { + "countryCode": "SI", + "postalCode": "6000", + "city": "Koper", + "address": "Cesta med vinogradi 52" + }, + "location": [ + 45.5554, + 13.7809 + ], + "hours": [ + [ + 1, + "00:00", + "24:00" + ], + [ + 2, + "00:00", + "24:00" + ], + [ + 3, + "00:00", + "24:00" + ], + [ + 4, + "00:00", + "24:00" + ], + [ + 5, + "00:00", + "24:00" + ], + [ + 6, + "00:00", + "24:00" + ], + [ + 7, + "00:00", + "24:00" + ] + ], + "features": [ + "acceptsCard", + "pickup", + "delivery" + ], + "type": "parcel-locker", + "externalId": "103750" + }, + { + "id": "9000-PETROL03", + "goldId": 4483, + "name": "BS MURSKA SOBOTA - PLESE", + "contact": { + "countryCode": "SI", + "postalCode": "9000", + "city": "MURSKA SOBOTA", + "address": "PANONSKA ULICA 5" + }, + "location": [ + 46.6565, + 16.1714 + ], + "hours": [ + [ + 1, + "00:00", + "24:00" + ], + [ + 2, + "00:00", + "24:00" + ], + [ + 3, + "00:00", + "24:00" + ], + [ + 4, + "00:00", + "24:00" + ], + [ + 5, + "00:00", + "24:00" + ], + [ + 6, + "00:00", + "24:00" + ], + [ + 7, + "00:00", + "24:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "type": "parcel-shop", + "externalId": "104483" + }, + { + "id": "9000-TRAFIKADVA02", + "goldId": 4720, + "name": "TRAFIKA 3DVA D.O.O.", + "contact": { + "countryCode": "SI", + "postalCode": "9000", + "city": "MURSKA SOBOTA", + "address": "Kocljeva 3, Tržnica" + }, + "location": [ + 46.6604, + 16.1644 + ], + "hours": [ + [ + 1, + "06:00", + "19:30" + ], + [ + 2, + "06:00", + "19:30" + ], + [ + 3, + "06:00", + "19:30" + ], + [ + 4, + "06:00", + "19:30" + ], + [ + 5, + "06:00", + "19:30" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "type": "parcel-shop", + "externalId": "104720" + }, + { + "id": "9000-PETROL02", + "goldId": 4482, + "name": "BS MURSKA SOBOTA AC - JUG", + "contact": { + "countryCode": "SI", + "postalCode": "9000", + "city": "MURSKA SOBOTA", + "address": "BAKOVSKA ULICA 51" + }, + "location": [ + 46.6345, + 16.1641 + ], + "hours": [ + [ + 1, + "00:00", + "24:00" + ], + [ + 2, + "00:00", + "24:00" + ], + [ + 3, + "00:00", + "24:00" + ], + [ + 4, + "00:00", + "24:00" + ], + [ + 5, + "00:00", + "24:00" + ], + [ + 6, + "00:00", + "24:00" + ], + [ + 7, + "00:00", + "24:00" + ] + ], + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ], + "pickupTime": "10:00", + "type": "parcel-shop", + "externalId": "104482" + } + ] +} \ No newline at end of file diff --git a/tests/Integration/Service/data/parcelShops_expected_parcels.json b/tests/Integration/Service/data/parcelShops_expected_parcels.json index de7c896..27509ad 100644 --- a/tests/Integration/Service/data/parcelShops_expected_parcels.json +++ b/tests/Integration/Service/data/parcelShops_expected_parcels.json @@ -5,63 +5,84 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, "pickupTime": "10:00", "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "ZALO\u0160KA CESTA 60A", - "contact": null, "phone": "01 54 21 140", - "email": null + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.0559, "longitude": 14.5389 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-PETROL20", @@ -69,191 +90,84 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, "pickupTime": "10:00", "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "CESTA DVEH CESARJEV 71", - "contact": null, - "phone": "01 42 36 530", - "email": null + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.0291, "longitude": 14.4817 }, - "holidayStarts": null, - "holidayEnds": null - }, - { - "shopId": "1000-DELO06", - "name": "DELO PRODAJA , D.D.", - "countryCode": "SI", - "isCodHandler": true, - "payByBankCard": false, - "dropOffPoint": false, - "owner": "GLS", - "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", - "info": null, - "address": { - "zipCode": "1000", - "city": "Ljubljana", - "place": "Dunajska 107", - "contact": null, - "phone": null, - "email": null - }, - "openings": [ - { - "day": "monday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" - } - ], - "coordinates": { - "latitude": 46.0744, - "longitude": 14.5109 - }, - "holidayStarts": null, - "holidayEnds": null - }, - { - "shopId": "1000-NOGROUPGRP", - "name": "TEST PS", - "countryCode": "SI", - "isCodHandler": true, - "payByBankCard": true, - "dropOffPoint": false, - "owner": "GLS", - "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", - "info": null, - "address": { - "zipCode": "1000", - "city": "LJUBLJANA", - "place": "Cesta v Prod 84", - "contact": "TT", - "phone": "015001150", - "email": "it@gls-slovenia.com" - }, - "openings": [ - { - "day": "monday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" - } - ], - "coordinates": { - "latitude": 46.0739, - "longitude": 14.6088 - }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-PETROL27", @@ -261,191 +175,169 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, "pickupTime": "10:00", "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "BARJANSKA CESTA 90", - "contact": null, "phone": null, - "email": null + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "07:00", + "closeTime": "21:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "07:00", + "closeTime": "21:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.034, "longitude": 14.5002 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-PARCELLOCK16", "name": "PAKETOMAT BS Petrol Trnovo", "countryCode": "SI", - "isCodHandler": true, + "isCodHandler": false, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": true, - "vendorUrl": null, "pickupTime": null, "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "Riharjeva ulica 31, Petrol", - "contact": null, - "phone": "01 500 11 50", - "email": "info@gls-slovenia.com" + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.0392, "longitude": 14.5 }, - "holidayStarts": null, - "holidayEnds": null - }, - { - "shopId": "1000-PETROL01", - "name": "Testna paketna trgovina", - "countryCode": "SI", - "isCodHandler": true, - "payByBankCard": true, - "dropOffPoint": false, - "owner": "GLS", - "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "11:00", - "info": null, - "address": { - "zipCode": "1000", - "city": "LJUBLJANA", - "place": "Samo za namen testranja", - "contact": "NI AKTIVEN", - "phone": null, - "email": null - }, - "openings": [ - { - "day": "monday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" - } - ], - "coordinates": { - "latitude": 46.0569, - "longitude": 14.5058 - }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCard", + "pickup", + "delivery" + ] }, { "shopId": "1000-PETROL26", @@ -453,63 +345,84 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", + "pickupTime": null, "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "KAJUHOVA ULICA 32S", - "contact": null, - "phone": "01 54 43 961", - "email": null + "phone": null, + "email": "kajuhova@kajuhova.com", + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "08:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.0615, "longitude": 14.5382 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-PETROL23", @@ -517,63 +430,84 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", + "pickupTime": null, "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "\u0160TAJERSKA CESTA 10", - "contact": null, - "phone": "01 56 35 610", - "email": null + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "23:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "23:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "23:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "23:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "23:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "23:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "08:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.1058, "longitude": 14.5451 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-PETROL05", @@ -581,63 +515,84 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", + "pickupTime": null, "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "DUNAJSKA CESTA 130", - "contact": null, - "phone": "01 56 53 490", - "email": null + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.0781, "longitude": 14.5126 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-PETROL21", @@ -645,63 +600,84 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", + "pickupTime": null, "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "CESTA DVEH CESARJEV 73", - "contact": null, - "phone": "01 42 36 540", - "email": null + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.0288, "longitude": 14.4784 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-PETROL19", @@ -709,63 +685,76 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", + "pickupTime": null, "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "DOLENJSKA CESTA 242F", - "contact": null, - "phone": "01 42 12 670", - "email": null + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "07:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "07:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "07:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "07:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "07:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "19:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.0197, "longitude": 14.5423 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-PETROL18", @@ -773,63 +762,84 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, "pickupTime": "10:00", "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "DUNAJSKA CESTA 70", - "contact": null, - "phone": "01 43 64 770", - "email": null + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "07:00", + "closeTime": "22:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.069, "longitude": 14.511 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-TRAFIKADVA10", @@ -837,191 +847,185 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": false, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, "pickupTime": "10:00", "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "Ajdov\u0161\u010dina 1 - PODHOD", - "contact": null, - "phone": "051 282-735", - "email": "703401@trafika3dva.si" + "phone": null, + "email": null, + "web": null }, - "openings": [ - { - "day": "monday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" - } - ], + "openings": [], "coordinates": { "latitude": 46.0538, "longitude": 14.5046 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "1000-PETROL17", "name": "BS LJUBLJANA - TRNOVO", "countryCode": "SI", - "isCodHandler": true, - "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", + "isCodHandler": false, + "payByBankCard": false, "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", + "pickupTime": null, "info": null, "address": { "zipCode": "1000", "city": "LJUBLJANA", "place": "RIHARJEVA ULICA 31", - "contact": null, - "phone": "01 42 92 380", - "email": null + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "20:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "13:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.0393, "longitude": 14.5 }, - "holidayStarts": null, - "holidayEnds": null + "features": [] }, { "shopId": "6000-PARCELLOCK01", "name": "PAKETOMAT OMV BERTOKI", "countryCode": "SI", - "isCodHandler": true, + "isCodHandler": false, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": true, - "vendorUrl": null, - "pickupTime": "10:00", + "pickupTime": null, "info": null, "address": { "zipCode": "6000", "city": "Koper", "place": "Cesta med vinogradi 52", - "contact": null, - "phone": "01 500 11 50", - "email": "INFO@GLS-SLOVENIA.COM" + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 45.5554, "longitude": 13.7809 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCard", + "pickup", + "delivery" + ] }, { "shopId": "9000-PETROL03", @@ -1029,127 +1033,84 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", + "pickupTime": null, "info": null, "address": { "zipCode": "9000", "city": "MURSKA SOBOTA", "place": "PANONSKA ULICA 5", - "contact": null, - "phone": "02 522 10 05", - "email": null + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.6565, "longitude": 16.1714 }, - "holidayStarts": null, - "holidayEnds": null - }, - { - "shopId": "9000-OMV", - "name": "OMV SLOVENIJA D.O.O.", - "countryCode": "SI", - "isCodHandler": true, - "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", - "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", - "info": null, - "address": { - "zipCode": "9000", - "city": "MURSKA SOBOTA", - "place": "Lendavska 60d", - "contact": null, - "phone": null, - "email": null - }, - "openings": [ - { - "day": "monday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" - } - ], - "coordinates": { - "latitude": 46.6668, - "longitude": 16.177 - }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "9000-TRAFIKADVA02", @@ -1157,63 +1118,68 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": "10:00", + "pickupTime": null, "info": null, "address": { "zipCode": "9000", "city": "MURSKA SOBOTA", "place": "Kocljeva 3, Tr\u017enica", - "contact": null, - "phone": "051 282-634", - "email": "701201@trafika3dva.si" + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "19:30", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "19:30", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "19:30", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "19:30", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "06:00", + "closeTime": "19:30", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.6604, "longitude": 16.1644 }, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] }, { "shopId": "9000-PETROL02", @@ -1221,251 +1187,83 @@ "countryCode": "SI", "isCodHandler": true, "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", "isParcelLocker": false, - "vendorUrl": null, "pickupTime": "10:00", "info": null, "address": { "zipCode": "9000", "city": "MURSKA SOBOTA", "place": "BAKOVSKA ULICA 51", - "contact": null, - "phone": "02 53 71 215", - "email": null + "phone": null, + "email": null, + "web": null }, "openings": [ { + "number": 1, "day": "monday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 2, "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 3, "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 4, "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 5, "day": "friday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 6, "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null }, { + "number": 7, "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" + "openTime": "00:00", + "closeTime": "24:00", + "breakStart": null, + "breakEnd": null } ], "coordinates": { "latitude": 46.6345, "longitude": 16.1641 }, - "holidayStarts": null, - "holidayEnds": null - }, - { - "shopId": "6000-OMV01", - "name": "OMV SLOVENIJA D.O.O.", - "countryCode": "SI", - "isCodHandler": true, - "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", - "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": null, - "info": null, - "address": { - "zipCode": "6000", - "city": "KOPER", - "place": "Istrska cesta 53", - "contact": null, - "phone": null, - "email": null - }, - "openings": [ - { - "day": "monday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" - } - ], - "coordinates": { - "latitude": 45.539, - "longitude": 13.7287 - }, - "holidayStarts": null, - "holidayEnds": null - }, - { - "shopId": "6000-OMV01", - "name": "OMV SLOVENIJA D.O.O.", - "countryCode": "SI", - "isCodHandler": true, - "payByBankCard": true, - "dropOffPoint": true, - "owner": "GLS", - "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": null, - "info": null, - "address": { - "zipCode": "6000", - "city": "KOPER", - "place": "Istrska cesta 53", - "contact": null, - "phone": null, - "email": null - }, - "openings": [ - { - "day": "monday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" - } - ], - "coordinates": { - "latitude": 45.539, - "longitude": 13.7287 - }, - "holidayStarts": null, - "holidayEnds": null - }, - { - "shopId": "1000-OMV04", - "name": "PS OMV LJUBLJANA LITIJSKA", - "countryCode": "SI", - "isCodHandler": false, - "payByBankCard": false, - "dropOffPoint": false, - "owner": "GLS", - "isParcelLocker": false, - "vendorUrl": null, - "pickupTime": null, - "info": null, - "address": { - "zipCode": "1000", - "city": "LJUBLJANA", - "place": "Litijska cesta 40", - "contact": null, - "phone": null, - "email": null - }, - "openings": [ - { - "day": "monday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "tuesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "wednesday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "thursday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "friday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "saturday", - "open": "00:00-24:00", - "midbreak": "" - }, - { - "day": "sunday", - "open": "00:00-24:00", - "midbreak": "" - } - ], - "coordinates": null, - "holidayStarts": null, - "holidayEnds": null + "features": [ + "acceptsCash", + "acceptsCard", + "delivery" + ] } -] +] \ No newline at end of file diff --git a/tests/MockGuzzleTrait.php b/tests/MockGuzzleTrait.php index 86abf18..e3018d9 100644 --- a/tests/MockGuzzleTrait.php +++ b/tests/MockGuzzleTrait.php @@ -27,7 +27,7 @@ public function setupGuzzleClient(): Client return new Client(['handler' => $handlerStack]); } - public function mockGuzzleResponse(Response $response) + public function mockGuzzleResponse(Response $response): void { $this->guzzleHandler->append($response); }