Skip to content

Commit

Permalink
fix: Bpost and DPD has a minimum of 1 gram
Browse files Browse the repository at this point in the history
(cherry picked from commit b3e70f9)
  • Loading branch information
RichardPerdaan authored and EdieLemoine committed Nov 8, 2021
1 parent e0c71e3 commit 9ec2a1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Model/Consignment/BpostConsignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ public function setRetailNetworkId(string $retailNetworkId): AbstractConsignment
*/
public function validate(): bool
{
if ($this->getTotalWeight() < 50) {
throw new InvalidConsignmentException('It is necessary to at a minimum weight of 50 grams');
if ($this->getTotalWeight() < 1) {
throw new InvalidConsignmentException('It is necessary to at a minimum weight of 1 grams');
}

/** @var \MyParcelNL\Sdk\src\Model\MyParcelCustomsItem $item */
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Consignment/DPDConsignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ public function setRetailNetworkId(string $retailNetworkId): AbstractConsignment
*/
public function validate(): bool
{
if ($this->getTotalWeight() < 10) {
throw new InvalidConsignmentException('It is necessary to at a minimum weight of 10 grams');
if ($this->getTotalWeight() < 1) {
throw new InvalidConsignmentException('It is necessary to at a minimum weight of 1 grams');
}

return parent::validate();
Expand Down

0 comments on commit 9ec2a1b

Please sign in to comment.