Skip to content

Commit

Permalink
Update to support Balikobot API v1.846
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-novotny committed Jan 9, 2019
1 parent 9dc4fba commit 2d8d2ec
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 2 deletions.
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2018-12-26
## [1.0.4] - 2018-01-09
### Added
- Add support for new options from documentation **v1.846** (2018-01-08)
- Add **rec_house_number** attribute
- Add **rec_block** attribute
- Add **rec_enterance** attribute
- Add **rec_floor** attribute
- Add **rec_flat_number** attribute
### Changed
- Move repo to [**@inspirum**](https://github.com/inspirum) account


## [1.0.3] - 2018-01-02
### Fixed
- Fix links url


## [1.0.2] - 2018-01-02
### Changed
- Change composer package name to `inspirum/balikobot`


## [1.0.1] - 2018-12-30
### Fixed
- Fixed tests


## [1.0.0] - 2018-12-27
### Added
- Full support for all requests and options in documentation **v1.845** (2018-11-29)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ $ composer require inspirum/balikobot

## Version

Support all options for Balikobot API described in the [documentation][link-api] (v1.845, 2018-11-29).
Support all options for Balikobot API described in the [documentation][link-api] (v1.846, 2019-01-08).


## Usage
Expand Down
36 changes: 36 additions & 0 deletions src/Definitions/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,40 @@ class Option
* @var string
*/
public const ADR_CONTENT = 'adr_content';

/**
* Číslo popisné, pokud pro danou adresu neexistuje doplňte "0"
*
* @var string
*/
public const REC_HOUSE_NUMBER = 'rec_house_number';

/**
* Identifikátor bloku (přenáší se jen u přepravce BG Speedy).
*
* @var string
*/
public const REC_BLOCK = 'rec_block';

/**
* Číslo vchodu (přenáší se jen u přepravce BG Speedy).
*
* @var string
*/
public const REC_ENTERANCE = 'rec_enterance';

/**
*
* Číslo podlaží (přenáší se jen u přepravce BG Speedy).
*
* @var string
*/
public const REC_FLOOR = 'rec_floor';

/**
* Číslo bytu / apartmánu (přenáší se jen u přepravce BG Speedy).
*
* @var string
*/
public const REC_FLAT_NUMBER = 'rec_flat_number';
}
50 changes: 50 additions & 0 deletions src/Model/Values/Package/DeliveryData.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,54 @@ public function setNote(string $note): void
{
$this->offsetSet(Option::NOTE, $note);
}

/**
* @param string $recHouseNumber
*
* @return void
*/
public function setRecHouseNumber(string $recHouseNumber): void
{
$this->offsetSet(Option::REC_HOUSE_NUMBER, $recHouseNumber);
}

/**
* @param string $recBlock
*
* @return void
*/
public function setRecBlock(string $recBlock): void
{
$this->offsetSet(Option::REC_BLOCK, $recBlock);
}

/**
* @param string $recEnteracne
*
* @return void
*/
public function setRecEnterance(string $recEnteracne): void
{
$this->offsetSet(Option::REC_ENTERANCE, $recEnteracne);
}

/**
* @param string $recFloor
*
* @return void
*/
public function setFloor(string $recFloor): void
{
$this->offsetSet(Option::REC_FLOOR, $recFloor);
}

/**
* @param string $recFlatNumber
*
* @return void
*/
public function setFlatNumber(string $recFlatNumber): void
{
$this->offsetSet(Option::REC_FLAT_NUMBER, $recFlatNumber);
}
}
10 changes: 10 additions & 0 deletions tests/Unit/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ public function testPackageSetters()
$package->setTestBeforePayment(false);
$package->setAdrService(true);
$package->setAdrContent(['b' => '6']);
$package->setRecHouseNumber('18/B');
$package->setRecBlock('15');
$package->setRecEnterance('189-12');
$package->setFloor('4');
$package->setFlatNumber('1900');

$this->assertEquals(
[
Expand Down Expand Up @@ -211,6 +216,11 @@ public function testPackageSetters()
Option::TEST_BEFORE_PAYMENT => 0,
Option::ADR_SERVICE => 1,
Option::ADR_CONTENT => ['b' => '6'],
Option::REC_HOUSE_NUMBER => '18/B',
Option::REC_BLOCK => '15',
Option::REC_ENTERANCE => '189-12',
Option::REC_FLOOR => '4',
Option::REC_FLAT_NUMBER => '1900',
],
$package->toArray()
);
Expand Down

0 comments on commit 2d8d2ec

Please sign in to comment.