PHP Classes

PHP Commission Calculator: Calculate commissions on currency transactions

Recommend this page to a friend!
  Info   View files Documentation   View files View files (86)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2022-04-27 (3 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 43 All time: 10,404 This week: 263Up
Version License PHP version Categories
currency-calculator- 1.0.0MIT/X Consortium ...5PHP 5, Files and Folders, Finances, C...
Description Author

This package can calculate commissions on currency transactions.

It can read amounts from a set of currency transactions from a CSV file.

The package can process the transaction values and output to the command line console the amounts of the associated commissions earned for each transaction.

Innovation Award
PHP Programming Innovation award nominee
April 2022
Number 6
Many people work in the currency exchange market, trading money amounts between different currencies.

Each exchange transaction has associated commissions paid to the dealers that perform the transaction.

This package can automate the calculations of the commission amounts involved in a set of currency exchange transactions.

Manuel Lemos
Picture of Niko Peikrishvili
  Performance   Level  
Name: Niko Peikrishvili <contact>
Classes: 3 packages by
Country: Georgia Georgia
Age: ???
All time rank: 37026 in Georgia Georgia
Week rank: 81 Up1 in Georgia Georgia Up
Innovation award
Innovation award
Nominee: 2x

Details

Home assigment Commission Calculator

Installation

1) clone the repository 2) navigate to project folder 3) run `composer install` 4) copy .env.example as .env 5) run (optional) `php artisan config:cache`

Running

php artisan calculate:commission input.csv

Output

0.60
3.00
0.00
0.06
1.50
0
0.70
0.30
0.30
3.00
0.00
0.00
8612

Run test

php artisan test

Code styles

PHPStan

./vendor/bin/phpstan analyze 

if necessary add memory limit

./vendor/bin/phpstan analyze --memory-limit=1G

PHPCs

 ./vendor/bin/phpcs
  Files folder image Files  
