A simple implementation of a trade pricing store
- Docker
docker compose up
- This builds and deploys
- A Redis container hosted on port
6379
- The pricing API hosted on port
3000
- A Swagger UI hosted on port
80
- A Redis container hosted on port
- This builds and deploys
-
POST /providers/{id}/quotes
Inserts quote prices into the system for a provider -
GET /providers/{id}/currencyconfigs?base={baseCurrency}"e={quoteCurrency}
Retrieves currency pair setting for a provider -
PUT /providers/{id}/currencyconfigs?base={baseCurrency}"e={quoteCurrency}
Updates currency pair setting for a provider -
GET /providers/bestprice?base={baseCurrency}"e={quoteCurrency}
Get best price among all available providers for a given currency pair- Requires a JWT with a payload
{ "sub": {customerId} }
- Requires a JWT with a payload
The endpoints can also be visualised by visiting the Swagger UI generated from openapi/openapi.yaml
- Provider IDs are known to the caller and are provided as URL parameters
- Customer IDs are known to the caller and are provided as JWTs
docker compose up
defaults to seeding the Redis instance with data located under seed-data/seed.redis
. Seed data can be modified by updating the contents of this file.
- Add Postman scripts for easier testing
- Lack of tests
- Due to a lack of time, only one simple unit test is added under
repository/customer/redis_test.go
to demonstrate a unit test written in Go
- Due to a lack of time, only one simple unit test is added under
- Code duplication in some areas
- Lack of sufficient syntax knowledge to construct better abstractions and achieve inversion of control