Skip to content
Draft

V3 #5

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: statusweb-client
type: php
docroot: ""
php_version: "8.5"
webserver_type: generic
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
use_dns_when_possible: true
composer_version: "2"
web_environment: []
corepack_enable: false
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.gitattributes export-ignore
.gitignore export-ignore
.ddev export-ignore
CHANGELOG.md export-ignore
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.idea
vendor
test.php
composer.lock
76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Changelog

## [v3.0.0] - 2026-06-22

### Breaking changes
- PHP requirement raised to `>=8.5`
- Statusweb SOAP API upgraded from v4 to v6
- All `Vrachtnummer` parameters and response fields renamed to `Zendingnummer` (shipment number)
- `ShipmentsEndpoint::getStatus()` parameter changed from `float` to `int`
- `ShipmentsEndpoint::delete()` parameter changed from `float` to `int`
- `ShipmentsEndpoint::getStatusUrl()` now returns `StatusweblinkResponse` instead of `string`
- `ShipmentsEndpoint::getAllStatuses()` now accepts optional `?string $mark` parameter for pagination and returns `StatusResponse` with `mark` and `more` fields
- `LabelsEndpoint::get()` parameter changed from `float` to `int`
- `SendShipmentsResponse::getSendShipmentData()` renamed to `getShipments()`
- `StatusDataResponse::getTransportNumber()` renamed to `getShipmentNumber()`
- `ShipmentResponse::getTransportNumber()` renamed to `getShipmentNumber()`
- `DeleteShipmentResponse::getTransportNumber()` renamed to `getShipmentNumber()`
- `SendShipmentResponse::getTransportNumber()` renamed to `getShipmentNumber()`
- `LabelResponse::getTransportNumber()` renamed to `getShipmentNumber()`
- `ResponseCode::COUNTRY_CODE_INVALID` split into `COUNTRY_CODE_DELIVERY_INVALID` (-105) and `COUNTRY_CODE_LOADING_INVALID` (-111)
- `ResponseCode::NO_ETA_FOR_SHIPMENT` corrected from -320 to -400
- `ResponseCode::UNKNOWN_RESULT_ID` renamed to `DELIVERY_REQUEST_NOT_FOUND` (-550)

### New features

#### TMS — new endpoint methods on `$client->shipments()`
- `addShipmentRow(int $shipmentNumber, ShipmentRow $row, LabelData $labelData): AddShipmentRowResponse`
- `deleteShipmentRow(int $shipmentNumber, int $rowId): DeleteShipmentRowResponse`
- `sendShipment(int $shipmentNumber): SendShipmentsResponse`
- `getInfo(int $shipmentNumber): ZendingInfoResponse`
- `getInfoSend(int $shipmentNumber): ZendingInfoResponse`
- `getPod(int $shipmentNumber): PodResponse`
- `getPhotos(int $shipmentNumber): FotoResponse`
- `getStatusTable(): StatusTableItem[]`
- `getShipmentTypeTable(): ShipmentTypeTableItem[]`

#### WMS — new endpoint `$client->wms()`
- `getInventory(): InventoryResponse`
- `getArticleInventory(string $articleNumber): InventoryResponse`
- `createDeliveryRequest(DeliveryRequest $request): DeliveryRequestResponse`
- `deleteDeliveryRequest(int $deliveryId): DeleteDeliveryResponse`
- `getDeliveryRequestStatus(int $deliveryId): DeliveryStatusResponse`
- `getShipmentsByDeliveryRequest(int $deliveryId): SendShipmentsResponse`

#### New resource classes
- `AdrData` — ADR (hazardous goods) request data for shipment rows
- `BarcodeData` — barcode request/response data
- `AddShipmentRowResponse`
- `DeleteShipmentRowResponse`
- `StatusweblinkResponse`
- `ShipmentInfoResponse` — full shipment detail response
- `PodResponse` — proof of delivery response
- `PhotoData`, `PhotoResponse` — delivery photo response
- `StatusTableItem`, `ShipmentTypeTableItem` — table lookup responses
- `Wms\ArticleData`, `Wms\DeliveryRequest`
- `Wms\InventoryItem`, `Wms\InventoryResponse`
- `Wms\DeliveryRequestResponse`, `Wms\DeleteDeliveryResponse`
- `Wms\DeliveryStatusItem`, `Wms\DeliveryStatusResponse`

