Recommend this page to a friend! |
Download .zip |
Info | Example | View files (40) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2022-10-22 (1 month ago) | Not yet rated by the users | Total: 26 This week: 24 | All time: 10,692 This week: 4 |
Version | License | PHP version | Categories | |||
commission-calculato 1.0 | MIT/X Consortium ... | 8 | PHP 5, Finances, PHP 8 |
Description | Author | |
This package can get transactions from files and compute commissions. |
A simple commission calculator for transaction - Withdraw
, Deposit
using PHP-8.x
- Problem
- PHP >= 8.0
git clone https://github.com/ManiruzzamanAkash/commission-calculator.git
cd commission-calculator
composer install
I've added total 33 tests
, and 37 assertions
for testing codebase.
composer run phpunit
composer run test-cs
composer run test
From terminal, you can run this command to get the result of input.csv
's datasets.
input.csv
- I've stored some real data in this file for testing commission.
php script.php
input.csv
Create a file sample.csv
at project root -
Put some data's there and save, eg:
2014-12-31,4,private,withdraw,1200.00,EUR
2015-01-01,4,private,withdraw,1000.00,EUR
2016-01-05,4,private,withdraw,1000.00,EUR
2016-01-05,1,private,deposit,200.00,EUR
Now test our script from terminal
php script
sample.csv
Files |
File | Role | Description | ||
---|---|---|---|---|
src (9 directories) | ||||
tests (4 directories) | ||||
.php-cs-fixer.php | Example | Example script | ||
.phpunit.result.cache | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
input.csv | Data | Auxiliary data | ||
phpunit.xml.dist | Data | Auxiliary data | ||
problem.MD | Data | Auxiliary data | ||
README.md | Doc. | Documentation | ||
script.php | Example | Example script |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Abstracts (3 files) | ||||
Commission (1 file) | ||||
Core (1 file) | ||||
Currency (5 files) | ||||
File (1 file) | ||||
Interfaces (2 files) | ||||
Mapper (2 files) | ||||
Traits (4 files) | ||||
Transaction (1 file, 2 directories) |
Files | / | src | / | Abstracts |
File | Role | Description |
---|---|---|
AbstractFileReader.php | Class | Class source |
AbstractObjectMapper.php | Class | Class source |
AbstractTransaction.php | Class | Class source |
Files | / | src | / | Currency |
File | Role | Description |
---|---|---|
Calculator.php | Class | Class source |
Conversion.php | Class | Class source |
ConversionRate.php | Class | Class source |
Currency.php | Class | Class source |
CurrencyContainer.php | Class | Class source |
Files | / | src | / | Interfaces |
File | Role | Description |
---|---|---|
CommissionInterface.php | Class | Class source |
TransactionsInterface.php | Class | Class source |
Files | / | src | / | Mapper |
File | Role | Description |
---|---|---|
TransactionItem.php | Class | Class source |
TransactionItems.php | Class | Class source |
Files | / | src | / | Traits |
File | Role | Description |
---|---|---|
CommissionTrait.php | Class | Class source |
MoneyFormatterTrait.php | Class | Class source |
SingletonTrait.php | Class | Class source |
TransactionTrait.php | Class | Class source |
Files | / | src | / | Transaction |
File | Role | Description | ||
---|---|---|---|---|
Deposit (1 file) | ||||
Withdraw (2 files) | ||||
Transaction.php | Class | Class source |
Files | / | src | / | Transaction | / | Withdraw |
File | Role | Description |
---|---|---|
WeeklyWithdraw.php | Class | Class source |
Withdraw.php | Class | Class source |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
Commission (1 file) | ||||
Core (1 file) | ||||
Currency (4 files) | ||||
Transaction (3 files) |
Files | / | tests | / | Currency |
File | Role | Description |
---|---|---|
CalculatorTest.php | Class | Class source |
ConversionRateTest.php | Class | Class source |
CurrencyContainerTest.php | Class | Class source |
CurrencyTest.php | Class | Class source |
Files | / | tests | / | Transaction |
File | Role | Description |
---|---|---|
DepositTest.php | Class | Class source |
TransactionAutomationTest.php | Class | Class source |
WithdrawTest.php | Class | Class source |
commission-calculato-2022-10-22.zip 28KB | |
commission-calculato-2022-10-22.tar.gz 16KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.