Skip to content

Energy Private Developers's platform which will help to collect and visually present data ensuring all stakeholders can provide and access data with ease while providing the team with valuable insight into the market and selling process.

Notifications You must be signed in to change notification settings

abayo-luc/EPD-Backend

Repository files navigation

edp-backend

Project description link

Links

API Endpoints

Search and filter

For searching and filter all GET all endpoints access the following query params:

  • search: which is a text you are trying to search

  • Page: page number form 1 to ...

  • Limit: which is the size of results to be returned per page

    example: /sales?page=2&limit=15&search=FAB

Authentication

Login

POST /authentication/sign-in

{
    "Content-type": "application/json"
    "body":{
        "phoneNumber":"0789374675",
        "password":"string345"
    }
}

Current user

GET /authentication/current

{
    "Content-type": "application/json"
    "Authorization":{{TOKEN}}
}

Users

Create a new user

POST /users (for admin)

POST /companies/:companyId/users (for supervisor)

{
    "Content-type": "application/json"
    "Authorization":{{TOKEN}}
    "body":{
        "username":"abayo",
        "password":"password",
        "phoneNumber":"0789277287",
        "companyId":"6faa1986-d9c9-42ab-a40e-477c1124581f"
    }
}

Get all users

GET /users (for admin)

GET /companies/:companyId/users (for supervisor)

{
    "Content-type": "application/json"
    "Authorization":{{TOKEN}}
}

Get one users

GET /users/:id (for admin and owner)

GET /companies/:companyId/users/:id (for supervisor)

{
    "Content-type": "application/json",
    "Authorization":{{TOKEN}}
}

Update user

PUT /users/:id

{
    "Content-type": "application/json",
    "Authorization":{{TOKEN}}
    "body":{
        "name":"Luc Abayo",
        "username":"abayo_luc",
        "email":"me@gexample"
    }
}

Update password

PUT /users/:id/passwords

{
    "Content-type": "application/json",
    "Authorization":{{TOKEN}}
    "body":{
       "password":"new-password"
    }
}

Company

Create a new company

POST /companies

{
    "Content-type": "application/json"
    "Authorization":{{ADMIN_TOKEN}}
    "body":{
        "name":"123 Inc.",
        "email":"[email protected]",
        "address":"KG 11 Av",
        "phoneNumber":"0789277275"
    }
}

Get all companies

GET /companies

{
    "Content-type": "application/json"
    "Authorization":{{TOKEN}}
}

Get one company

GET /company/:id

{
    "Content-type": "application/json",
    "Authorization":{{TOKEN}}
}

Update company

PUT /companies/:id/passwords

{
    "Content-type": "application/json",
    "Authorization":{{TOKEN}}
    "body":{
        "name":"EDP Ltd",
        "email":"[email protected]",
        "address":"GG 11 St",
        "phoneNumber":"0789866365"
    }
}

Delete company

DELETE /companies/:id

{
    "Content-type": "application/json",
    "Authorization":{{TOKEN}}
}

Sales

Get all sales

GET /sales (for only admins)

{
    "Content-type": "application/json",
    "Authorization":{{TOKEN}}
}

Get all company sales

GET /companies/:companyId/sales

Get all agent sales

GET /companies/:companyId/

About

Energy Private Developers's platform which will help to collect and visually present data ensuring all stakeholders can provide and access data with ease while providing the team with valuable insight into the market and selling process.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published