File Role Description
Files folder imageapp (6 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (16 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (3 files)
Files folder imageresources (3 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file input.csv Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpcs.xml Data Auxiliary data
Accessible without login Plain text file phpstan.neon Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file server.php Aux. Auxiliary script
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

  Files folder image Files  /  app  
File Role Description
Files folder imageConsole (1 file, 1 directory)
Files folder imageExceptions (1 file)
Files folder imageHttp (1 file, 2 directories)
Files folder imageModels (1 file)
Files folder imageProviders (5 files)
Files folder imageServices (5 directories)

  Files folder image Files  /  app  /  Console  
File Role Description
Files folder imageCommands (1 file)
  Plain text file Kernel.php Class Class source

  Files folder image Files  /  app  /  Console  /  Commands  
File Role Description
  Plain text file CalculateCommissionsCommand.php Class Class source

  Files folder image Files  /  app  /  Exceptions  
File Role Description
  Plain text file Handler.php Class Class source

  Files folder image Files  /  app  /  Http  
File Role Description
Files folder imageControllers (1 file)
Files folder imageMiddleware (8 files)
  Plain text file Kernel.php Class Class source

  Files folder image Files  /  app  /  Http  /  Controllers  
File Role Description
  Plain text file Controller.php Class Class source

  Files folder image Files  /  app  /  Http  /  Middleware  
File Role Description
  Plain text file Authenticate.php Class Class source
  Plain text file EncryptCookies.php Class Class source
  Plain text file PreventRequestsDuringMaintenance.php Class Class source
  Plain text file RedirectIfAuthenticated.php Class Class source
  Plain text file TrimStrings.php Class Class source
  Plain text file TrustHosts.php Class Class source
  Plain text file TrustProxies.php Class Class source
  Plain text file VerifyCsrfToken.php Class Class source

  Files folder image Files  /  app  /  Models  
File Role Description
  Plain text file User.php Class Class source

  Files folder image Files  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source
  Plain text file AuthServiceProvider.php Class Class source
  Plain text file BroadcastServiceProvider.php Class Class source
  Plain text file EventServiceProvider.php Class Class source
  Plain text file RouteServiceProvider.php Class Class source

  Files folder image Files  /  app  /  Services  
File Role Description
Files folder imageCommissions (2 files)
Files folder imageCurrency (2 files)
Files folder imageRates (2 files)
Files folder imageTransaction (4 files)
Files folder imageTransactions (2 files)

  Files folder image Files  /  app  /  Services  /  Commissions  
File Role Description
  Plain text file CommissionCalculator.php Class Class source
  Plain text file CommissionCalculatorInterface.php Class Class source

  Files folder image Files  /  app  /  Services  /  Currency  
File Role Description
  Plain text file CurrencyConfigurator.php Class Class source
  Plain text file CurrencyConfiguratorInterface.php Class Class source

  Files folder image Files  /  app  /  Services  /  Rates  
File Role Description
  Plain text file Rates.php Class Class source
  Plain text file RatesInterface.php Class Class source

  Files folder image Files  /  app  /  Services  /  Transaction  
File Role Description
  Plain text file Deposit.php Class Class source
  Plain text file TransactionAbstract.php Class Class source
  Plain text file TransactionInterface.php Class Class source
  Plain text file Withdraw.php Class Class source

  Files folder image Files  /  app  /  Services  /  Transactions  
File Role Description
  Plain text file TransactionList.php Class Class source
  Plain text file TransactionListInterface.php Class Class source

  Files folder image Files  /  bootstrap  
File Role Description
  Plain text file app.php Class Class source

  Files folder image Files  /  config  
File Role Description
  Plain text file app.php Class Class source
  Plain text file auth.php Class Class source
  Accessible without login Plain text file broadcasting.php Aux. Auxiliary script
  Accessible without login Plain text file cache.php Aux. Auxiliary script
  Accessible without login Plain text file commissions.php Aux. Auxiliary script
  Accessible without login Plain text file cors.php Aux. Auxiliary script
  Accessible without login Plain text file database.php Aux. Auxiliary script
  Accessible without login Plain text file filesystems.php Aux. Auxiliary script
  Accessible without login Plain text file hashing.php Aux. Auxiliary script
  Plain text file logging.php Class Class source
  Accessible without login Plain text file mail.php Aux. Auxiliary script
  Accessible without login Plain text file queue.php Aux. Auxiliary script
  Plain text file sanctum.php Class Class source
  Accessible without login Plain text file services.php Aux. Auxiliary script
  Accessible without login Plain text file session.php Aux. Auxiliary script
  Accessible without login Plain text file view.php Aux. Auxiliary script

  Files folder image Files  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (4 files)
Files folder imageseeders (1 file)

  Files folder image Files  /  database  /  factories  
File Role Description
  Plain text file UserFactory.php Class Class source

  Files folder image Files  /  database  /  migrations  
File Role Description
  Plain text file 2014_10_12_000000_create_users_table.php Class Class source
  Plain text file 2014_10_12_100000_...rd_resets_table.php Class Class source
  Plain text file 2019_08_19_000000_...iled_jobs_table.php Class Class source
  Plain text file 2019_12_14_000001_...ss_tokens_table.php Class Class source

  Files folder image Files  /  database  /  seeders  
File Role Description
  Plain text file DatabaseSeeder.php Class Class source

  Files folder image Files  /  public  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Plain text file index.php Class Class source
  Accessible without login Plain text file robots.txt Doc. Documentation

  Files folder image Files  /  resources  
File Role Description
Files folder imagejs (2 files)
Files folder imagelang (1 directory)
Files folder imageviews (1 file)

  Files folder image Files  /  resources  /  js  
File Role Description
  Accessible without login Plain text file app.js Data Auxiliary data
  Accessible without login Plain text file bootstrap.js Data Auxiliary data

  Files folder image Files  /  resources  /  lang  
File Role Description
Files folder imageen (4 files)

  Files folder image Files  /  resources  /  lang  /  en  
File Role Description
  Accessible without login Plain text file auth.php Aux. Auxiliary script
  Accessible without login Plain text file pagination.php Aux. Auxiliary script
  Accessible without login Plain text file passwords.php Aux. Auxiliary script
  Accessible without login Plain text file validation.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  views  
File Role Description
  Accessible without login Plain text file welcome.blade.php Aux. Auxiliary script

  Files folder image Files  /  routes  
File Role Description
  Accessible without login Plain text file api.php Example Example script
  Accessible without login Plain text file channels.php Example Example script
  Accessible without login Plain text file console.php Example Example script
  Accessible without login Plain text file web.php Aux. Auxiliary script

  Files folder image Files  /  tests  
File Role Description
Files folder imageassets (1 file)
Files folder imageFeature (1 file)
  Plain text file CreatesApplication.php Class Class source
  Plain text file TestCase.php Class Class source

  Files folder image Files  /  tests  /  assets  
File Role Description
  Accessible without login Plain text file input.csv Data Auxiliary data

  Files folder image Files  /  tests  /  Feature  
File Role Description
  Plain text file CommissionCalculationOutputTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:43
This week:0
All time:10,404
This week:263Up
For more information send a message to info at phpclasses dot org.