Server/project
Refringe 8541e5f028 Refactor Currency Handling in PaymentService.payMoney() Method (!159)
This commit includes a series of changes aimed at improving the logic and readability of the `payMoney` method in the PaymentService class. The method is pivotal for handling in-game payments, specifically in cases involving multiple types of currencies and barter trades. The changes resolve an issue that prevented barter payments that included both a currency and another item.

## Changes:

- Replaced `barterPrice` variable with a `currencyAmounts` mapping that efficiently tracks each type of currency involved in the trade.
- Updated how the `costOfPurchaseInCurrency` variable is calculated to factor in multiple currencies.
- Introduced a new variable `totalCurrencyAmount` to sum up the total amount of all currencies, which is checked to determine whether any (non)currency payment is necessary.
- Added some inline comments for readability.

Resolves #176

Co-authored-by: Refringe <brownelltyler@gmail.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/159
Co-authored-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
Co-committed-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
2023-10-24 09:27:46 +00:00
..
.vscode Point local debug config to correct command 2023-10-14 10:10:10 +01:00
assets Show sessionid/profile id when profile data is saved 2023-10-21 20:19:45 +01:00
src Refactor Currency Handling in PaymentService.payMoney() Method (!159) 2023-10-24 09:27:46 +00:00
tests 0.13.5.0 (!147) 2023-10-10 11:03:20 +00:00
.dockerignore Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
.eslintignore Add Repo 2023-03-03 15:23:46 +00:00
.eslintrc.json Add Repo 2023-03-03 15:23:46 +00:00
.nvmrc 0.13.5.0 (!147) 2023-10-10 11:03:20 +00:00
.parcelrc Add Repo 2023-03-03 15:23:46 +00:00
.swcrc Import path alias on the whole project (!157) 2023-10-19 17:21:17 +00:00
babel.config.js Add Repo 2023-03-03 15:23:46 +00:00
docker-compose.yml Add Repo 2023-03-03 15:23:46 +00:00
Dockerfile Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
Dockerfile.docs Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
Dockerfile.pnpm Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
gulpfile.mjs Fixed stacktraces and source maps on the built exe (!153) 2023-10-15 07:31:16 +00:00
jest.config.ts Add Repo 2023-03-03 15:23:46 +00:00
package.json Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
pkgconfig.json Fixed stacktraces and source maps on the built exe (!153) 2023-10-15 07:31:16 +00:00
rome.json Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
Server.code-workspace Add Repo 2023-03-03 15:23:46 +00:00
tsconfig.base.json Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
tsconfig.json Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
tsconfig.test.json Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
tsconfig.typedef.json Updated dependencies + A few other things (!150) 2023-10-14 09:01:41 +00:00
typedoc.json Add Repo 2023-03-03 15:23:46 +00:00