|
| 1 | +# Changelog |
| 2 | +All notable changes to this project will be documented in this file. |
| 3 | + |
| 4 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 5 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 6 | + |
| 7 | +## [Unreleased] |
| 8 | +### Added |
| 9 | +- File changelog.md |
| 10 | + |
| 11 | +### Changed |
| 12 | +- Composer.json: add new keywords. |
| 13 | + |
| 14 | +## [2.0.1] - 2018-11-21 |
| 15 | +### Added |
| 16 | +- add method getAvailableBalance. |
| 17 | +public getAvailableBalance(): int. |
| 18 | + |
| 19 | +## [2.0.0] - 2018-11-21 |
| 20 | +### Added |
| 21 | +- table `wallets`. |
| 22 | +- add `wallet_id` to table `transactions` and foreign key's. |
| 23 | +- add `fee` to table `transfers`. |
| 24 | +- add localization's. |
| 25 | +- add Taxing interface. |
| 26 | +- add WalletFloat interface. |
| 27 | +- add const TYPE_DEPOSIT, TYPE_WITHDRAW. |
| 28 | +- add Wallet model. |
| 29 | +- add working with fractional (float) numbers. |
| 30 | +- add method calculateBalance. |
| 31 | +- add method payFree. |
| 32 | +public payFree(Product $product): Transfer. |
| 33 | +- add CanBePaidFloat trait. |
| 34 | +- Added the ability to collect Commission |
| 35 | +when withdrawing funds in transfers. |
| 36 | +- Added the ability to work with multiple wallets. |
| 37 | +- Added a class that stores user balance. To avoid any problems. |
| 38 | +- add HasWalletFloat trait. |
| 39 | +- add HasWallets trait. |
| 40 | + |
| 41 | +### Changed |
| 42 | +- Add $type argument before $amount. |
| 43 | +protected change(string $type, int $amount, ?array $meta, bool $confirmed): Transaction. |
| 44 | + |
| 45 | +### Fixed |
| 46 | +- Due to the addition of the ability to buy for free, |
| 47 | +there was a bug in which we returned the full cost. |
| 48 | +- Due to the addition of the ability to work with |
| 49 | +many wallets, there were bugs with payments. |
| 50 | +When the user bought the goods and the goods were |
| 51 | +assigned to the wallet, not to the user. |
| 52 | +This change of method: change, transactions, |
| 53 | +transfers, wallet, etc. |
| 54 | + |
| 55 | +## [1.2.3] - 2018-11-11 |
| 56 | +### Changed |
| 57 | +- readme: Added new features. |
| 58 | +- Composer.json: add new keywords. |
| 59 | + |
| 60 | +## [1.2.2] - 2018-11-10 |
| 61 | +### Added |
| 62 | +- method public forcePay(Product $product): Transfer. |
| 63 | +- method public forceRefund(Product $product): bool. |
| 64 | + |
| 65 | +### Changed |
| 66 | +- the `$force` parameter was added to the `pay` method. |
| 67 | +public pay(Product $product, bool $force = false): Transfer. |
| 68 | +- the `$force` parameter was added to the `safePay` method. |
| 69 | +public safePay(Product $product, bool $force = false): ?Transfer. |
| 70 | +- the `$force` parameter was added to the `canBuy` method. |
| 71 | +public canBuy(Customer $customer, bool $force = false): bool. |
| 72 | +- the `$force` parameter was added to the `refund` method. |
| 73 | +public refund(Product $product, bool $force = false): bool. |
| 74 | +- the `$force` parameter was added to the `safeRefund` method. |
| 75 | +public safeRefund(Product $product, bool $force = false): bool. |
| 76 | + |
| 77 | +### Fixed |
| 78 | +- Fixed magic method. |
| 79 | +He accounted for unconfirmed transactions. |
| 80 | + |
| 81 | +## [1.2.1] - 2018-11-09 |
| 82 | +### Added |
| 83 | +- check for php 7.3 |
| 84 | + |
| 85 | +### Fixed |
| 86 | +- support for laravel 5.5. |
| 87 | + |
| 88 | +## [1.2.0] - 2018-11-09 |
| 89 | +### Added |
| 90 | +- phpunit to the project. |
| 91 | + |
| 92 | +## [1.1.2] - 2018-11-08 |
| 93 | +### Fixed |
| 94 | +- Fixed "balance" method. |
| 95 | +He counted the amount along with the unconfirmed transactions. |
| 96 | + |
| 97 | +## [1.1.1] - 2018-11-08 |
| 98 | +### Changed |
| 99 | +- Update readme. |
| 100 | +- New indexes have names for quick removal. |
| 101 | + |
| 102 | +### Fixed |
| 103 | +- Fixed `down` migration method `transfers`. |
| 104 | + |
| 105 | +## [1.1.0] - 2018-11-08 |
| 106 | +### Added |
| 107 | +- Added index for fields in "transfers" table: ['from_type', 'from_id', 'refund']. |
| 108 | +- Added index for fields in "transfers" table: ['to_type', 'to_id', 'refund']. |
| 109 | +- In the table "transactions" added to the type index. |
| 110 | +- Exception ProductEnded |
| 111 | +- Method public paid(Product $product): ?Transfer. |
| 112 | +- Method public canBuy(Customer $customer): bool. |
| 113 | +- Static balance caching. Also the description for what it is necessary. |
| 114 | + |
| 115 | +### Changed |
| 116 | +- In the table "transactions" is deleted the index of the field "uuid" and added a unique index. |
| 117 | +- In the table "transfers" is deleted the index of the field "uuid" and added a unique index. |
| 118 | +- Method `pay` began to check the possibility of buying. |
| 119 | + |
| 120 | +### Removed |
| 121 | +- public resetBalance(): void |
| 122 | + |
| 123 | +## [1.0.0] - 2018-11-07 |
| 124 | +### Added |
| 125 | +- Added `refund` field to `transfers` table. |
| 126 | + |
| 127 | +### Changed |
| 128 | +- Updated the `refund` method. |
| 129 | +The operation is now executed in the transaction and updates the new `refund` field. |
| 130 | + |
| 131 | +### Deprecated |
| 132 | +- public resetBalance(): void |
| 133 | + |
| 134 | +## [0.0.1] - 2018-11-07 |
| 135 | +### Added |
| 136 | +- written README. |
| 137 | +- Project configuration file created. |
| 138 | +- Migration 2018_11_06_222923_create_transactions_table. |
| 139 | +- Migration 2018_11_07_192923_create_transfers_table. |
| 140 | +- `HasWallet` trait and `Wallet` interface. |
| 141 | + - methods: |
| 142 | + - private checkAmount(int $amount): void |
| 143 | + - public forceWithdraw(int $amount, ?array $meta = null, bool $confirmed = true): Transaction |
| 144 | + - public deposit(int $amount, ?array $meta = null, bool $confirmed = true): Transaction |
| 145 | + - public withdraw(int $amount, ?array $meta = null, bool $confirmed = true): Transaction |
| 146 | + - public canWithdraw(int $amount): bool |
| 147 | + - public transfer(Wallet $wallet, int $amount, ?array $meta = null): Transfer |
| 148 | + - public safeTransfer(Wallet $wallet, int $amount, ?array $meta = null): ?Transfer |
| 149 | + - public forceTransfer(Wallet $wallet, int $amount, ?array $meta = null): Transfer |
| 150 | + - protected assemble(Wallet $wallet, Transaction $withdraw, Transaction $deposit): Transfer |
| 151 | + - protected change(int $amount, ?array $meta, bool $confirmed): Transaction |
| 152 | + - public resetBalance(): void |
| 153 | + - relations: |
| 154 | + - public transactions(): MorphMany |
| 155 | + - public transfers(): MorphMany |
| 156 | + - magic property |
| 157 | + - public getBalanceAttribute(): int |
| 158 | +- `CanBePaid` trait and `Product`, `Costomer` interface's |
| 159 | + - methods: |
| 160 | + - public pay(Product $product): Transfer |
| 161 | + - public safePay(Product $product): ?Transfer |
| 162 | + - public refund(Product $product): bool |
| 163 | + - public safeRefund(Product $product): bool |
| 164 | +- Exceptions: AmountInvalid, BalanceIsEmpty. |
| 165 | +- Models: Transfer, Transaction. |
| 166 | + |
| 167 | +[Unreleased]: https://github.com/bavix/laravel-wallet/compare/2.0.1...HEAD |
| 168 | +[2.0.1]: https://github.com/bavix/laravel-wallet/compare/2.0.1...1.0.0 |
| 169 | +[2.0.0]: https://github.com/bavix/laravel-wallet/compare/2.0.0...1.0.0 |
| 170 | +[1.2.3]: https://github.com/bavix/laravel-wallet/compare/1.2.2...1.2.3 |
| 171 | +[1.2.2]: https://github.com/bavix/laravel-wallet/compare/1.2.1...1.2.2 |
| 172 | +[1.2.1]: https://github.com/bavix/laravel-wallet/compare/1.2.0...1.2.1 |
| 173 | +[1.2.0]: https://github.com/bavix/laravel-wallet/compare/1.1.2...1.2.0 |
| 174 | +[1.1.2]: https://github.com/bavix/laravel-wallet/compare/1.1.1...1.1.2 |
| 175 | +[1.1.1]: https://github.com/bavix/laravel-wallet/compare/1.1.0...1.1.1 |
| 176 | +[1.1.0]: https://github.com/bavix/laravel-wallet/compare/1.0.0...1.1.0 |
| 177 | +[1.0.0]: https://github.com/bavix/laravel-wallet/compare/0.0.1...1.0.0 |
0 commit comments