Skip to content

Commit

Permalink
Merge pull request #30 from bavix/status-fix
Browse files Browse the repository at this point in the history
global upgrade
  • Loading branch information
rez1dent3 authored May 13, 2019
2 parents e07a438 + bc882b7 commit e80d11c
Show file tree
Hide file tree
Showing 33 changed files with 523 additions and 362 deletions.
14 changes: 13 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.3.0] - 2019-05-13
### Added
- Add support Themosis Framework

### Changed
- In all the methods of translations have added the status of the transfer.

### Fixed
- correction of errors during installation is not correct status.

## [2.2.2] - 2019-05-12
### Fixed
- fixed fee counting. see issue #25
Expand Down Expand Up @@ -202,7 +212,8 @@ The operation is now executed in the transaction and updates the new `refund` fi
- Exceptions: AmountInvalid, BalanceIsEmpty.
- Models: Transfer, Transaction.

[Unreleased]: https://github.com/bavix/laravel-wallet/compare/2.2.2...HEAD
[Unreleased]: https://github.com/bavix/laravel-wallet/compare/2.3.0...HEAD
[2.3.0]: https://github.com/bavix/laravel-wallet/compare/2.2.2...2.3.0
[2.2.2]: https://github.com/bavix/laravel-wallet/compare/2.2.1...2.2.2
[2.2.1]: https://github.com/bavix/laravel-wallet/compare/2.2.0...2.2.1
[2.2.0]: https://github.com/bavix/laravel-wallet/compare/2.1.0...2.2.0
Expand All @@ -217,3 +228,4 @@ The operation is now executed in the transaction and updates the new `refund` fi
[1.1.1]: https://github.com/bavix/laravel-wallet/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/bavix/laravel-wallet/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/bavix/laravel-wallet/compare/0.0.1...1.0.0
[0.0.1]: https://github.com/bavix/laravel-wallet/compare/d181a99e751c5138694580ca4361d5129baa26b3...0.0.1
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
],
"require": {
"php": "^7.1",
"laravel/framework": "~5.5.0|~5.6.0|~5.7.0|~5.8.0",
"illuminate/database": "~5.5.0|~5.6.0|~5.7.0|~5.8.0",
"ramsey/uuid": "^3.0"
},
"require-dev": {
"doctrine/dbal": "^2.8",
"mockery/mockery": "^1.2",
"orchestra/testbench": "^3.7",
"phpunit/phpunit": "^7.4"
"phpunit/phpunit": "^7.5"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Bavix\Wallet\Models\Transaction;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTransactionsTable extends Migration
{

/**
* @return string
*/
protected function table(): string
{
return (new Transaction())->getTable();
}

/**
* @return void
*/
public function up(): void
{
Schema::create($this->table(), function(Blueprint $table) {
Schema::create($this->table(), function (Blueprint $table) {
$table->increments('id');
$table->morphs('payable');
$table->enum('type', ['deposit', 'withdraw'])->index();
Expand All @@ -37,6 +29,14 @@ public function up(): void
});
}

/**
* @return string
*/
protected function table(): string
{
return (new Transaction())->getTable();
}

/**
* @return void
*/
Expand Down
40 changes: 20 additions & 20 deletions database/migrations_v1/2018_11_07_192923_create_transfers_table.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Bavix\Wallet\Models\Transaction;
use Bavix\Wallet\Models\Transfer;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTransfersTable extends Migration
{

/**
* @return string
*/
protected function transactionTable(): string
{
return (new Transaction())->getTable();
}

/**
* @return string
*/
protected function table(): string
{
return (new Transfer())->getTable();
}

/**
* @return void
*/
public function up(): void
{
Schema::create($this->table(), function(Blueprint $table) {
Schema::create($this->table(), function (Blueprint $table) {
$table->increments('id');
$table->morphs('from');
$table->morphs('to');
Expand All @@ -51,6 +35,22 @@ public function up(): void
});
}

/**
* @return string
*/
protected function table(): string
{
return (new Transfer())->getTable();
}

/**
* @return string
*/
protected function transactionTable(): string
{
return (new Transaction())->getTable();
}

/**
* @return void
*/
Expand Down
28 changes: 14 additions & 14 deletions database/migrations_v1/2018_11_07_202152_update_transfers_table.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
<?php

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Bavix\Wallet\Models\Transfer;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\SQLiteConnection;
use Illuminate\Database\Migrations\Migration;
use Bavix\Wallet\Models\Transfer;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class UpdateTransfersTable extends Migration
{

/**
* @return string
*/
protected function table(): string
{
return (new Transfer())->getTable();
}

/**
* @return void
*/
public function up(): void
{
Schema::table($this->table(), function(Blueprint $table) {
Schema::table($this->table(), function (Blueprint $table) {
$table->boolean('refund')
->after('withdraw_id')
->default(0);
Expand All @@ -34,12 +26,20 @@ public function up(): void
});
}

/**
* @return string
*/
protected function table(): string
{
return (new Transfer())->getTable();
}

/**
* @return void
*/
public function down(): void
{
Schema::table($this->table(), function(Blueprint $table) {
Schema::table($this->table(), function (Blueprint $table) {
if (!(DB::connection() instanceof SQLiteConnection)) {
$table->dropIndex('from_to_refund_ind');
$table->dropIndex('from_refund_ind');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Bavix\Wallet\Models\Transaction;
use Bavix\Wallet\Models\Wallet;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class CreateWalletsTable extends Migration
{
Expand All @@ -24,7 +24,7 @@ protected function table(): string
*/
public function up(): void
{
Schema::create($this->table(), function(Blueprint $table) {
Schema::create($this->table(), function (Blueprint $table) {
$table->increments('id');
$table->morphs('holder');
$table->string('name');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Bavix\Wallet\Models\Transaction;
use Bavix\Wallet\Models\Wallet;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class UpdateTransactionsTable extends Migration
{
Expand All @@ -31,7 +31,7 @@ protected function walletTable(): string
*/
public function up(): void
{
Schema::table($this->table(), function(Blueprint $table) {
Schema::table($this->table(), function (Blueprint $table) {
$table->unsignedInteger('wallet_id')
->nullable()
->after('payable_id');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Bavix\Wallet\Models\Transfer;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddFeeTransfersTable extends Migration
{
Expand All @@ -21,7 +21,7 @@ protected function table(): string
*/
public function up(): void
{
Schema::table($this->table(), function(Blueprint $table) {
Schema::table($this->table(), function (Blueprint $table) {
$table->bigInteger('fee')
->default(0)
->after('withdraw_id');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Bavix\Wallet\Models\Transfer;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Bavix\Wallet\Models\Transfer;
use Illuminate\Support\Facades\Schema;

class AddStatusTransfersTable extends Migration
{
Expand All @@ -22,7 +22,7 @@ protected function table(): string
*/
public function up(): void
{
Schema::table($this->table(), function(Blueprint $table) {
Schema::table($this->table(), function (Blueprint $table) {
$enums = [
Transfer::STATUS_PAID,
Transfer::STATUS_REFUND,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Bavix\Wallet\Models\Transfer;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\SQLiteConnection;
use Illuminate\Support\Facades\DB;
use Bavix\Wallet\Models\Transfer;
use Illuminate\Support\Facades\Schema;

class DropRefundTransfersTable extends Migration
{
Expand All @@ -23,7 +23,7 @@ protected function table(): string
*/
public function up(): void
{
Schema::table($this->table(), function(Blueprint $table) {
Schema::table($this->table(), function (Blueprint $table) {
if (!(DB::connection() instanceof SQLiteConnection)) {
$table->dropIndex('from_to_refund_ind');
$table->dropIndex('from_refund_ind');
Expand Down
Loading

0 comments on commit e80d11c

Please sign in to comment.