It's a service that handles all logic to calculate the amount for a list of items and convert to a currency using a API from currency layer.
Method: POST
Resource: /api/v1/checkout/price
Payload Example:
{"items": ["Apples", "Apples", "Soup"],"currency": "EUR"}
npm start
to start the servicenpm run test
to run all testsnpm run test-integration
to run integration testsnpm run test-unit
to run unit testsnpm run test-unit-watch
will run unit tests and will rerun the tests if any file is modifiednpm run lint
will run all lint tests
For our service to work propertly in our local env it's necessary to configure the required environment vars. In order to simplify this dotenv
module is been used.
Dontenv
needs a .env
file with the env vars. Set the env variable for the correct environment defined on /config folder
Prices and promotions data are available in the /src/price/clients/fixtures