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
-48
View File
@@ -1,48 +0,0 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
JWT_SECRET=
@@ -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',
];
}
+1 -1
View File
@@ -17,7 +17,7 @@ class WalletResource extends JsonResource
return [
'id' => $this->id,
'code' => $this->code,
'currency' => $this->currency,
'currency_id' => $this->currency_id,
'amount' => (double) $this->amount,
'company_id' => (int) $this->company_id
];
+7
View File
@@ -0,0 +1,7 @@
include.path=${php.global.include.path}
php.version=PHP_70
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=false
web.root=.
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>laravel</name>
</data>
</configuration>
</project>
+1 -1
View File
@@ -2,7 +2,7 @@
use Illuminate\Support\Facades\Route;
Route::group(['prefix' => 'wallet', 'namespace' => 'Wallet', 'as' => 'wallet.'], function () {
Route::group(['prefix' => 'wallets', 'namespace' => 'Wallets', 'as' => 'wallet.'], function () {
Route::post('/create', 'CreateWalletController@create')->name('create');