Fixed wallet - integrate

This commit is contained in:
weiken.intex
2020-12-06 00:25:17 +08:00
parent 5b7148d879
commit 042b8e7ef1
9 changed files with 25 additions and 57 deletions
@@ -84,7 +84,7 @@ class CreateWalletLogic extends AbstractControllerLogic
DB::beginTransaction();
$object = new WalletObject($request->input('currency'), $request->input('company_id'), $this->generatesWalletCode->execute());
$object = new WalletObject($request->input('currency_id'), $request->input('company_id'), $this->generatesWalletCode->execute());
$this->canCreateCompanyWallet->passes($object);
@@ -11,7 +11,7 @@ class WalletObject implements DataTransferObject
private $company_id;
/** @var int */
private $currency;
private $currency_id;
/** @var int */
private $code;
@@ -25,7 +25,7 @@ class WalletObject implements DataTransferObject
public function __construct(int $company_id, int $currency, int $code)
{
$this->company_id = $company_id;
$this->currency = $currency;
$this->currency_id = $currency;
$this->code = $code;
}
@@ -42,7 +42,7 @@ class WalletObject implements DataTransferObject
*/
public function getCurrency(): int
{
return $this->currency;
return $this->currency_id;
}
/**
@@ -17,7 +17,7 @@ class CreatesWallet extends AbstractUpdateRecord
$model = new Wallet();
$model->company_id = $object->getCompanyId();
$model->code = $object->getCode();
$model->currency = $object->getCurrency();
$model->currency_id = $object->getCurrency();
return $this->handler($model);
@@ -16,7 +16,7 @@ class CompanyWalletValidation extends AbstractValidation
{
return [
'company_id' => $object->getCompanyId(),
'currency' => $object->getCurrency(),
'currency_id' => $object->getCurrency(),
];
}
@@ -27,7 +27,7 @@ class CompanyWalletValidation extends AbstractValidation
{
return [
'company_id' => 'required',
'currency' => 'required',
'currency_id' => 'required',
];
}