- configure the database and redis by creating env file similar to
.env.example
- run
npm install
- run
npm run start
To create a parent company
Example:
POST /company
{
"CompanyName": "Company1",
"TotalSales": 75000,
"TargetSales":44545,
"progress": "30"
}
To create child companies to a parent company
Example:
POST /company/:id
{
"children":[
{
"CompanyName": "Company2",
"TotalSales": 75000,
"TargetSales":44545,
"progress": "30"
},
{
"CompanyName": "Company3",
"TotalSales": 75000,
"TargetSales":44545,
"progress": "30"
}
]
}
To update an induvidual company can be both parent and child
Example:
PUT /company/:id
{
"CompanyName": "Company2",
"TotalSales": 75000,
"TargetSales":44545,
"progress": "30"
}
To delete a parent/child company if it is a parent all the children will be deleted as well
Example:
DELETE /company/:id
To get child or parent company . If it is a parent it will return all the children
Example:
GET /company/:id
By Karan
My portfolio link I'm currently building it so lot of the details are not updated