add phone number, notes, and contact person to carrier

This commit is contained in:
Yisroel Baum 2025-11-10 11:14:32 +02:00
parent f37868f0d0
commit a739479e22
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
9 changed files with 88 additions and 6 deletions

View file

@ -13,12 +13,24 @@ class CreateCarrierTest extends TestCase
{
$email = 'joe@shmoe.com';
$company = 'test company';
$contactPerson = 'Joe Shmoe';
$phoneNumber = '132456798';
$notes = 'some notes';
$carrierRepo = new FakeCarrierRepository();
$dto = new CreateCarrierRequest($email, $company);
$dto = new CreateCarrierRequest(
$email,
$company,
$contactPerson,
$phoneNumber,
$notes,
);
$useCase = new CreateCarrier($dto, $carrierRepo);
$response = $useCase->execute();
$foundCarrier = $carrierRepo->find($response->getId());
$this->assertEquals($email, $foundCarrier->getEmail());
$this->assertEquals($company, $foundCarrier->getCompanyName());
$this->assertEquals($contactPerson, $foundCarrier->getContactPerson());
$this->assertEquals($phoneNumber, $foundCarrier->getPhoneNumber());
$this->assertEquals($notes, $foundCarrier->getNotes());
}
}

View file

@ -11,12 +11,31 @@ class GetAllCarriersTest extends TestCase
{
public function test_get_one_carrier(): void
{
$email = 'email@email.com';
$company = 'test Company';
$contactPerson = 'joe shmoe';
$phoneNumber = '123456798';
$notes = 'some notes';
$repo = new FakeCarrierRepository();
$repo->save(new Carrier(0, 'email@email.com', 'test Company'));
$repo->save(new Carrier(
0,
$email,
$company,
$contactPerson,
$phoneNumber,
$notes,
));
$useCase = new GetAllCarriers($repo);
$response = $useCase->execute();
$this->assertEquals(
[new Carrier(0, 'email@email.com', 'test Company')],
[new Carrier(
0,
$email,
$company,
$contactPerson,
$phoneNumber,
$notes,
)],
$response
);
}