add company Name to Carrier
This commit is contained in:
parent
5cd4d3ad3f
commit
9043b93555
6 changed files with 31 additions and 7 deletions
|
|
@ -7,6 +7,7 @@ class Carrier
|
|||
public function __construct(
|
||||
private ?int $id,
|
||||
private string $email,
|
||||
private string $companyName,
|
||||
) {}
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
@ -23,4 +24,9 @@ class Carrier
|
|||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function getCompanyName(): string
|
||||
{
|
||||
return $this->companyName;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,11 @@ class CreateCarrier
|
|||
|
||||
public function execute(): Carrier
|
||||
{
|
||||
$carrier = new Carrier(null, $this->dto->email);
|
||||
$carrier = new Carrier(
|
||||
null,
|
||||
$this->dto->email,
|
||||
$this->dto->companyName
|
||||
);
|
||||
|
||||
return $this->carrierRepo->save($carrier);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@ class CreateCarrierRequest
|
|||
{
|
||||
public function __construct(
|
||||
public string $email,
|
||||
public string $companyName,
|
||||
) {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue