Giter Club home page Giter Club logo

fatmug_assignment's Introduction

Fatmug Assignment

This project is developed as a part of the Fatmug assignment. It includes functionalities related to managing purchase orders and vendors.

Installation

  1. Clone the repository:
git clone https://github.com/PhaleshM/Fatmug_Assignment.git
  1. Navigate to the project directory:
cd Assignment
  1. Create a virtual environment:
python -m venv env
  1. Activate the virtual environment:

    • On Windows:
    .\env\Scripts\activate
    
    • On macOS and Linux:
    source env/bin/activate
    
  2. Install dependencies:

pip install -r requirements.txt
  1. Apply migrations:
python manage.py migrate
  1. Run the development server:
python manage.py runserver

API Endpoints

Purchase Order Tracking

  • List all purchase orders: GET /api/purchase_orders/
  • Create a new purchase order: POST /api/purchase_orders/ (require: authentication)
{
    "delivery_date": "2024-06-04",
    "items": {
        "1":{
        "id": "GGOEAFKA087499",
        "name": "Android Small Removable Sticker Sheet",
        "description": "Show your Android pride by placing these 8 fun stickers on your technology products or accessories!",
        "features": "<p>8 Android stickers</p>\n<p>White colored sticker sheet</p>",
        "price": "2.99",
        "keywords": "Android Small Removable Sticker Sheet, android stickers, sticker sheets, removable sticker sheets, small sticker sheet, android small sticker sheets, Android Sheet",
        "url": "Android+Small+Removable+Sticker+Sheet",
        "category": "accessories",
        "subcategory": "accessories"
      }
    },
    "quantity": 12
}
  • Retrieve a purchase order by ID: GET /api/purchase_orders/<id>/ (require: authentication)
  • Update a purchase order by ID: PUT /api/purchase_orders/<id>/ or PATCH /api/purchase_orders/<id>/ (require: authentication)
  • Delete a purchase order by ID: DELETE /api/purchase_orders/<id>/ (require: authentication)

Vendor Profile Management

  • List all vendors: GET /api/vendors/
  • Create a new vendor: POST /api/vendors/
  • Login vendor: POST /api/vendors/login/
  • Retrieve a vendor by ID: GET /api/vendors/<id>/ (require: authentication)
  • Update a vendor by ID: PUT /api/vendors/<id>/ or PATCH /api/vendors/<id>/ (require: authentication)
  • Delete a vendor by ID: DELETE /api/vendors/<id>/ (require: authentication)

Other

  • Vendor Performance Endpoint: GET /api/vendors/{vendor_id}/performance/
  • Update Acknowledgment Endpoint: POST /api/purchase_orders/{po_id}/acknowledge (require: authentication)

Additional Notes

  • Ensure to include the following token in the header files for authentication: 'Authorization:Bearer TOKEN'
  • Performance metrics are efficiently computed by utilizing existing data, ensuring quicker response times when handling large datasets.
  • Upon saving a Purchase Order, the system automatically calculates new performance metrics and updates historical performance records.
  • To flag an issue in the Update Purchase Order API call, include issue=TRUE in the request body.
  • Postman Workspace: https://grey-moon-811508.postman.co/workspace/My-Workspace~2d9e1d64-7e44-40e8-80ea-f093ea6f8db9/collection/23862377-3001c35c-62f6-4afd-8267-876f8f835102?action=share&creator=23862377

fatmug_assignment's People

Contributors

phaleshm 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.