mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 15a4b01573 | |||
| 39c90d1edc |
@@ -60,7 +60,9 @@ class UpdateCompanyNameLogic extends AbstractControllerLogic
|
||||
{
|
||||
$query = $this->fetchesCompany->execute(['id' => $request->route('id')]);
|
||||
|
||||
$object = new CompanyObject($request->input('name'), $query->reference, $query->type);
|
||||
$debtor = $request->input('debtor') ?? $query->debtor;
|
||||
|
||||
$object = new CompanyObject($request->input('name'), $query->reference, $debtor, $query->type);
|
||||
|
||||
$this->updatesCompanyName->execute($query, $object);
|
||||
|
||||
|
||||
@@ -23,16 +23,21 @@ class CompanyObject implements DataTransferObject
|
||||
/** @var string */
|
||||
private $unity_hash_id;
|
||||
|
||||
/** @var string */
|
||||
private $debtor;
|
||||
|
||||
/**
|
||||
* CompanyObject constructor.
|
||||
* @param string $name
|
||||
* @param string $reference
|
||||
* @param string $debtor
|
||||
* @param int|null $type
|
||||
* @param int|null $status
|
||||
*/
|
||||
public function __construct(
|
||||
string $name,
|
||||
string $reference,
|
||||
?string $debtor,
|
||||
?int $type = BusinessType::IMPORTER,
|
||||
?int $status = ApprovalStatus::PENDING_SUBMISSION
|
||||
) {
|
||||
@@ -40,6 +45,7 @@ class CompanyObject implements DataTransferObject
|
||||
$this->reference = $reference;
|
||||
$this->type = $type;
|
||||
$this->status = $status;
|
||||
$this->debtor = $debtor;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,4 +80,12 @@ class CompanyObject implements DataTransferObject
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDebtor(): string
|
||||
{
|
||||
return $this->debtor;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class UpdatesCompanyName extends AbstractUpdateRecord
|
||||
public function execute(Company $model, CompanyObject $object)
|
||||
{
|
||||
$model->name = $object->getName();
|
||||
$model->debtor = $object->getDebtor();
|
||||
return $this->handler($model);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user