Skip to content

Commit

Permalink
Update to support Balikobot API v1.986 - Add "eori" atrribute
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-novotny committed Oct 22, 2023
1 parent 6eb9c4f commit 9efc431
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.


## [Unreleased](https://github.com/inspirum/balikobot-php/compare/v7.6.1...master)
### Added
- Added support for new options from documentation **v1.986** (2023-09-13)
- Added **eori**, **gb_eori** and **eu_eori** attributes


## [v7.6.1 (2023-08-08)](https://github.com/inspirum/balikobot-php/compare/v7.6.0...v7.6.1)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Total Downloads][ico-packagist-download]][link-packagist-download]
[![Software License][ico-license]][link-licence]

Offers implementation of Balikobot API [v2][link-api-v2-upgrade] described in the official [documentation][link-api-v2] until **v1.984** *(2023-07-19)*.
Offers implementation of Balikobot API [v2][link-api-v2-upgrade] described in the official [documentation][link-api-v2] until **v1.987** *(2023-10-04)*.

> If you want to use older API [v1][link-api], please use [`^4.0`](https://github.com/inspirum/balikobot-php/tree/v4.5.0) version.
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"psr/http-message": "^1.1 || ^2.0"
},
"require-dev": {
"inspirum/coding-standard": "^1.3",
"inspirum/coding-standard": "^1.4",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.3",
"phpunit/phpunit": "^10.4",
"squizlabs/php_codesniffer": "^3.7"
},
"autoload": {
Expand Down Expand Up @@ -60,10 +60,10 @@
"@test:integration"
],
"test:unit": [
"@phpunit --testsuite=Unit"
"@phpunit --testsuite=Unit --display-notices"
],
"test:integration": [
"@phpunit --testsuite=Integration"
"@phpunit --testsuite=Integration --display-notices --display-incomplete"
],
"test:coverage": [
"@phpunit --coverage-text --coverage-html=var/phpunit/coverage"
Expand Down
15 changes: 15 additions & 0 deletions src/Definitions/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,21 @@ final class Attribute extends BaseEnum
*/
public const RETURN_BARCODE = 'return_barcode';

/**
* Číslo EORI
*/
public const EORI = 'eori';

/**
* Číslo EORI pro Velkou Británii - poviné pro zásilky do GB nad 135 GBP nebo 2kg
*/
public const GB_EORI = 'gb_eori';

/**
* Číslo EORI pro Evropskou unii - poviné pro zásilky do GB nad 135 GBP nebo 2kg
*/
public const EU_EORI = 'eu_eori';

/**
* @deprecated
*/
Expand Down
15 changes: 15 additions & 0 deletions src/Model/PackageData/Package/ParcelPackageData.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,19 @@ public function setDCLPdf(string $value): void
{
$this->offsetSet(Attribute::DCL_PDF, $value);
}

public function setEORI(string $value): void
{
$this->offsetSet(Attribute::EORI, $value);
}

public function setGBEORI(string $value): void
{
$this->offsetSet(Attribute::GB_EORI, $value);
}

public function setEUEORI(string $value): void
{
$this->offsetSet(Attribute::EU_EORI, $value);
}
}
6 changes: 6 additions & 0 deletions tests/Unit/Model/PackageData/DefaultPackageDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ public function testPackageSetters(): void
$package->setNoteInvoice('note1');
$package->setInvoiceType('PRO_FORMA_INVOICE');
$package->setReturnBarcode(true);
$package->setEORI('1234');
$package->setGBEORI('5678');
$package->setEUEORI('9012');

$unsupportedAttributes = array_diff(Attribute::getAll(), array_keys($package->getData()));

Expand Down Expand Up @@ -377,6 +380,9 @@ public function testPackageSetters(): void
Attribute::NOTE_INVOICE => 'note1',
Attribute::INVOICE_TYPE => 'PRO_FORMA_INVOICE',
Attribute::RETURN_BARCODE => 1,
Attribute::EORI => '1234',
Attribute::GB_EORI => '5678',
Attribute::EU_EORI => '9012',
],
$package->__toArray(),
);
Expand Down

0 comments on commit 9efc431

Please sign in to comment.