This is a very simple example of online payment services. It calculates the fee of commissions for users per week
To run this repo on your local environments, follow these steps:
git clone https://github.com/qafoori/transaction-fee.git
cd transaction-fee
# yarn users (recommended)
yarn
# npm users
npm i
cp .env.example .env
## will start the project and log the results of commission fees
yarn start #or npm start
## will start the project using `nodemon` with watch mode
yarn dev #or npm run dev
## will start the tests once
yarn test:run #or npm run test:run
## will start the tests with watch mode
yarn test:watch #or npm run test:watch
## will print ($ cat) example data which is used by default in the repo
yarn data:check #or npm run data:check
## will open up vim to edit the example data (requires password)
yarn data:edit #or npm run data:edit
## will change the default data path in `package.json` to refer to the use of another path
yarn data:change-path <PATH-TO-JSON-FILE> #or npm run data:change-path <PATH-TO-JSON-FILE>
## will install husky to run pre-commit commands
yarn prepare #or npm run prepare
According to the test report file in the latest state (junit.xml), all tests are passed successfully. So if you run into problems with the tests and some of them did not pass (only the tests related to fetching the data from the APIs), the only reason is the problem of the Internet and with one or two retry attempts you will see all the tests pass.
All scripts are executable for Unix users (those using Linux or Mac).
Note that the "cat" and "vim" accessories must be installed on your bash
Users using cmd or powershell in Windows can not run the following scripts:
yarn data:check
yarn data:edit
yarn data:change-path
Use these commands instead:
yarn data:check:win
yarn data:edit:win
yarn data:change-path:win <PATH-TO-JSON-FILE>