remove references of carrier and freight order ids from each other

They reference each other in created bid so these arrays are not necessary
This commit is contained in:
Yisroel Baum 2025-11-18 09:08:15 +02:00
parent e79064d909
commit 948380ba9f
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
6 changed files with 0 additions and 69 deletions

View file

@ -16,7 +16,6 @@ class Carrier
private string $notes,
private string $loadProfile,
private array $countriesServing,
private array $freightOrderIds,
) {}
public function getId(): ?int
@ -63,14 +62,4 @@ class Carrier
{
return $this->countriesServing;
}
public function getFreightOrderIds(): array
{
return $this->freightOrderIds;
}
public function setFreightOrderIds(array $ids): void
{
$this->freightOrderIds = $ids;
}
}

View file

@ -19,7 +19,6 @@ class FreightOrder
private string $loadDetails,
private string $notes,
private array $fileAttachments,
private array $carrierIds,
) {}
public function getId(): ?int
@ -66,9 +65,4 @@ class FreightOrder
{
return $this->fileAttachments;
}
public function getCarrierIds(): array
{
return $this->carrierIds;
}
}

View file

@ -47,7 +47,6 @@ class CreateFreightOrder
foreach ($carrierIds as $carrierId) {
$carrier = $this->carrierRepo->find($carrierId);
$freightOrderId = $freightOrder->getId();
$this->updateCarrierOrderIds($carrier, $freightOrderId);
$this->sendEmail($carrier->getEmail(), $freightOrder);
$bidsCreated[] = $this->createBid(
$freightOrderId,
@ -83,16 +82,6 @@ class CreateFreightOrder
$this->emailer->send($email);
}
private function updateCarrierOrderIds(
Carrier $carrier,
int $freightOrderId
): void {
$carrierFreightOrderIds = $carrier->getFreightOrderIds();
$carrierFreightOrderIds[] = $freightOrderId;
$carrier->setFreightOrderIds($carrierFreightOrderIds);
$this->carrierRepo->save($carrier);
}
private function saveFreightOrder(
CreateFreightOrderRequestDTO $dto,
): FreightOrder {