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:
parent
e79064d909
commit
948380ba9f
6 changed files with 0 additions and 69 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue