Giter Club home page Giter Club logo

imatiatest's Introduction

[Spring Boot] Order tracking

Proof of concept app done as part of a recruiting process. Runs over Spring Boot. Maven required.

Usage

Go to the root of the project and run

./mvnw package && java -jar target/spring-boot-docker-0.0.1-SNAPSHOT.jar

App should start and listen on port 8080. The relevant endpoint is /order/tracking/

If performing a GET request against it, a list in form of JSON will be returned with the data of all the current orders.

When performing a POST, the body of the request has to contain a JSON with the order tracking data. e.g.

{"orderTrackings": [
	{
		"orderId": 230688716,
		"trackingStatusId": 2,
		"changeStatusDate": "2019-01-27T07:18:23.108+00:00"
	},
	{
		"orderId": 953688716,
		"trackingStatusId": 2,
		"changeStatusDate": "2019-01-27T07:18:23.108+00:00"
	},
	{
		"orderId": 189688716,
		"trackingStatusId": 2,
		"changeStatusDate": "2019-01-27T07:18:23.108+00:00"
	}
]}

In my case I have leveraged curl to test:

  • GET
curl localhost:8080/order/tracking/
  • POST (trackingData.json file included in the repo)
curl -X POST -H "Content-Type: application/json" -d @trackingData.json localhost:8080/order/tracking/

TODOs

  • Proper error handling (Invalid requests (5xx errors), 4xx errors)
  • Sanitize content (JSON) receceived in the endpoint to detect invalid fields
  • Store history of changes for a given Order Id
  • Check dates when updating an order (update date > order last modification date)
  • Log Invalid requests
  • Log when an invalid statr transition tried to be done

imatiatest's People

Contributors

pablopenna avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.