Skip to content

Instantly share code, notes, and snippets.

@aitchkhan
Last active October 12, 2022 09:42
Show Gist options
  • Save aitchkhan/0ff29d6440c82bc36406735cea342db5 to your computer and use it in GitHub Desktop.
Save aitchkhan/0ff29d6440c82bc36406735cea342db5 to your computer and use it in GitHub Desktop.
Nehal Progress Tracker

ERD feedback:

ERD

  1. We need just one table for users, which will contain all user information. Hence, we will not need registration, login, reset_password, account_info.
  2. Customer contact form does not need a customer reference. because, we assume that this is an anonymous user.
  3. We don't need Customer table either, because orders can be associated with User tables directly.
  4. Product table can be renamed to Vehicles.
  5. Order can be renamed to Receipts.
  6. We can move all the fields of Order_details to Receipt
  7. Vehicle should contain following details:
    • Make
    • Model
    • Name
    • Status => New/Used
    • Engine Type => Petrol, Diesel, Hybrid
    • Engine Capacity
  8. We need another table for Inventory, which will basically extend Vehicle, and it will contain following details
    • Registration Number
    • Color
    • Mileage
    • Dealer_ID (FK)

API specs:

Fetch all inventory on home page.

Endpoint:

GET: api/v1/inventory?limit=10&offset=0

Fetch inventory by ID

Endpoint: GET:

Complete Purchase:

Endpoint: POST:

User: Login: POST: api/v1/users/login

Signup: POST: api/v1/users/signup

On singup, just send a success message

On login, return a JWT token to user