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

Controller for rider-related operations. More...

Inheritance diagram for hagglehaul.Server.Controllers.RiderController:

Public Member Functions

 RiderController (IRiderProfileService riderProfileService, IDriverProfileService driverProfileService, IUserCoreService userCoreService, ITripService tripService, IBidService bidService, IGeographicRouteService geographicRouteService, IEmailNotificationService emailNotificationService)
 
async Task< IActionResult > Get ()
 Get the basic info of the current rider.
 
async Task< IActionResult > GetDashboard ()
 Gets the necessary info for a rider dashboard. Shows confirmed trips, trips in bidding, and past trips.
 
async Task< IActionResult > ModifyAccountDetails ([FromBody] RiderUpdate riderUpdate)
 Modify account details, including password.
 
async Task< IActionResult > PostRiderTrip ([FromBody] CreateTrip tripDetails)
 Create a new trip.
 
async Task< IActionResult > DeleteRiderTrip ([FromQuery] string tripId)
 Delete a trip.
 
async Task< IActionResult > ConfirmDriver ([FromBody] AddTripDriver addTripDriver)
 Confirm a driver for a trip.
 
async Task< IActionResult > RateDriver ([FromBody] GiveRating giveRating)
 Rate a driver.
 

Detailed Description

Controller for rider-related operations.

Member Function Documentation

◆ ConfirmDriver()

async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.ConfirmDriver ( [FromBody] AddTripDriver addTripDriver)

Confirm a driver for a trip.

Parameters
addTripDriverThe form to confirm a driver with.
Returns
OkResult if the driver is successfully confirmed, BadRequestObjectResult if the user is invalid, the trip does not exist, the trip has a driver, the trip has already started, or the bid does not exist, UnauthorizedResult if the user is not a rider

◆ DeleteRiderTrip()

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

Delete a trip.

Parameters
tripIdThe ID of the trip to delete. Rider must have create this trip.
Returns
OkResult if the trip is successfully deleted, BadRequestObjectResult if the user is invalid, the trip does not exist, the trip has a driver, or the trip has already started, UnauthorizedResult if the user is not a rider

◆ Get()

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

Get the basic info of the current rider.

Returns
OkObjectResult with the rider's basic info, BadRequestObjectResult if the user is invalid, UnauthorizedResult if the user is not a rider

◆ GetDashboard()

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

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

Returns
OkObjectResult with the rider's dashboard, BadRequestObjectResult if the user is invalid, UnauthorizedResult if the user is not a rider

◆ ModifyAccountDetails()

async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.ModifyAccountDetails ( [FromBody] RiderUpdate riderUpdate)

Modify account details, including password.

Parameters
riderUpdateThe update form.
Returns
OkResult if the account details are successfully updated, BadRequestObjectResult if the user is invalid or there is an error with updating the password, UnauthorizedResult if the user is not a rider

◆ PostRiderTrip()

async Task< IActionResult > hagglehaul.Server.Controllers.RiderController.PostRiderTrip ( [FromBody] CreateTrip tripDetails)

Create a new trip.

Parameters
tripDetailsThe form with the requested trip's details.
Returns
OkResult if the trip is successfully created, BadRequestObjectResult if the user is invalid, the party size is invalid, or the start time is in the past, UnauthorizedResult if the user is not a rider

◆ RateDriver()

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

Rate a driver.

Parameters
giveRatingThe form to rate a user.
Returns
OkResult if the driver is successfully rated, BadRequestObjectResult if the user is invalid, the trip does not exist, the trip has no driver, the trip has not been taken yet, or the driver has already been rated, UnauthorizedResult if the user is not a rider

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