diff --git a/README.md b/README.md index b6356d8..b10991e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # TODO + - Make GetBidsOfFreightOrder use case - Dashboard: - Show open requests use case - Show closed requests use case diff --git a/src/Bid/Bid.php b/src/Bid/Bid.php index 8e087b7..72c9981 100644 --- a/src/Bid/Bid.php +++ b/src/Bid/Bid.php @@ -79,9 +79,6 @@ class Bid return $this->fileAttachments; } - /** - * @param string[] $attachments - */ public function setFileAttachments(array $attachments): void { $this->fileAttachments = $attachments; diff --git a/src/Bid/BidRepository.php b/src/Bid/BidRepository.php index 46eb8fc..e72582e 100644 --- a/src/Bid/BidRepository.php +++ b/src/Bid/BidRepository.php @@ -6,9 +6,4 @@ interface BidRepository { public function save(Bid $bid): Bid; public function find(string $id): ?Bid; - - /** - * @return Bid[] - */ - public function findByFreightOrderId(int $freightOrderId): array; } diff --git a/src/Bid/UseCases/GetBidsOfFreightOrder.php b/src/Bid/UseCases/GetBidsOfFreightOrder.php deleted file mode 100644 index a0759ff..0000000 --- a/src/Bid/UseCases/GetBidsOfFreightOrder.php +++ /dev/null @@ -1,17 +0,0 @@ -bidRepo->findByFreightOrderId($dto->freightOrderId); - } -} diff --git a/src/Bid/UseCases/GetBidsOfFreightOrderRequest.php b/src/Bid/UseCases/GetBidsOfFreightOrderRequest.php deleted file mode 100644 index a5e75f7..0000000 --- a/src/Bid/UseCases/GetBidsOfFreightOrderRequest.php +++ /dev/null @@ -1,10 +0,0 @@ -existingBids, - function (Bid $bid) use ($freightOrderId){ - return $bid->getFreightOrderId() === $freightOrderId; - }); - } } diff --git a/tests/Unit/Bid/UseCases/GetBidsOfFreightOrderTest.php b/tests/Unit/Bid/UseCases/GetBidsOfFreightOrderTest.php deleted file mode 100644 index abb8b40..0000000 --- a/tests/Unit/Bid/UseCases/GetBidsOfFreightOrderTest.php +++ /dev/null @@ -1,39 +0,0 @@ -bidRepo = new FakeBidRepository(); - $this->useCase = new GetBidsOfFreightOrder($this->bidRepo); - } - - public function test_get_one_bid(): void - { - $this->bidRepo->save(new Bid(0, 0, 0, false, false, 0, '', [])); - $dto = new GetBidsOfFreightOrderRequest(freightOrderId: 0); - $bids = $this->useCase->execute($dto); - $this->assertInstanceOf(Bid::class, $bids[0]); - } - - public function test_get_two_bids(): void - { - $this->bidRepo->save(new Bid(0, 0, 0, false, false, 0, '', [])); - $this->bidRepo->save(new Bid(1, 0, 0, false, false, 0, '', [])); - $dto = new GetBidsOfFreightOrderRequest(freightOrderId: 0); - $bids = $this->useCase->execute($dto); - $this->assertInstanceOf(Bid::class, $bids[1]); - } -}