From b82ac1aeb1d39ad6707eed8e725e6c064bf571a6 Mon Sep 17 00:00:00 2001 From: Beniamino Carriero Date: Thu, 29 Aug 2024 17:41:06 +0200 Subject: [PATCH 1/6] feat: Tracking API Wrapper --- src/Request/ParcelIDRequest.php | 31 +++++++++++++++++++++++++++++++ src/Response/ParcelIDResponse.php | 8 ++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/Request/ParcelIDRequest.php create mode 100644 src/Response/ParcelIDResponse.php diff --git a/src/Request/ParcelIDRequest.php b/src/Request/ParcelIDRequest.php new file mode 100644 index 0000000..c420677 --- /dev/null +++ b/src/Request/ParcelIDRequest.php @@ -0,0 +1,31 @@ +parcelID = $parcelID; + $this->endpoint = $this->endpoint . '/' . $parcelID; + } +} diff --git a/src/Response/ParcelIDResponse.php b/src/Response/ParcelIDResponse.php new file mode 100644 index 0000000..8ad3548 --- /dev/null +++ b/src/Response/ParcelIDResponse.php @@ -0,0 +1,8 @@ + Date: Thu, 29 Aug 2024 18:23:09 +0200 Subject: [PATCH 2/6] feat: Tracking API Wrapper --- src/Request/ParcelIDRequest.php | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/Request/ParcelIDRequest.php b/src/Request/ParcelIDRequest.php index c420677..fd2fd6d 100644 --- a/src/Request/ParcelIDRequest.php +++ b/src/Request/ParcelIDRequest.php @@ -2,7 +2,9 @@ namespace Andyts93\BrtApiWrapper\Request; +use Andyts93\BrtApiWrapper\Exception\InvalidJsonException; use Andyts93\BrtApiWrapper\Response\ParcelIDResponse; +use GuzzleHttp\Client; class ParcelIDRequest extends BaseRequest { @@ -10,22 +12,23 @@ class ParcelIDRequest extends BaseRequest protected $method = 'GET'; protected $mandatoryFields = []; - /** - * @var string - */ - private $parcelID; - - public function call() + public function callWithPath($parcelID) { - return new ParcelIDResponse(parent::call()); - } + $client = new Client(); - /** - * @param string $parcelID - */ - public function setParcelId($parcelID) - { - $this->parcelID = $parcelID; - $this->endpoint = $this->endpoint . '/' . $parcelID; + $request = $client->createRequest($this->method, 'https://api.brt.it/rest/v1/' . $this->endpoint . '/' . $parcelID); + $request->addHeader('userID', $this->account['userID']); + $request->addHeader('password', $this->account['password']); + + $response = $client->send($request); + + $response = json_decode($response->getBody()); + + if (json_last_error() !== JSON_ERROR_NONE) { + throw new InvalidJsonException(json_last_error_msg(), json_last_error()); + } + + return new ParcelIDResponse($response); } + } From e416c0e52a2ea9e306ddf4e9410e75689e442085 Mon Sep 17 00:00:00 2001 From: Beniamino Carriero Date: Fri, 30 Aug 2024 09:24:13 +0200 Subject: [PATCH 3/6] fix: Static Code Analysis --- src/Request/ParcelIDRequest.php | 3 +-- src/Response/ParcelIDResponse.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Request/ParcelIDRequest.php b/src/Request/ParcelIDRequest.php index fd2fd6d..609ea5d 100644 --- a/src/Request/ParcelIDRequest.php +++ b/src/Request/ParcelIDRequest.php @@ -16,7 +16,7 @@ public function callWithPath($parcelID) { $client = new Client(); - $request = $client->createRequest($this->method, 'https://api.brt.it/rest/v1/' . $this->endpoint . '/' . $parcelID); + $request = $client->createRequest($this->method, 'https://api.brt.it/rest/v1/'.$this->endpoint.'/'.$parcelID); $request->addHeader('userID', $this->account['userID']); $request->addHeader('password', $this->account['password']); @@ -30,5 +30,4 @@ public function callWithPath($parcelID) return new ParcelIDResponse($response); } - } diff --git a/src/Response/ParcelIDResponse.php b/src/Response/ParcelIDResponse.php index 8ad3548..532e316 100644 --- a/src/Response/ParcelIDResponse.php +++ b/src/Response/ParcelIDResponse.php @@ -5,4 +5,4 @@ class ParcelIDResponse extends BaseResponse { protected $rootElement = 'ttParcelIdResponse'; -} \ No newline at end of file +} From 1b4aa92f7ebbdfab155dfa5ef27b2e02502624ca Mon Sep 17 00:00:00 2001 From: Beniamino Carriero Date: Fri, 30 Aug 2024 11:57:15 +0200 Subject: [PATCH 4/6] feat: LabelFormat parameter for Direct Infeed customers --- src/Api/LabelParameter.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Api/LabelParameter.php b/src/Api/LabelParameter.php index 255eca0..04cf195 100644 --- a/src/Api/LabelParameter.php +++ b/src/Api/LabelParameter.php @@ -34,13 +34,19 @@ class LabelParameter */ private $isBarcodeControlRowRequired; + /** + * @var string + */ + private $labelFormat; + public function __construct( $outputType = 'ZPL', $offsetX = 0, $offsetY = 0, $isBorderRequired = 0, $isLogoRequired = 0, - $isBarcodeControlRowRequired = 0 + $isBarcodeControlRowRequired = 0, + $labelFormat = '' ) { $this->outputType = $outputType; @@ -49,6 +55,7 @@ public function __construct( $this->isBorderRequired = $isBorderRequired; $this->isLogoRequired = $isLogoRequired; $this->isBarcodeControlRowRequired = $isBarcodeControlRowRequired; + $this->labelFormat = $labelFormat; } /** @@ -111,6 +118,16 @@ public function setIsBarcodeControlRowRequired($isBarcodeControlRowRequired) return $this; } + /** + * @param string $labelFormat + * @return LabelParameter + */ + public function setLabelFormat($labelFormat) + { + $this->labelFormat = $labelFormat; + return $this; + } + public function toArray() { return [ @@ -119,7 +136,8 @@ public function toArray() 'offsetY' => $this->offsetY, 'isBorderRequired' => $this->isBorderRequired ? 1 : 0, 'isLogoRequired' => $this->isLogoRequired ? 1 : 0, - 'isBarcodeControlRowRequired' => $this->isBarcodeControlRowRequired ? 1 : 0 + 'isBarcodeControlRowRequired' => $this->isBarcodeControlRowRequired ? 1 : 0, + 'labelFormat' => $this->labelFormat ]; } } From 7f1dec6f2571f313a8c4e0fc23e651ac15a29633 Mon Sep 17 00:00:00 2001 From: Beniamino Carriero Date: Fri, 30 Aug 2024 11:57:43 +0200 Subject: [PATCH 5/6] feat: Return From Shop service --- src/Api/ActualSender.php | 84 ++++ src/Request/ReturnRequest.php | 797 ++++++++++++++++++++++++++++++++++ 2 files changed, 881 insertions(+) create mode 100644 src/Api/ActualSender.php create mode 100644 src/Request/ReturnRequest.php diff --git a/src/Api/ActualSender.php b/src/Api/ActualSender.php new file mode 100644 index 0000000..e614f0e --- /dev/null +++ b/src/Api/ActualSender.php @@ -0,0 +1,84 @@ +actualSenderMobilePhoneNumber; + } + + /** + * Set the value of actualSenderMobilePhoneNumber + * + * @return self + */ + public function setActualSenderMobilePhoneNumber($actualSenderMobilePhoneNumber) + { + $this->actualSenderMobilePhoneNumber = $actualSenderMobilePhoneNumber; + + return $this; + } + + /** + * Get the value of actualSenderEmail + */ + public function getActualSenderEmail() + { + return $this->actualSenderEmail; + } + + /** + * Set the value of actualSenderEmail + * + * @return self + */ + public function setActualSenderEmail($actualSenderEmail) + { + $this->actualSenderEmail = $actualSenderEmail; + + return $this; + } + + /** + * Get the value of actualSenderName + */ + public function getActualSenderName() + { + return $this->actualSenderName; + } + + /** + * Set the value of actualSenderName + * + * @return self + */ + public function setActualSenderName($actualSenderName) + { + $this->actualSenderName = $actualSenderName; + + return $this; + } + + public function toArray() + { + return [ + 'actualSenderName' => $this->actualSenderName, + 'actualSenderEmail' => $this->actualSenderEmail, + 'actualSenderMobilePhoneNumber' => $this->actualSenderMobilePhoneNumber + ]; + } +} diff --git a/src/Request/ReturnRequest.php b/src/Request/ReturnRequest.php new file mode 100644 index 0000000..e50462e --- /dev/null +++ b/src/Request/ReturnRequest.php @@ -0,0 +1,797 @@ +dataWrapper => array_filter([ + 'network' => $this->network, + 'departureDepot' => $this->departureDepot, + 'senderCustomerCode' => $this->senderCustomerCode, + 'deliveryFreightTypeCode' => $this->deliveryFreightTypeCode, + 'isAlertRequired' => $this->isAlertRequired, + 'pricingConditionCode' => $this->pricingConditionCode, + 'serviceType' => $this->serviceType, + 'insuranceAmount' => $this->insuranceAmount, + 'insuranceAmountCurrency' => $this->insuranceAmountCurrency, + 'senderParcelType' => $this->senderParcelType, + 'numberOfParcels' => $this->numberOfParcels, + 'weightKG' => $this->weightKG, + 'volumeM3' => $this->volumeM3, + 'quantityToBeInvoiced' => $this->quantityToBeInvoiced, + 'cashOnDelivery' => $this->cashOnDelivery, + 'isCODMandatory' => $this->isCODMandatory, + 'codPaymentType' => $this->codPaymentType, + 'codCurrency' => $this->codCurrency, + 'numericSenderReference' => $this->numericSenderReference, + 'alphanumericSenderReference' => $this->alphanumericSenderReference, + 'notes' => $this->notes, + 'parcelsHandlingCode' => $this->parcelsHandlingCode, + 'deliveryDateRequired' => $this->deliveryDateRequired, + 'deliveryType' => $this->deliveryType, + 'declaredParcelValue' => $this->declaredParcelValue, + 'declaredParcelValueCurrency' => $this->declaredParcelValueCurrency, + 'particularitiesDeliveryManagementCode' => $this->particularitiesDeliveryManagementCode, + 'particularitiesHoldOnStockManagementCode' => $this->particularitiesHoldOnStockManagementCode, + 'variousParticularitiesManagementCode' => $this->variousParticularitiesManagementCode, + 'particularDelivery1' => $this->particularDelivery1, + 'particularDelivery2' => $this->particularDelivery2, + 'palletType1' => $this->palletType1, + 'palletType1Number' => $this->palletType1Number, + 'palletType2' => $this->palletType2, + 'palletType2Number' => $this->palletType2Number, + 'originalSenderCompanyName' => $this->originalSenderCompanyName, + 'originalSenderZIPCode' => $this->originalSenderZIPCode, + 'originalSenderCountryAbbreviationISOAlpha2' => $this->originalSenderCountryAbbreviationISOAlpha2, + 'cmrCode' => $this->cmrCode, + 'neighborNameMandatoryAuthorization' => $this->neighborNameMandatoryAuthorization, + 'pinCodeMandatoryAuthorization' => $this->pinCodeMandatoryAuthorization, + 'packingListPDFName' => $this->packingListPDFName, + 'packingListPDFFlagPrint' => $this->packingListPDFFlagPrint, + 'packingListPDFFlagEmail' => $this->packingListPDFFlagEmail, + 'brtServiceCode' => $this->brtServiceCode, + 'returnDepot' => $this->returnDepot, + 'pudoId' => $this->pudoId], function ($v) { return !is_null($v); }) + , + 'isLabelRequired' => $this->isLabelRequired, + 'labelParameters' => $this->labelParameters->toArray(), + 'actualSender' => $this->actualSender->toArray() + ], function ($v) { + return !is_null($v); + }); + } + + /** + * @param string $network + * @return CreateRequest + */ + public function setNetwork($network) + { + $this->network = $network; + return $this; + } + + /** + * @param int $departureDepot + * @return CreateRequest + */ + public function setDepartureDepot($departureDepot) + { + $this->departureDepot = $departureDepot; + return $this; + } + + /** + * @param string $deliveryFreightTypeCode + * @return CreateRequest + */ + public function setDeliveryFreightTypeCode($deliveryFreightTypeCode) + { + $this->deliveryFreightTypeCode = $deliveryFreightTypeCode; + return $this; + } + + /** + * @param string $isAlertRequired + * @return CreateRequest + */ + public function setIsAlertRequired($isAlertRequired) + { + $this->isAlertRequired = $isAlertRequired; + return $this; + } + + /** + * @param string $pricingConditionCode + * @return CreateRequest + */ + public function setPricingConditionCode($pricingConditionCode) + { + $this->pricingConditionCode = $pricingConditionCode; + return $this; + } + + /** + * @param string $serviceType + * @return CreateRequest + */ + public function setServiceType($serviceType) + { + $this->serviceType = $serviceType; + return $this; + } + + /** + * @param float $insuranceAmount + * @return CreateRequest + */ + public function setInsuranceAmount($insuranceAmount) + { + $this->insuranceAmount = $insuranceAmount; + return $this; + } + + /** + * @param string $insuranceAmountCurrency + * @return CreateRequest + */ + public function setInsuranceAmountCurrency($insuranceAmountCurrency) + { + $this->insuranceAmountCurrency = $insuranceAmountCurrency; + return $this; + } + + /** + * @param string $senderParcelType + * @return CreateRequest + */ + public function setSenderParcelType($senderParcelType) + { + $this->senderParcelType = $senderParcelType; + return $this; + } + + /** + * @param int $numberOfParcels + * @return CreateRequest + */ + public function setNumberOfParcels($numberOfParcels) + { + $this->numberOfParcels = $numberOfParcels; + return $this; + } + + /** + * @param float $weightKG + * @return CreateRequest + */ + public function setWeightKG($weightKG) + { + $this->weightKG = $weightKG; + return $this; + } + + /** + * @param float $volumeM3 + * @return CreateRequest + */ + public function setVolumeM3($volumeM3) + { + $this->volumeM3 = $volumeM3; + return $this; + } + + /** + * @param float $quantityToBeInvoiced + * @return CreateRequest + */ + public function setQuantityToBeInvoiced($quantityToBeInvoiced) + { + $this->quantityToBeInvoiced = $quantityToBeInvoiced; + return $this; + } + + /** + * @param float $cashOnDelivery + * @return CreateRequest + */ + public function setCashOnDelivery($cashOnDelivery) + { + $this->cashOnDelivery = $cashOnDelivery; + return $this; + } + + /** + * @param string $isCODMandatory + * @return CreateRequest + */ + public function setIsCODMandatory($isCODMandatory) + { + $this->isCODMandatory = $isCODMandatory; + return $this; + } + + /** + * @param string $codPaymentType + * @return CreateRequest + */ + public function setCodPaymentType($codPaymentType) + { + $this->codPaymentType = $codPaymentType; + return $this; + } + + /** + * @param string $codCurrency + * @return CreateRequest + */ + public function setCodCurrency($codCurrency) + { + $this->codCurrency = $codCurrency; + return $this; + } + + /** + * @param string $notes + * @return CreateRequest + */ + public function setNotes($notes) + { + $this->notes = $notes; + return $this; + } + + /** + * @param string $parcelsHandlingCode + * @return CreateRequest + */ + public function setParcelsHandlingCode($parcelsHandlingCode) + { + $this->parcelsHandlingCode = $parcelsHandlingCode; + return $this; + } + + /** + * @param string $deliveryDateRequired + * @return CreateRequest + */ + public function setDeliveryDateRequired($deliveryDateRequired) + { + $this->deliveryDateRequired = $deliveryDateRequired; + return $this; + } + + /** + * @param string $deliveryType + * @return CreateRequest + */ + public function setDeliveryType($deliveryType) + { + $this->deliveryType = $deliveryType; + return $this; + } + + /** + * @param float $declaredParcelValue + * @return CreateRequest + */ + public function setDeclaredParcelValue($declaredParcelValue) + { + $this->declaredParcelValue = $declaredParcelValue; + return $this; + } + + /** + * @param string $declaredParcelValueCurrency + * @return CreateRequest + */ + public function setDeclaredParcelValueCurrency($declaredParcelValueCurrency) + { + $this->declaredParcelValueCurrency = $declaredParcelValueCurrency; + return $this; + } + + /** + * @param string $particularitiesDeliveryManagementCode + * @return CreateRequest + */ + public function setParticularitiesDeliveryManagementCode($particularitiesDeliveryManagementCode) + { + $this->particularitiesDeliveryManagementCode = $particularitiesDeliveryManagementCode; + return $this; + } + + /** + * @param string $particularitiesHoldOnStockManagementCode + * @return CreateRequest + */ + public function setParticularitiesHoldOnStockManagementCode($particularitiesHoldOnStockManagementCode) + { + $this->particularitiesHoldOnStockManagementCode = $particularitiesHoldOnStockManagementCode; + return $this; + } + + /** + * @param string $variousParticularitiesManagementCode + * @return CreateRequest + */ + public function setVariousParticularitiesManagementCode($variousParticularitiesManagementCode) + { + $this->variousParticularitiesManagementCode = $variousParticularitiesManagementCode; + return $this; + } + + /** + * @param string $particularDelivery1 + * @return CreateRequest + */ + public function setParticularDelivery1($particularDelivery1) + { + $this->particularDelivery1 = $particularDelivery1; + return $this; + } + + /** + * @param string $particularDelivery2 + * @return CreateRequest + */ + public function setParticularDelivery2($particularDelivery2) + { + $this->particularDelivery2 = $particularDelivery2; + return $this; + } + + /** + * @param string $palletType1 + * @return CreateRequest + */ + public function setPalletType1($palletType1) + { + $this->palletType1 = $palletType1; + return $this; + } + + /** + * @param int $palletType1Number + * @return CreateRequest + */ + public function setPalletType1Number($palletType1Number) + { + $this->palletType1Number = $palletType1Number; + return $this; + } + + /** + * @param string $palletType2 + * @return CreateRequest + */ + public function setPalletType2($palletType2) + { + $this->palletType2 = $palletType2; + return $this; + } + + /** + * @param int $palletType2Number + * @return CreateRequest + */ + public function setPalletType2Number($palletType2Number) + { + $this->palletType2Number = $palletType2Number; + return $this; + } + + /** + * @param string $originalSenderCompanyName + * @return CreateRequest + */ + public function setOriginalSenderCompanyName($originalSenderCompanyName) + { + $this->originalSenderCompanyName = $originalSenderCompanyName; + return $this; + } + + /** + * @param string $originalSenderZIPCode + * @return CreateRequest + */ + public function setOriginalSenderZIPCode($originalSenderZIPCode) + { + $this->originalSenderZIPCode = $originalSenderZIPCode; + return $this; + } + + /** + * @param string $originalSenderCountryAbbreviationISOAlpha2 + * @return CreateRequest + */ + public function setOriginalSenderCountryAbbreviationISOAlpha2($originalSenderCountryAbbreviationISOAlpha2) + { + $this->originalSenderCountryAbbreviationISOAlpha2 = $originalSenderCountryAbbreviationISOAlpha2; + return $this; + } + + /** + * @param string $cmrCode + * @return CreateRequest + */ + public function setCmrCode($cmrCode) + { + $this->cmrCode = $cmrCode; + return $this; + } + + /** + * @param string $neighborNameMandatoryAuthorization + * @return CreateRequest + */ + public function setNeighborNameMandatoryAuthorization($neighborNameMandatoryAuthorization) + { + $this->neighborNameMandatoryAuthorization = $neighborNameMandatoryAuthorization; + return $this; + } + + /** + * @param string $pinCodeMandatoryAuthorization + * @return CreateRequest + */ + public function setPinCodeMandatoryAuthorization($pinCodeMandatoryAuthorization) + { + $this->pinCodeMandatoryAuthorization = $pinCodeMandatoryAuthorization; + return $this; + } + + /** + * @param string $packingListPDFName + * @return CreateRequest + */ + public function setPackingListPDFName($packingListPDFName) + { + $this->packingListPDFName = $packingListPDFName; + return $this; + } + + /** + * @param string $packingListPDFFlagPrint + * @return CreateRequest + */ + public function setPackingListPDFFlagPrint($packingListPDFFlagPrint) + { + $this->packingListPDFFlagPrint = $packingListPDFFlagPrint; + return $this; + } + + /** + * @param string $packingListPDFFlagEmail + * @return CreateRequest + */ + public function setPackingListPDFFlagEmail($packingListPDFFlagEmail) + { + $this->packingListPDFFlagEmail = $packingListPDFFlagEmail; + return $this; + } + + /** + * @param string $pudoId + * @return CreateRequest + */ + public function setPudoId($pudoId) + { + $this->pudoId = $pudoId; + return $this; + } + + /** + * @param ActualSender $actualSender + */ + public function setActualSender($actualSender) + { + $this->actualSender = $actualSender; + return $this; + } + + /** + * @return ActualSender + */ + public function getActualSender() + { + return $this->actualSender; + } + + /** + * Get the value of brtServiceCode + * + * @return string + */ + public function getBrtServiceCode() + { + return $this->brtServiceCode; + } + + /** + * Set the value of brtServiceCode + * + * @param string $brtServiceCode + * + * @return self + */ + public function setBrtServiceCode(string $brtServiceCode) + { + $this->brtServiceCode = $brtServiceCode; + + return $this; + } + + /** + * Get the value of returnDepot + * + * @return string + */ + public function getReturnDepot() + { + return $this->returnDepot; + } + + /** + * Set the value of returnDepot + * + * @param string $returnDepot + * + * @return self + */ + public function setReturnDepot(string $returnDepot) + { + $this->returnDepot = $returnDepot; + + return $this; + } +} From 1f7f68b50d4b872434594c44adba8318ae3c10c6 Mon Sep 17 00:00:00 2001 From: Beniamino Carriero Date: Fri, 28 Feb 2025 15:50:08 +0100 Subject: [PATCH 6/6] feat: Routing API Wrapper --- src/Request/RoutingRequest.php | 229 +++++++++++++++++++++++++++++++ src/Response/RoutingResponse.php | 88 ++++++++++++ 2 files changed, 317 insertions(+) create mode 100644 src/Request/RoutingRequest.php create mode 100644 src/Response/RoutingResponse.php diff --git a/src/Request/RoutingRequest.php b/src/Request/RoutingRequest.php new file mode 100644 index 0000000..b724346 --- /dev/null +++ b/src/Request/RoutingRequest.php @@ -0,0 +1,229 @@ +dataWrapper => array_filter([ + 'network' => $this->network, + 'departureDepot' => $this->departureDepot, + 'senderCustomerCode' => $this->senderCustomerCode, + 'deliveryFreightTypeCode' => $this->deliveryFreightTypeCode, + 'consigneeCompanyName' => $this->consignee->getCompanyName(), + 'consigneeAddress' => $this->consignee->getAddress(), + 'consigneeZIPCode' => $this->consignee->getZipCode(), + 'consigneeCity' => $this->consignee->getCity(), + 'consigneeProvinceAbbreviation' => $this->consignee->getProvince(), + 'consigneeCountryAbbreviationISOAlpha2' => $this->consignee->getCountry(), + 'serviceType' => $this->serviceType, + 'numberOfParcels' => $this->numberOfParcels, + 'weightKG' => $this->weightKG, + 'volumeM3' => $this->volumeM3, + 'variousParticularitiesManagementCode' => $this->variousParticularitiesManagementCode, + 'particularDelivery1' => $this->particularDelivery1, + 'particularDelivery2' => $this->particularDelivery2], function ($v) { return !is_null($v); }) + ], function ($v) { + return !is_null($v); + }); + } + + /** + * @param string $network + * @return CreateRequest + */ + public function setNetwork($network) + { + $this->network = $network; + return $this; + } + + /** + * @param int $departureDepot + * @return CreateRequest + */ + public function setDepartureDepot($departureDepot) + { + $this->departureDepot = $departureDepot; + return $this; + } + + /** + * @param string $deliveryFreightTypeCode + * @return CreateRequest + */ + public function setDeliveryFreightTypeCode($deliveryFreightTypeCode) + { + $this->deliveryFreightTypeCode = $deliveryFreightTypeCode; + return $this; + } + + /** + * @param string $serviceType + * @return CreateRequest + */ + public function setServiceType($serviceType) + { + $this->serviceType = $serviceType; + return $this; + } + + /** + * @param int $numberOfParcels + * @return CreateRequest + */ + public function setNumberOfParcels($numberOfParcels) + { + $this->numberOfParcels = $numberOfParcels; + return $this; + } + + /** + * @param float $weightKG + * @return CreateRequest + */ + public function setWeightKG($weightKG) + { + $this->weightKG = $weightKG; + return $this; + } + + /** + * @param float $volumeM3 + * @return CreateRequest + */ + public function setVolumeM3($volumeM3) + { + $this->volumeM3 = $volumeM3; + return $this; + } + + /** + * @param string $variousParticularitiesManagementCode + * @return CreateRequest + */ + public function setVariousParticularitiesManagementCode($variousParticularitiesManagementCode) + { + $this->variousParticularitiesManagementCode = $variousParticularitiesManagementCode; + return $this; + } + + /** + * @param string $particularDelivery1 + * @return CreateRequest + */ + public function setParticularDelivery1($particularDelivery1) + { + $this->particularDelivery1 = $particularDelivery1; + return $this; + } + + /** + * @param string $particularDelivery2 + * @return CreateRequest + */ + public function setParticularDelivery2($particularDelivery2) + { + $this->particularDelivery2 = $particularDelivery2; + return $this; + } + + /** + * @param Consignee $consignee + */ + public function setConsignee($consignee) + { + $this->consignee = $consignee; + return $this; + } + + /** + * @return Consignee + */ + public function getConsignee() + { + return $this->consignee; + } +} diff --git a/src/Response/RoutingResponse.php b/src/Response/RoutingResponse.php new file mode 100644 index 0000000..1a47872 --- /dev/null +++ b/src/Response/RoutingResponse.php @@ -0,0 +1,88 @@ +arrivalTerminal; + } + + /** + * @return string + */ + public function getArrivalDepot() + { + return $this->arrivalDepot; + } + + /** + * @return string + */ + public function getDeliveryZone() + { + return $this->deliveryZone; + } + + /** + * @return string + */ + public function getConsigneeZIPCode() + { + return $this->consigneeZIPCode; + } + + /** + * @return string + */ + public function getConsigneeCity() + { + return $this->consigneeCity; + } + + /** + * @return string + */ + public function getConsigneeProvinceAbbreviation() + { + return $this->consigneeProvinceAbbreviation; + } +}