/Eastridge-challenge

Django, Swagger, Django Rest Framework, RestulAPI, Nested Router.

Primary LanguagePython

Run the project on the local machine

-run script

sudo docker-compose up -d

Postman Collection

postman_collection.json file exists in the source directory. You can import it into the Postman Software and experiment the rest api after you run the project succesfully

API DETAIL

  1. Invoices API
    • GET /api/invoices/?format=json
      List the Invoices with pangiation.
      format query params are optional and by default it renders the data in JSON format. if you specify ?format=xml api response in XML format.
    • POST /api/invoices/
      Create the Invoice
    • GET /api/invoices/{invoice_id}/
      List the Invoice data of given invoice_id
    • PUT /api/invoices/{invoice_id}/
      Update or Replace the Existing Invoice data
    • Delete /api/invoices/{invoice_id}/ Delete the Invoice
    • GET /api/invoices/{invoice_id/items/?format=json
      List the Invoice Items of given invoice_id Pagination features are present.
    • POST /api/invoices/{invoice_id/items/
      Add the Invoice Item to the given invoice_id
    • GET|PUT|DELETE /api/invoices/{invoice_id}/items/{invoice_item_id}/
      List|Update|Delete the Invoice Item of given id of given invoice id
  2. Invoice Items API
    • GET /api/invoice-items/?format=json
      List the invoice items with pagination. support both json and xml.
    • POST /api/invoice-items/
      Create the invoice item.
    • GET /api/invoice-items/{invoice_item_id}/
      Retrieve the Invoice Item with invoice_item_id
    • PUT /api/invoice-items/?format=json
      Update the Invoice Item with invoice_item_id
    • DELETE /api/invoice-items/?format=json
      Delete the Invoice Item with invoice_item_id

Swagger UI

  • You can browse API with swagger UI on http://<domain_name>/swagger-ui/