└── README.md /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Assessment for backend developer. 3 | 4 | Dukaan is a tech platform that enables a business to quickly set up and run an online retail store. 5 | 6 | A typical seller installs the Dukaan app, Signs up using his mobile number and creates his store. He can then start uploading inventory (as products) to his store. 7 | Once the store is created, he can share the store link with his/her customers on social media and starts accepting online orders. 8 | 9 | Your assignment is to Design a very basic API (Django DRF) & database (any SQL db works) structure which supports above work-flow. 10 | 11 | ### Detailed breakdown of the workflow - 12 | 13 | ### endpoints for seller side. (Words in Bold indicates table names) 14 | 15 | 16 | 1. seller signs up using his mobile number that creates an **account** 17 | 1. Take mobile number & OTP (random) as input to the API 18 | 2. Create customer account in accounts table. 19 | 3. Issue a token. 20 | 21 | 22 | 2. seller creates his **store** 23 | 1. Take store name & address as input. 24 | 2. Create store in store table. One seller can have multiple stores. 25 | 3. Generate a unique store link based on his store name. 26 | 4. Respond back with storeid and link. 27 | 28 | 3. seller starts uploading inventory in the form of **products** and **categories**. 29 | 30 | 1. Take product name, description, MRP, Sale price, image & category as input. 31 | 2. Create a category if it doesn't exist. 32 | 3. Create product 33 | 4. Respond back with id, name and image. 34 | 35 | 36 | 4. Seller can accept **orders** from his **customers**. 37 | 38 | 1. Create a customer table with a mobile number as unique and address details. 39 | 2. Create a order table to store orders data. 40 | 3. When someone places an order from the buyer side, the records will be saved here. 41 | 42 | 43 | ### Endpoints for Buyer side 44 | 45 | 46 | 1. Seller shares his store link with his customers. To get basic store details 47 | 48 | 1. Take store link as input 49 | 2. Respond back with storeId, store name, address 50 | 51 | 2. To get product catalog & categories 52 | 53 | 1. Take storelink as input 54 | 2. Respond back with the catelog, grouped by categories & sorted by number of products in the category. 55 | 56 | 57 | 3. people (Un-authenticated users) can add items into their cart. 58 | 59 | 1. Maintain a cart on the server (create appropriate models for this) 60 | 2. On cart change (add / remove item) update the cart on server 61 | 3. For cart line items take product id, qty, storeLink as input and fetch product meta data from the DB and save them. 62 | 63 | 64 | 4. Customer place an order for a product. 65 | 66 | 1. Identity customer using JWT or token which can be generated using his mobile number and a OTP 67 | 2. Bypass the actual OTP validation flow and issue a token on any random number & OTP combination 68 | 3. Create a customer record if didn’t already exist for that mobile number. 69 | 4. Take the cart object as input and convert that into an order. 70 | 5. Create an order for that store & customer and return back the order id. 71 | --------------------------------------------------------------------------------