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

  1. API Path: api/earnings/getEarnings
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. 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

  1. API Path: api/earnings/getTotalEarning
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. 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

  1. API Path: api/earnings/getTotalEarning
  2. Method: GET
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. 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

results matching ""

    No results matching ""