Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abayo-luc/epd-backend
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.
https://github.com/abayo-luc/epd-backend
nodejs sequelize
Last synced: 25 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/abayo-luc/epd-backend
- Owner: abayo-luc
- Created: 2020-03-04T09:20:29.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2021-03-08T17:58:25.000Z (over 3 years ago)
- Last Synced: 2023-03-03T06:58:23.276Z (over 1 year ago)
- Topics: nodejs, sequelize
- Language: JavaScript
- Homepage:
- Size: 370 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# edp-backend
Project description [link](https://docs.google.com/document/d/1vHg6q6T6Nu9dptnJ1wEv_xnpK6Cj_QO9nqJz_uKYIPs/edit?usp=sharing)
# Links
- EDP API:
- [Staging](https://edp-backend-staging.herokuapp.com/api)
- [Production](#)
- EDP Frontend:
- [GitHub-repo](https://github.com/NkFab/EPD-Front)
- [Wep App](#)# 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 pageexample: `/sales?page=2&limit=15&search=FAB`
## Authentication
### Login
`POST /authentication/sign-in`
```source-json
{
"Content-type": "application/json"
"body":{
"phoneNumber":"0789374675",
"password":"string345"
}
}
```### Current user
`GET /authentication/current`
```source-json
{
"Content-type": "application/json"
"Authorization":{{TOKEN}}
}
```## Users
### Create a new user
`POST /users` (for admin)
`POST /companies/:companyId/users` (for supervisor)
```source-json
{
"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)
```source-json
{
"Content-type": "application/json"
"Authorization":{{TOKEN}}
}
```### Get one users
`GET /users/:id` (for admin and owner)
`GET /companies/:companyId/users/:id` (for supervisor)
```source-json
{
"Content-type": "application/json",
"Authorization":{{TOKEN}}
}
```### Update user
`PUT /users/:id`
```source-json
{
"Content-type": "application/json",
"Authorization":{{TOKEN}}
"body":{
"name":"Luc Abayo",
"username":"abayo_luc",
"email":"me@gexample"
}
}
```### Update password
`PUT /users/:id/passwords`
```source-json
{
"Content-type": "application/json",
"Authorization":{{TOKEN}}
"body":{
"password":"new-password"
}
}
```# Company
### Create a new company
`POST /companies`
```source-json
{
"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`
```source-json
{
"Content-type": "application/json"
"Authorization":{{TOKEN}}
}
```### Get one company
`GET /company/:id`
```source-json
{
"Content-type": "application/json",
"Authorization":{{TOKEN}}
}
```### Update company
`PUT /companies/:id/passwords`
```source-json
{
"Content-type": "application/json",
"Authorization":{{TOKEN}}
"body":{
"name":"EDP Ltd",
"email":"[email protected]",
"address":"GG 11 St",
"phoneNumber":"0789866365"
}
}
```### Delete company
`DELETE /companies/:id`
```source-json
{
"Content-type": "application/json",
"Authorization":{{TOKEN}}
}
```# Sales
### Get all sales
`GET /sales` (for only admins)
```source-json
{
"Content-type": "application/json",
"Authorization":{{TOKEN}}
}
```### Get all company sales
`GET /companies/:companyId/sales`
### Get all agent sales
`GET /companies/:companyId/`