Hagglehaul  1.0
Hagglehaul - book and bid on rides
Loading...
Searching...
No Matches
hagglehaul.Server.Controllers.DriverController Class Reference

Controller for driver-related operations. More...

Inheritance diagram for hagglehaul.Server.Controllers.DriverController:

Public Member Functions

 DriverController (IDriverProfileService driverProfileService, IRiderProfileService riderProfileService, IUserCoreService userCoreService, ITripService tripService, IBidService bidService, IGeographicRouteService geographicRouteService, IEmailNotificationService emailNotificationService)
 
async Task< IActionResult > GetDashboard ()
 Gets the necessary info for a driver dashboard. Shows confirmed trips, trips in bidding, and past trips.
 
async Task< IActionResult > Get ()
 Get the basic info of the current driver.
 
async Task< IActionResult > ModifyAccountDetails ([FromBody] DriverUpdate driverUpdate)
 Modify account details, including password.
 
async Task< IActionResult > CreateOrUpdateBid ([FromBody] CreateOrUpdateBid request)
 Create or update a bid for a trip.
 
async Task< IActionResult > DeleteBid ([FromQuery] string tripId)
 Delete a bid for a trip.
 
async Task< IActionResult > GetAllAvailableTrips ()
 Get all biddable trips.
 
async Task< IActionResult > GetAllAvailableTrips ([FromBody] TripMarketOptions options)
 Get biddable trips and filter and sort using options.
 
async Task< IActionResult > RateRider ([FromBody] GiveRating giveRating)
 Rate a rider.
 

Detailed Description

Controller for driver-related operations.

Member Function Documentation

◆ CreateOrUpdateBid()

async Task< IActionResult > hagglehaul.Server.Controllers.DriverController.CreateOrUpdateBid ( [FromBody] CreateOrUpdateBid request)

Create or update a bid for a trip.

Parameters
requestThe bidding form.
Returns
OkResult if the bid was successfully created or updated, BadRequestObjectResult if the tripId is invalid or the trip is either confirmed or in the past, UnauthorizedResult if the user is not a driver

◆ DeleteBid()

async Task< IActionResult > hagglehaul.Server.Controllers.DriverController.DeleteBid ( [FromQuery] string tripId)

Delete a bid for a trip.

Parameters
tripIdThe ID of the trip to delete the user's bid from
Returns
OkResult if the bid was successfully deleted, BadRequestObjectResult if the tripId is invalid or the trip is either confirmed or in the past, UnauthorizedResult if the user is not a driver

◆ Get()

async Task< IActionResult > hagglehaul.Server.Controllers.DriverController.Get ( )

Get the basic info of the current driver.

Returns
OkObjectResult if the driver's basic info is successfully returned, BadRequestObjectResult if the user is invalid or not authenticated, UnauthorizedResult if the user is not a driver

◆ GetAllAvailableTrips() [1/2]

async Task< IActionResult > hagglehaul.Server.Controllers.DriverController.GetAllAvailableTrips ( )

Get all biddable trips.

Returns
OkObjectResult if the biddable trips are successfully returned

◆ GetAllAvailableTrips() [2/2]

async Task< IActionResult > hagglehaul.Server.Controllers.DriverController.GetAllAvailableTrips ( [FromBody] TripMarketOptions options)

Get biddable trips and filter and sort using options.

Parameters
optionsThe filtering and searching options form.
Returns
OkObjectResult if the biddable trips are successfully returned, BadRequestObjectResult if the options are invalid

◆ GetDashboard()

async Task< IActionResult > hagglehaul.Server.Controllers.DriverController.GetDashboard ( )

Gets the necessary info for a driver dashboard. Shows confirmed trips, trips in bidding, and past trips.

Returns
OkObjectResult if the dashboard is successfully returned, BadRequestObjectResult if the user is invalid or not authenticated, UnauthorizedResult if the user is not a driver

◆ ModifyAccountDetails()

async Task< IActionResult > hagglehaul.Server.Controllers.DriverController.ModifyAccountDetails ( [FromBody] DriverUpdate driverUpdate)

Modify account details, including password.

Parameters
driverUpdateThe update form.
Returns
OkResult if the account details are successfully updated, BadRequestObjectResult if the user is invalid or not authenticated, UnauthorizedResult if the user is not a driver

◆ RateRider()

async Task< IActionResult > hagglehaul.Server.Controllers.DriverController.RateRider ( [FromBody] GiveRating giveRating)

Rate a rider.

Parameters
giveRatingThe rating form.
Returns
OkResult if the rider was successfully rated, BadRequestObjectResult if the user is invalid or not authenticated, UnauthorizedResult if the user is not a driver

The documentation for this class was generated from the following file: