Coder Social home page Coder Social logo

democrance's Introduction

Democrance

Problem Statements:

  1. Customer does signup.
  2. Creates a quote.
  3. Reviewed the quote and marks it accepted.
  4. Does the payment/start the policy and backend gets the bill paid by payment link or something.
  5. Get detail of the policy.
  6. List of policies.
  7. Get history of a single policy.

Project Design and Explanation

  1. Part 1: Create customer

    There could be two ways to use this endpoint: a. Customer post his information along with name, dob, email/phone, password (basically does the signup) b. A staff from insurance company can post above information and customer gets the link to set password

    The post body for customer probably is not enough, we should post with one unique identifier e.g. Phone or email We can create a User (I am talking about django user here), and put a one-to-one mapping with Customer table.

    {
        "first_name": "Ben",
        "last_name": "Stokes",
        "dob": "25-06-1991"
    }
    
  2. Part 2: Create quote Quote information could be posted by a staff user, along with customer

     {
        "type": "personal-accident",
        "premium": 200,
        "cover": 200000
        "state": "new",
        "customer": 1,
    
    }
    

Also the customer himself could login, and post the quote attributes and on backend we can fetch the customer from logged in user and can fill in before creating the quote

  1. Part 3: Implement search for customers/policies. Find customers by name, dob or policy type.

    1. On django admin: added filter on policy: filter by name, dob and policy type
    2. On django admin: added filter on customer: filter by name, dob
  2. Discuss how you would implement authentication for users/customers, and would these be the same or different?

    Since we are already using Django REST Framework we can utilise rest_framework authtoken for authentication, So we can use token based authentiocation, for this we will expose one login API which validates the user credentials and returns a token which could be used in subsequent requests,

    User does not have to be customer necesarily, user could be staff user as well, if user is customer user will have a one-to-one mapping with customer.

Stacks Used

  • Python
  • Django
  • Django REST Framework
  • SQLite3 (Note: SQLite3 is used to reduce the setup time. PostgreSQL would be preferred for production environments.)

Project Setup

To get the project up and running on your local machine, follow these steps:

  1. Clone the repository:
    git clone https://github.com/pk026/democrance
  2. Create a virtualenv using:
    python3 -m venv venv
  3. Activate environment using:
      source venv/bin/activate
  4. Install requirements using:
    pip install -r requirements.txt
  5. Create database schema using:
        python manage.py migrate
  6. Create a superuser:
    python manage.py createsuperuser --username admin --email [email protected]
  7. run development server:
    python manage.py runserver
    

Reference video

  1. https://www.loom.com/share/e5ad3a9d40b341668e786e923dd566db

democrance's People

Watchers

Pramod Singh 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.