Git Product home page Git Product logo

piq_exercise's Introduction

This is a sample project to demonstrate how Django REST Framework can be used to create RESTful API's

  • installation :

To setup the application run

bash setup.bash

If there is any error running above command, open the file and try to run each command manually, most of the time this errors are due to older version of virtulaenv

Post setup instruction will also gets printed when you run setup.bash

Core BO related to Project/Problem statement are inside core package of the project which can be shared and extended among multiple projects.

There are two Django Applications inside this Project

  1. Consumer
  2. PAdmin

Consumer can use following endpoints

POST /consumer/invoice/ -> to upload invoice

GET /consumer/invoice/ -> to view invoice / to check it's status

GET /consumer/digital_invoice/ -> to get Digitized Invoice Information

GET /consumer/digital_invoice?inv_id=<invoice_id> -> to get Digitized Invoice Information by invoice id

Admin can use following endpoints

GET /admin/invoice/ -> to see uploaded invoices

POST /admin/update_invoice_status -> to update status of any particular invoice

GET /admin/digital_invoice/ -> to view invoices that processing/processed and digitized

GET /admin/digital_invoice?inv_id=<invoice_id> -> to get Digitized Invoice Information by invoice id

POST/PATCH /admin/digital_invoice/ -> to manually update any particular invoice

GET/POST/PATCH /admin/invoice_item/ -> to view/create/update invoice line items

All of these endpoints are accessible in the DRF's web ui.

sample payload to create or update digital invoice is as given below:

{
    "raw_invoice_id": null,
    "invoice_number": "",
    "invoice_date": null,
    "due_date": null,
    "vendor_name": "",
    "vendor_address": {
        "street_address": "",
        "city": "",
        "state": "",
        "postal_code": null
    },
    "buyer_name": "",
    "buyer_address": {
        "street_address": "",
        "city": "",
        "state": "",
        "postal_code": null
    },
    "sub_total": null,
    "tax_percentage": null,
    "tax_applicable": null,
    "discount_percentage": null,
    "discount_applicable": null,
    "amount_payable": null,
    "is_paid": false,
    "invoice_items": [
        {
            "description": "",
            "quantity": "1",
            "unit_price": "2.00",
            "total_price": "2.00"
        }
    ]
}

It is not mandatory to pass all fields together, at a time any combination of fields can be passed to create or update any fields

piq_exercise's People

Contributors

ckalpit avatar

Watchers

James Cloos 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.