add carriers to freight order
This commit is contained in:
parent
0afdaa76d6
commit
b58d23f084
5 changed files with 12 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ class FreightOrder
|
|||
private string $loadDetails,
|
||||
private string $notes,
|
||||
private array $fileAttachments,
|
||||
private array $carrierIds,
|
||||
) {}
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
@ -61,4 +62,9 @@ class FreightOrder
|
|||
{
|
||||
return $this->fileAttachments;
|
||||
}
|
||||
|
||||
public function getCarrierIds(): array
|
||||
{
|
||||
return $this->carrierIds;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class CreateFreightOrder
|
|||
$dto->loadDetails,
|
||||
$dto->notes,
|
||||
$dto->fileAttachments,
|
||||
$dto->carrierIds,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ class CreateFreightOrderRequestDTO
|
|||
public string $loadDetails,
|
||||
public string $notes,
|
||||
public array $fileAttachments,
|
||||
public array $carrierIds,
|
||||
) {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class FakeFreightOrderRepository implements FreightOrderRepository
|
|||
$freightOrder->getLoadDetails(),
|
||||
$freightOrder->getNotes(),
|
||||
$freightOrder->getFileAttachments(),
|
||||
$freightOrder->getCarrierIds(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -49,6 +50,7 @@ class FakeFreightOrderRepository implements FreightOrderRepository
|
|||
$freightOrder->getLoadDetails(),
|
||||
$freightOrder->getNotes(),
|
||||
$freightOrder->getFileAttachments(),
|
||||
$freightOrder->getCarrierIds(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class CreateFreightOrderTest extends TestCase
|
|||
loadDetails: 'some details',
|
||||
notes: 'some notes',
|
||||
fileAttachments: ['path/to/file', 'another/path/file'],
|
||||
carrierIds: [0, 1, 2],
|
||||
);
|
||||
$createdFreightOrder = $this->useCase->execute($dto);
|
||||
$foundFreightOrder = $this->freightOrderRepo->find(
|
||||
|
|
@ -46,6 +47,7 @@ class CreateFreightOrderTest extends TestCase
|
|||
$this->assertEquals($dto->loadDetails, $foundFreightOrder->getLoadDetails());
|
||||
$this->assertEquals($dto->notes, $foundFreightOrder->getNotes());
|
||||
$this->assertEquals($dto->fileAttachments, $foundFreightOrder->getFileAttachments());
|
||||
$this->assertEquals($dto->carrierIds, $foundFreightOrder->getCarrierIds());
|
||||
}
|
||||
|
||||
public function test_carrier_is_connected_to_order(): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue