Code Monkey home page Code Monkey logo

spinny-assignment's Introduction

API Service for CRUD

Description

Consider a store which has an inventory of boxes which are all cuboid(which have length, breadth and height). Each Cuboid has been added by a store employee who is associated as the creator of the box even if it is updated by any user later on.

Tasks:

  1. Data Modelling

    Build minimal Models required for the such a store. You can use contrib modules for necessary models(for eg: users)

Build api for the following specifications:

  1. Add Api:

    Adding a box with given dimensions(length breadth and height).

    Adding user should be automatically associated with the box and shall not be overridden

    Permissions:

      User should be logged in and should be staff to add the box
    
  2. Update Api:

    Update dimensions of a box with a given id:

    Permissions:

      Any Staff user should be able to update any box. but shall not be able to update the creator or creation date
    
  3. List all Api

    List all boxes available:

    Data For each box Required:

        1. Length
    
        2. width
    
        3. Height
    
        4. Area
    
        5. Volume
    
        6. Created By :  (This Key shall only be available if requesting user is staff)
    
        7. Last Updated :  (This Key shall only be available if requesting user is staff)
    

    Permissions:

        Any user shall be able to see boxes in the store
    

    Filters:

        1. Boxes with length_more_than or length_less_than
    
        2. Boxes with breadth_more_than or breadth_less_than
    
        3. Boxes with height_more_than or height_less_than
    
        4. Boxes with area_more_than or area_less_than
    
        5. Boxes with volume_more_than or volume_less_than
    
        6. Boxes created by a specific user by username
    
        7. Boxes created before or after a given date
    
  4. List my boxes:

    List all boxes available created by me:

    Data For each box Required:

        1. Length
    
        2. width
    
        3. Height
    
        4. Area
    
        5. Volume
    
        6. Created By
    
        7. Last Updated
    

    Permissions:

        Only Staff user shall be able to see his/her created boxes in the store
    

    Filters:

        1. Boxes with length_more_than or length_less_than
    
        2. Boxes with breadth_more_than or breadth_less_than
    
        3. Boxes with height_more_than or height_less_than
    
        4. Boxes with area_more_than or area_less_than
    
        5. Boxes with volume_more_than or volume_less_than
    
  5. Delete Api:

    Delete a box with a given id:

    Permissions:

     Only the creater of the box shall be able to delete the box.
    

Conditions to be fulfilled on each add/update/delete:

Average area of all added boxes should not exceed A1

Average volume of all boxes added by the current user shall not exceed V1

Total Boxes added in a week cannot be more than L1

Total Boxes added in a week by a user cannot be more than L2

Values A1, V1, L1 and L2 shall be configured externally. You can choose 100, 1000, 100, and 50 as their respective default values.

spinny-assignment's People

Contributors

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