#### Enhancements to existing resources
- `ShipmentRow` — added `barcodes` (BarcodeData[]) and `adr` (AdrData) properties (not sent in `PutZending`; API does not accept these fields in `ZendingregelData`)
- `ShipmentResponse` — added `statuswebLink`, `labelLength`, `barcodes`, `rowIds`
- `SendShipmentResponse` — added `statuswebLink`
- `LabelResponse` — added `labelLength`, `barcodes`
- `EtaResponse` — added `shipmentNumber`, `reference`
- `StatusResponse` — added `mark`, `hasMore` for paginated `GetStatus` polling
- `CountryCode` — added `LUXEMBOURG = 352`

---

## [v2.0.0]

- Statusweb SOAP API v4
- TMS functions: create, delete, send, getStatus, getAllStatuses, getStatusUrl, getEstimatedTimeOfArrival
- Labels endpoint: get label by shipment number
- Session management with configurable session store
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": ">=7.2",
"php": ">=8.5",
"ext-soap": "*",
"ext-json": "*"
},
Expand Down
20 changes: 0 additions & 20 deletions composer.lock

This file was deleted.

93 changes: 20 additions & 73 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,16 @@

class Client
{
public const SOAP_DOCUMENT = 'https://www.statusweb.nl/StatuswebAPIv4/Service.wso?WSDL';

/**
* @var SoapClient
*/
private $soapClient;

/**
* @var SessionStore
*/
private $sessionStore;

/**
* @var Endpoints\SessionEndpoint
*/
private $sessionEndpoint;

/**
* @var Endpoints\ShipmentsEndpoint
*/
private $shipmentsEndpoint;

/**
* @var Endpoints\LabelsEndpoint
*/
private $labelsEndpoint;

/**
* @var string
*/
private $apiKey;

/**
* @var string
*/
private $password;
public const SOAP_DOCUMENT = 'https://www.statusweb.nl/StatuswebAPIv6/Service.wso?WSDL';

private SoapClient $soapClient;
private SessionStore $sessionStore;
private Endpoints\SessionEndpoint $sessionEndpoint;
private Endpoints\ShipmentsEndpoint $shipmentsEndpoint;
private Endpoints\LabelsEndpoint $labelsEndpoint;
private Endpoints\WmsEndpoint $wmsEndpoint;
private string $apiKey;
private string $password;

public function __construct()
{
Expand All @@ -53,91 +27,64 @@ public function __construct()
$this->sessionEndpoint = new Endpoints\SessionEndpoint($this);
$this->shipmentsEndpoint = new Endpoints\ShipmentsEndpoint($this);
$this->labelsEndpoint = new Endpoints\LabelsEndpoint($this);
$this->wmsEndpoint = new Endpoints\WmsEndpoint($this);
}

/**
* @param string $apiKey
* @return Client
*/
public function setApiKey(string $apiKey): Client
public function setApiKey(string $apiKey): static
{
$this->apiKey = $apiKey;
return $this;
}

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

/**
* @param string $password
* @return Client
*/
public function setPassword(string $password): Client
public function setPassword(string $password): static
{
$this->password = $password;
return $this;
}

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

/**
* @param SessionStore $sessionStore
* @return Client
*/
public function setSessionStore(SessionStore $sessionStore): Client
public function setSessionStore(SessionStore $sessionStore): static
{
$this->sessionStore = $sessionStore;
return $this;
}

/**
* @return SessionStore
*/
public function getSessionStore(): SessionStore
{
return $this->sessionStore;
}

/**
* @return Endpoints\ShipmentsEndpoint
*/
public function shipments(): Endpoints\ShipmentsEndpoint
{
return $this->shipmentsEndpoint;
}

/**
* @return Endpoints\LabelsEndpoint
*/
public function labels(): Endpoints\LabelsEndpoint
{
return $this->labelsEndpoint;
}

/**
* @return Endpoints\SessionEndpoint
*/
public function session(): Endpoints\SessionEndpoint
{
return $this->sessionEndpoint;
}

/**
* @return SoapClient
*/
public function wms(): Endpoints\WmsEndpoint
{
return $this->wmsEndpoint;
}

public function soap(): SoapClient
{
return $this->soapClient;
}
}
}
7 changes: 0 additions & 7 deletions src/Contracts/Dto.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@

interface Dto
{
/**
* @return array
*/
public function toArray(): array;

/**
* @param array $data
* @return Dto
*/
public static function fromArray(array $data): Dto;
}
4 changes: 0 additions & 4 deletions src/Dto/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ public function toArray(): array
];
}

/**
* @inheritDoc
* @return Session
*/
public static function fromArray(array $data): Dto
{
return (new self)
Expand Down
Loading