add freight orders to carrier
This commit is contained in:
parent
14d7ddfdd3
commit
4971b86180
4 changed files with 13 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ class Carrier
|
|||
private string $notes,
|
||||
private string $loadProfile,
|
||||
private array $countriesServing,
|
||||
private array $freightOrders,
|
||||
) {}
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
@ -59,4 +60,9 @@ class Carrier
|
|||
{
|
||||
return $this->countriesServing;
|
||||
}
|
||||
|
||||
public function getFreightOrders(): array
|
||||
{
|
||||
return $this->freightOrders;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class CreateCarrier
|
|||
$this->dto->notes,
|
||||
$this->dto->loadProfile,
|
||||
$this->dto->countriesServing,
|
||||
[],
|
||||
);
|
||||
|
||||
return $this->carrierRepo->save($carrier);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class FakeCarrierRepository implements CarrierRepository
|
|||
$carrier->getNotes(),
|
||||
$carrier->getLoadProfile(),
|
||||
$carrier->getCountriesServing(),
|
||||
$carrier->getFreightOrders(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -50,6 +51,7 @@ class FakeCarrierRepository implements CarrierRepository
|
|||
$carrier->getNotes(),
|
||||
$carrier->getLoadProfile(),
|
||||
$carrier->getCountriesServing(),
|
||||
$carrier->getFreightOrders(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -70,6 +72,7 @@ class FakeCarrierRepository implements CarrierRepository
|
|||
$carrier->getNotes(),
|
||||
$carrier->getLoadProfile(),
|
||||
$carrier->getCountriesServing(),
|
||||
$carrier->getFreightOrders(),
|
||||
);
|
||||
}, $this->existingCarriers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class GetAllCarriersTest extends TestCase
|
|||
$notes = 'some notes';
|
||||
$loadProfile = 'LTL/FTL';
|
||||
$countriesServing = ['USA', 'FRA', 'UK'];
|
||||
$freightOrders = [];
|
||||
$repo = new FakeCarrierRepository();
|
||||
$repo->save(new Carrier(
|
||||
0,
|
||||
|
|
@ -28,6 +29,7 @@ class GetAllCarriersTest extends TestCase
|
|||
$notes,
|
||||
$loadProfile,
|
||||
$countriesServing,
|
||||
$freightOrders,
|
||||
));
|
||||
$useCase = new GetAllCarriers($repo);
|
||||
$response = $useCase->execute();
|
||||
|
|
@ -41,6 +43,7 @@ class GetAllCarriersTest extends TestCase
|
|||
$notes,
|
||||
$loadProfile,
|
||||
$countriesServing,
|
||||
$freightOrders,
|
||||
)],
|
||||
$response
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue