SpringBootRestApi

An application to demonstrate how Spring Boot, Spring Data, and Postgres can be used together to create a simple RESTful API using an embedded tomcat server.

Dependicies

  • SpringBoot
  • Maven
  • Docker
  • Postgres

Usage

πŸ”¨ Dockerize the App

  • mvn clean install
  • docker build . -t springbootapi:1.0
  • docker ps
  • docker run --net=host --name springbootapi -d -p 8080:8080 springbootapi:1.0

Features

  • Adding Purchasing Specialist

    • Each purchasing specialist had a limit. (default limit is 200. changeable from application.properties)
    • Each purchasing specialist is identified by First Name, Last Name and E-mail. The Same Name and The transactions of people with surname information but with different email addresses are carried out in a separate way it is evaluated.
  • Getting list of the all purchasing specialists

  • Deleting Purchasing Specialist

    • Deleting the purchasing specialist by Id.
  • Adding bills

    • the amount in the new bill is sum with the approved bills of the purchasing specialist. If the amount exceeds the limit, the bill is not approved. if it does not exceed the bill is approved.
  • getting list of the

    • all bills
    • all accepted bills
    • all accepted bills by purchasing specialist's id
    • all declined bills
    • all declined bills by purchasing specialist's id
  • Deleting bill

    • Deleting the bill by Id.

Folder Structure

PROJECT_FOLDER
β”‚  README.md
β”‚  pom.xml           
└──[src]      
β”‚  └──[main]      
β”‚     └──[java]      
β”‚     └──[resources]
|        |  SpringBootRestApi.postman_collection.json   #The postman collection that you can use the send request to server
β”‚        └──application.properties      #contains springboot cofigurations
β”‚        
β”‚
└──[target]              #Java build files, auto-created after running java build: mvn install
β”‚  └──[classes]

Request Examples

  • Add new purchasing specialist PostPs

  • Get al purchasing specialists getAllPs

  • Delete purchasing specialist by id DeletePs

  • Add new bill PostBill

  • Get all bills GetBills

  • Get accepted bills getAcceptedBills

  • Get declined bills getDeclinedBills

  • Get accepted bills by id getAcceptedBillsById

  • Get declined bills by id getDeclinedBillsById

  • Delete bill by id deleteBill