Skip to content

Commit

Permalink
feature - MAR-13064 - add tracking number to ConsigmentStatusHistoryItem
Browse files Browse the repository at this point in the history
  • Loading branch information
radekbednar committed Jul 1, 2022
1 parent 4b5876c commit 244cb7f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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
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.1';
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;
}

}

0 comments on commit 244cb7f

Please sign in to comment.