- Solution implemented for FixedBid type. it can be enhanced to HourlyBid type.
- Buyers(50,000) registered as part of the system start up.
- Error scenarios handled for below use cases
a. Project not found
b. System Available for scheduling
c. Bids not found
d. Buyer not found
- Unit test case implemented
- Following APIs implemented
a. add project - This is used to add project by a Seller
b. add project-bid -- This is used to add bid to a Seller's project. If project reached deadline, this API returns project info with lowest bid buyer info
c. get projects - This is used to get the list of projects (last 100 or from beginning to end)
d. get project-bids -- This is used to get the list of project bids
e. get buyers -- This is used to get the list of buyers
f. get lowestbid -- This can be used to get the lowest bid for a given project
- To build the package and run tests
mvn package
- To run tests alone
mvn test
- To run the app and view swagger-ui as rest client for API testing
mvn spring-boot:run
http://localhost:8080/swagger-ui.html
curl -X POST \
http://localhost:8080/marketplace/project \
-H 'content-type: application/json' \
-d '{
"deadlineDateTime": "2019-08-07 07:15:00Z",
"description": "project bidding software1",
"seller": {
"fullName": "seller1",
"id": 1
}
}'
curl -X POST \
http://localhost:8080/marketplace/project/bid \
-H 'content-type: application/json' \
-d '{
"buyer": {
"id": 1
},
"fixedPrice": 10,
"projectId": 1
}'
curl -X GET \
http://localhost:8080/marketplace/projects \
-H 'content-type: application/json'
curl -X GET \
'http://localhost:8080/marketplace/project/bids?projectId=1' \
-H 'content-type: application/json'
curl -X GET \
http://localhost:8080/marketplace/buyers \
-H 'content-type: application/json'
curl -X GET \
'http://localhost:8080/marketplace/project/lowestbid?projectId=1' \
-H 'content-type: application/json'