Giter Club home page Giter Club logo

invoice-challenge's Introduction

Invoice Challenge

API REST

Requirements

  • Java 17
  • SpringBoot 3.2.2
  • Maven
  • MySQL

How to run the application?

Execute the sql script database.sql to generate the structure required for the application.

cd ./challenge/challenge/
mvn spring-boot:run

It runs the application on localhost:8080/invoices

Services available

Invoice

  • Create a invoice
POST /invoices/v1/invoice

{
    "client": "cliente 100",
    "taxId": "CF",
    "total": 100.0
}

HTTP OK 201
  • Update the invoice
PUT /invoices/v1/invoice/{id}

{
    "client": "cliente 100",
    "taxId": "CF",
    "total": 100.0
}

HTTP OK 201
  • Delete the invoice
DELETE /invoices/v1/invoice/{id}

HTTP OK 201
  • Get all invoices
GET /invoices/v1/invoice

HTTP OK 200

[
    {
        "id": 1,
        "client": "cliente 1",
        "taxId": "CF",
        "total": 100.0,
        "creationDate": "03:09:08",
        "modificationDate": "03:09:08",
        "deletionDate": null
    }
]
  • Get invoice
GET /invoices/v1/invoice/{id}

HTTP OK 200

{
    "id": 1,
    "client": "cliente 1",
    "taxId": "CF",
    "total": 100.0,
    "creationDate": "03:09:08",
    "modificationDate": "03:09:08",
    "deletionDate": null
}

InvoiceDetail

  • Create a detail
POST /invoices/v1/invoice/detail

{
    "product": "",
    "price": 10,
    "quantity": 100,
    "invoiceId": 100
}

HTTP OK 201
  • Update the detail
PUT /invoices/v1/invoice/detail/{id}

{
    "product": "",
    "price": 10,
    "quantity": 100,
    "invoiceId": 100
}

HTTP OK 201
  • Delete the detail
DELETE /invoices/v1/invoice/detail/{id}

HTTP OK 201
  • Get all details or by invoiceId
GET /invoices/v1/invoice/detail?invoiceId={invoiceId}

HTTP OK 200

[
    {
        "id": 5,
        "product": "Leche",
        "quantity": 123,
        "price": 123.0,
        "invoiceId": 32,
        "creationDate": "17:40:12",
        "modificationDate": "17:40:12"
    }
]
  • Get detail
GET /invoices/v1/invoice/detail/{id}

HTTP OK 200

{
    "id": 5,
    "product": "Leche",
    "quantity": 123,
    "price": 123.0,
    "invoiceId": 32,
    "creationDate": "17:40:12",
    "modificationDate": "17:40:12"
}

Frontend

Requirements

  • npm 10.4.0
  • react.js

How to run the application?

cd ./invoice-challenge
npm install
npm start

It runs the application on localhost:3000

invoice-challenge's People

Contributors

malvinjazz avatar

Watchers

 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.