require full bid data on update
This commit is contained in:
parent
9e2e6d9449
commit
14e77d2885
4 changed files with 16 additions and 12 deletions
|
|
@ -13,10 +13,10 @@ class UpdateBid
|
|||
public function execute(UpdateBidRequest $dto): void
|
||||
{
|
||||
$bid = $this->bidRepo->find($dto->bidId);
|
||||
$bid->setCost($dto->data['cost']);
|
||||
$bid->setIsClosed($dto->data['isClosed']);
|
||||
$bid->setNotes($dto->data['notes']);
|
||||
$bid->setFileAttachments($dto->data['fileAttachments']);
|
||||
$bid->setCost($dto->cost);
|
||||
$bid->setIsClosed($dto->isClosed);
|
||||
$bid->setNotes($dto->notes);
|
||||
$bid->setFileAttachments($dto->fileAttachments);
|
||||
$this->bidRepo->save($bid);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,14 @@ namespace FreightQuote\Bid\UseCases;
|
|||
|
||||
class UpdateBidRequest
|
||||
{
|
||||
/**
|
||||
* @param string[] $fileAttachments
|
||||
*/
|
||||
public function __construct(
|
||||
public int $bidId,
|
||||
public array $data,
|
||||
public int $cost,
|
||||
public bool $isClosed,
|
||||
public string $notes,
|
||||
public array $fileAttachments,
|
||||
) {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue