Skip to content

magjack/techtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Test application

This is a spring boot application that processes 50 messages about the sale of products

To run the project clone this repo and run the following in a command line within the project directory:

mvn spring-boot:run

This will create a REST Api with two POST endpoints sale and saleAdjust To use these endpoint use a http client like postman or curl passing the following.

POST localhost:8080/message/sale Passing:

{
	"product": "<StringValue>",
	"value": <Number> ,
    "Quantity": <Integer> //Optional
}

Examples:

   {
   	"product": "Bike",
   	"value": 10.10 ,
       "Quantity": 10
   }
{
	"product": "Scooter",
	"value": 13.20
}

The other endpoint is : POST localhost:8080/message/saleAdjust which accepts:

{
	"sale":{
	     "product": "<StringValue>",
         "value": <Number> ,
        "Quantity": <Integer> //Optional
	},
	"adjustment":{
		"product": "<StringValue>",
		"operation":"<SUBTRACT|ADD|MULTIPLE>",
		"value":<NUMBER>
	}
}

Example :

{
	"sale":{
		"product": "bike",
		"value": 10,
		"quantity":1
	},
	"adjustment":{
		"product": "bike",
		"operation":"SUBTRACT",
		"value":10
	}
}

About

Test application to process sales messages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages