Routes - Earnings
File Name : earning.js
File Path : /server/routes/earning.js
Earnings route contains getEarnings . These functionalities are included in Earnings Controller.
Get Driver Earnings Route
- API Path: api/earnings/getEarnings
- Method: GET
- Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
Parameters:
- Name: req
Type: Object
Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the earnings details to the driver.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string data array
Get Monthly Earnings Route For Admin
- API Path: api/earnings/getTotalEarning
- Method: GET
- Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
Parameters:
- Name: req
Type: Object
Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the monthly earnings of current year.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string yearlyEarning array totalYearlyAmount number lastMonthEarnings object
Get Earnings Route For Admin
- API Path: api/earnings/getTotalEarning
- Method: GET
- Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
Parameters:
- Name: req
Type: Object
Name: jwtAccessToken
- In: Header
- Type: String
- Description: JWT access token is used to check the authenticity of the user.
Name: res
- Type: Object
- Description: res is nothing but the response object which gets you the toatal earnings in a current month.
Response:
- Http Code: 200
- Name: returnObj
- Type: Object
Name Type success boolean message string earningData array totalEarninAmount array