This API it's a technical test to Software Development Engineer position at Wex Company.
My application, called wex-purchase-api must be able to accept and store (i.e., persist) a purchase transaction with a description, transaction date, and a purchase amount in United States dollars. When the transaction is stored, it will be assigned a unique identifier.
- Back-end: Java 17
- Database: H2
- Name: Leandro Sena Zuza
- Job: software developer full stack
- If want to acess the Swagger, please, run application and acess: http://localhost:8080/wex-purchase-api/swagger-ui/index.html
- To access the database, please, run application and acess: http://localhost:8080/wex-purchase-api/h2
- The credentials to conect to H2 Database are in the Application Properties.
- /save request persit one purchase in the database.
- /listAllPurchase list all transactions persisted in the database
- /getOnePurchase/{id} get id's transaction
- /getPurchaseWithCurrency/{id} get id's transaction converted to respective exchange date, if it exist.
There is some scripts if you want to test with some data.
INSERT INTO TAB_TRANSACTION ( DATE_TRANSACTION, PURCHASE_AMOUNT, DESCRIPTION) VALUES ('2022-12-31', 100321.0, 'New York Cap');INSERT INTO TAB_TRANSACTION ( DATE_TRANSACTION, PURCHASE_AMOUNT, DESCRIPTION) VALUES ('2023-09-06', 150.0, 'Milk Happy Cow 1L');
INSERT INTO TAB_TRANSACTION ( DATE_TRANSACTION, PURCHASE_AMOUNT, DESCRIPTION) VALUES ('2023-09-07', 75.0, 'Lego Set');
INSERT INTO TAB_TRANSACTION ( DATE_TRANSACTION, PURCHASE_AMOUNT, DESCRIPTION) VALUES ('2023-06-01', 70.456, 'Bread');
INSERT INTO TAB_TRANSACTION ( DATE_TRANSACTION, PURCHASE_AMOUNT, DESCRIPTION) VALUES ('2023-06-30', 63.456, 'Flip flop');
INSERT INTO TAB_TRANSACTION ( DATE_TRANSACTION, PURCHASE_AMOUNT, DESCRIPTION) VALUES ('2022-12-31', 63.456, 'Whopper');