GithubHelp home page GithubHelp logo

emp-summary-statistics-backend's Introduction

Project Title

Micro-Service for Summary Statistics

Acknowledgements

API methods and endpoints

Register User API

  POST http://localhost:8000/api/auth/register

This endpoint is used to register a new user.

Request Body

  • username (string, required): The name of the user.
  • email (number, required): The user email.
  • password (string, required): The user password.

input sample

raw (json)

 {
    "username":"testuser",
    "email":"[email protected]",
    "password":"1234"
}

Response

  • Status: 201
  • Content-Type: application/json
  • message (string): A message confirming the success of the operation.

Login User API

  POST http://localhost:8000/api/auth/login

This endpoint is used to login a user after register.

Request Body

  • username (string, required): The name of the user.
  • password (string, required): The user password.

input sample

raw (json)

 {
    "username":"testuser",
    "password":"1234"
}

Response

  • Status: 201
  • Content-Type: application/json
  • object (object): it will reture a user info and token .

Add Header

Add Employee API

  POST http://localhost:8000/api/employee/addemployee

This endpoint is used to add a new employee.

Request Body

  • name (string, required): The name of the employee.
  • salary (number, required): The salary of the employee.
  • currency (string, required): The currency in which the salary is paid.
  • department (string, required): The department to which the employee belongs.
  • on_contract (boolean, required): Indicates whether the employee is on contract or not.
  • sub_department (string, required): The sub-department to which the employee belongs.

input sample

raw (json)
{
    "name": "Nikhil",
    "salary": "110000",
    "currency": "USD",
    "on_contract": "true",
    "department": "Engineering",
    "sub_department": "Platform"
}

Response

  • Status: 201
  • Content-Type: application/json
  • message (string): A message confirming the success of the operation.

Fetch Employee API

  GET http://localhost:8000/api/employee

This endpoint is used to fetch all employee.

Response

  • Status: 201
  • Content-Type: application/json
  • object: sample data .
[
     {
        "_id": "65ddb4d6cc18ba5fc0a33dcc",
        "name": "Nikhil",
        "salary": 110000,
        "currency": "USD",
        "department": "Engineering",
        "on_contract": true,
        "sub_department": "Platform",
        "__v": 0
    },
    {
        "on_contract": false,
        "_id": "65ddb4e689daab01afdc0ea9",
        "name": "Abhishek",
        "salary": 145000,
        "currency": "USD",
        "department": "Engineering",
        "sub_department": "Platform"
    },
]

Delete Employee API

  DELETE http://localhost:8000/api/employee/deleteemployee/:employee_object_id

This endpoint is used to delete employee.

Response

  • Status: 201
  • Content-Type: application/json
  • message (string): A message confirming the success of the operation.

Summary Statistics Employee API

  GET http://localhost:8000/api/employee/employeesalary

it will take query params

    Query Param - (single or all)
    sub_department=true,
    department=true,
    on_contract=truek

url sample

  GET http://localhost:8000/api/employee/employeesalary?sub_department=true

This endpoint is used to get fetch summary statistics (avg, min, max, count) for salaries across the entire dataset.

Response

  • Status: 201
  • Content-Type: application/json
  • object: sample data .
{
    "count": 5,
    "minSalary": 110000,
    "maxSalary": "30",
    "averageSalary": 110000,
    "grouping": {
        "department": "Engineering",
        "sub_department": "Platform"
    }
}

To test

๐Ÿ”— Then Setup The Frontend

https://github.com/Bisu03/emp-Summary-Statistics-frontend

emp-summary-statistics-backend's People

Contributors

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