Giter Site home page Giter Site logo

ropstam-test's Introduction

Running

to run both of the repo just clone the repo and install node modules for both frontend and backend seperately and then run this in the root directory

    npm start

API document

due to time limit i am just documenting without formatting it as my normal template is is the first response in the docs

Postman collection is available in the repo as well

prefix: /

Employe apis

Create Employee
Add Policy


  • Success Result template

    {
        "result": "ok",
        "data": {
            
        }
    }
  • **Failed Result template **
    status code: 400

    {
        "result:": "error",
        "message": error_string
    }

Employee apis details

Create Employee

User is created , send verification mail.

 POST employee/createEmployee

QUERY PARAMS

Name Type Mandatory Description
email String YES User email
name String YES full name of the user
mobile String YES phone number of the user
city String YES city name of the user

RETURN

  • Success Result
    status code: 200

    {
        "_id": "6288bee2c3d7793950d44940",
        "fullName": "faizan",
        "email": "[email protected]",
        "mobile": "123132131",
        "password": "123456789",
        "city": "islamabad",
        "__v": 0
    }
  • Failed Result
    status code: 400

    {
        "driver": true,
        "name": "MongoError",
        "index": 0,
        "code": 11000,
        "keyPattern": {
            "email": 1
        },
        "keyValue": {
            "email": "[email protected]"
        },
        "errmsg": "E11000 duplicate key error collection: EmployeeDB.employees index: email_1 dup key: { email: \"[email protected]\" }"
    }

Policies apis details

Add Policy

policy is created._

 POST policy/addPolicy

QUERY PARAMS

Name Type Mandatory Description
category String YES FK of category
policyNumber String YES numebr of policy
policyDescription String YES description of policy

RETURN

  • Success Result
    status code: 200

    {
    "category": [
        "6288a2378489ad1b54193f0d"
    ],
    "_id": "6288bfcbc3d7793950d44941",
    "policyNumber": "highCat3a",
    "policyDescription": "high policy cat3",
    "__v": 0
    }
  • Failed Result
    status code: 400

    {
        errorMessage: errorMessage 
    }

ropstam-test's People

Contributors

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