add freight orders to carrier

This commit is contained in:
Yisroel Baum 2025-11-13 20:31:11 +02:00
parent 14d7ddfdd3
commit 4971b86180
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
4 changed files with 13 additions and 0 deletions

View file

@ -13,6 +13,7 @@ class Carrier
private string $notes, private string $notes,
private string $loadProfile, private string $loadProfile,
private array $countriesServing, private array $countriesServing,
private array $freightOrders,
) {} ) {}
public function getId(): ?int public function getId(): ?int
@ -59,4 +60,9 @@ class Carrier
{ {
return $this->countriesServing; return $this->countriesServing;
} }
public function getFreightOrders(): array
{
return $this->freightOrders;
}
} }

View file

@ -23,6 +23,7 @@ class CreateCarrier
$this->dto->notes, $this->dto->notes,
$this->dto->loadProfile, $this->dto->loadProfile,
$this->dto->countriesServing, $this->dto->countriesServing,
[],
); );
return $this->carrierRepo->save($carrier); return $this->carrierRepo->save($carrier);

View file

@ -25,6 +25,7 @@ class FakeCarrierRepository implements CarrierRepository
$carrier->getNotes(), $carrier->getNotes(),
$carrier->getLoadProfile(), $carrier->getLoadProfile(),
$carrier->getCountriesServing(), $carrier->getCountriesServing(),
$carrier->getFreightOrders(),
); );
} }
} }
@ -50,6 +51,7 @@ class FakeCarrierRepository implements CarrierRepository
$carrier->getNotes(), $carrier->getNotes(),
$carrier->getLoadProfile(), $carrier->getLoadProfile(),
$carrier->getCountriesServing(), $carrier->getCountriesServing(),
$carrier->getFreightOrders(),
); );
} }
@ -70,6 +72,7 @@ class FakeCarrierRepository implements CarrierRepository
$carrier->getNotes(), $carrier->getNotes(),
$carrier->getLoadProfile(), $carrier->getLoadProfile(),
$carrier->getCountriesServing(), $carrier->getCountriesServing(),
$carrier->getFreightOrders(),
); );
}, $this->existingCarriers); }, $this->existingCarriers);
} }

View file

@ -18,6 +18,7 @@ class GetAllCarriersTest extends TestCase
$notes = 'some notes'; $notes = 'some notes';
$loadProfile = 'LTL/FTL'; $loadProfile = 'LTL/FTL';
$countriesServing = ['USA', 'FRA', 'UK']; $countriesServing = ['USA', 'FRA', 'UK'];
$freightOrders = [];
$repo = new FakeCarrierRepository(); $repo = new FakeCarrierRepository();
$repo->save(new Carrier( $repo->save(new Carrier(
0, 0,
@ -28,6 +29,7 @@ class GetAllCarriersTest extends TestCase
$notes, $notes,
$loadProfile, $loadProfile,
$countriesServing, $countriesServing,
$freightOrders,
)); ));
$useCase = new GetAllCarriers($repo); $useCase = new GetAllCarriers($repo);
$response = $useCase->execute(); $response = $useCase->execute();
@ -41,6 +43,7 @@ class GetAllCarriersTest extends TestCase
$notes, $notes,
$loadProfile, $loadProfile,
$countriesServing, $countriesServing,
$freightOrders,
)], )],
$response $response
); );