Skip to content

Commit

Permalink
Merge pull request #34 from klingac/MAR-13064
Browse files Browse the repository at this point in the history
v4.1.2
  • Loading branch information
michalkelcik authored Aug 11, 2022
2 parents adbb569 + 244cb7f commit 8290e11
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 4.1.2 - 2022-06-30

### Added

- extendsion `consigment_status_history` in order detail by a `tracking_number`

## 4.1.1 - 2022-02-21

### Added

- added information list media example in PDF

## 4.1.0 - 2021-12-16

### Added
Expand Down
3 changes: 3 additions & 0 deletions example/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
new MediaIterator(
new Media('https://cdn.my-domain.com/my-product-id-1.jpg', true),
new Media('https://cdn.my-domain.com/my-product-id-energy-label.jpg', false, null, true, false),
new Media('https://cdn.my-domain.com/my-product-id-information-list.pdf', false, null, false, true),
),
);
$productRequest->setPrice(69);
Expand Down Expand Up @@ -281,6 +282,7 @@
new MediaIterator(
new Media('https://cdn.my-domain.com/my-variant-id-1.jpg', true),
new Media('https://cdn.my-domain.com/my-variant-id-energy-label.jpg', false, null, true, false),
new Media('https://cdn.my-domain.com/my-variant-id-information-list.pdf', false, null, false, true),
),
new ParameterIterator(
Parameter::create('MP_PARAMETER', 'a', 'b', 'c'),
Expand Down Expand Up @@ -323,6 +325,7 @@
new MediaIterator(
new Media('https://cdn.my-domain.com/my-variant-id-1.jpg', true),
new Media('https://cdn.my-domain.com/my-variant-id-energy-label.jpg', false, null, true, false),
new Media('https://cdn.my-domain.com/my-variant-id-information-list.pdf', false, null, false, true),
),
new ParameterIterator(
Parameter::create('MP_PARAMETER', 'a', 'b', 'c'),
Expand Down
2 changes: 1 addition & 1 deletion src/MpApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class MpApiClient implements ClientInterface, MpApiClientInterface
{

const APP_NAME = 'mp-api-client';
const APP_VERSION = '4.1.0';
const APP_VERSION = '4.1.2';

private BrandClientInterface $brandClient;
private CategoryClientInterface $categoryClient;
Expand Down
14 changes: 13 additions & 1 deletion src/Order/Entity/ConsignmentStatusHistoryItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ final class ConsignmentStatusHistoryItem implements JsonSerializable
*/
private array $flags;

private string $trackingNumber;

/**
* @param DateTimeInterface $date
* @param ConsignmentStatusEnum $code
* @param ConsignmentStatusFlagEnum[] $flags
*/
private function __construct(ConsignmentStatusEnum $code, DateTimeInterface $date, array $flags)
private function __construct(ConsignmentStatusEnum $code, DateTimeInterface $date, array $flags, string $trackingNumber)
{
$this->code = $code;
$this->date = $date;
$this->flags = $flags;
$this->trackingNumber = $trackingNumber;
}

/**
Expand All @@ -44,6 +47,7 @@ public static function createFromApi(array $data): self
new ConsignmentStatusEnum($data[ConsignmentStatusEnum::KEY_NAME]),
new DateTime($data['date']),
array_map(fn(string $flag): ConsignmentStatusFlagEnum => new ConsignmentStatusFlagEnum($flag), $data[ConsignmentStatusFlagEnum::KEY_NAME]),
$data['tracking_number']
);
}

Expand All @@ -65,4 +69,12 @@ public function getFlags(): array
return $this->flags;
}

/**
* @return string
*/
public function getTrackingNumber(): string
{
return $this->trackingNumber;
}

}
2 changes: 1 addition & 1 deletion tests/functional/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@
Fixtures::add(
'article-media',
new MediaIterator(
new Media('https://i.cdn.nrholding.net/21749466', false, null, true, false),
new Media('https://i.cdn.nrholding.net/21749465', true),
new Media('https://i.cdn.nrholding.net/21749466', false, null, true, false),
),
);

Expand Down

0 comments on commit 8290e11

Please sign in to comment.