Coder Social home page Coder Social logo

purchasing-service's Introduction

E-Ticaret Satın Alma

This web service controls to invoices and theirs limits. The new invoice information to be entered into the accounting system will be based on all APPROVED invoices that the procurement specialist has entered so far. is NOT APPROVED if it increases the total above the specified limit, or APPROVED if it does not exceed the limit.

Run the project

To run project, run the shell executable file ./run.sh. Application running on 8080 default port.

In order to test project run the mvn test command in the project root directory.

Endpoints

  • POST /api/v1/invoices for add a new invoice.

  • GET /api/v1/invoices for get all invoices.

Examples

  • Transaction Information: "John,Doe,[email protected],200,TR0001" Credit Limit : 200 Result : The transaction of John Doe is approved

  • Transaction Information: "Jane,Doe,[email protected],201,TR0001" Credit Limit : 200 Result : The transaction of John Doe is rejected

1) Transaction Information: "Jane,Doe,[email protected],199,TR0001"
2) Transaction Information: "Jane,Doe,[email protected],2,TR0002" 

Credit Limit : 200
   
Result : The second transaction of Jane Doe is rejected

CURL Examples

  • Authentication
accessToken=$(curl --location 'http://localhost:8080/api/v1/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{"email": "[email protected]","password": "demopass"}' \
 | jq -r '.accessToken')
  • Add a new invoice
curl --location 'http://localhost:8080/api/v1/invoices' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer '$accessToken \
--data-raw '{
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "amount": 45,
    "productName": "TR0001",
    "billNo": 2
}'
  • Get invoice list
curl --location 'http://localhost:8080/api/v1/invoices' \
--header 'Authorization: Bearer '$accessToken

Development Requirements

Project requires the following to run:

  • Java 21
  • Apache Maven 3.9.0+

purchasing-service's People

Contributors

frknpg avatar

Watchers

 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.