This API will allow customers to view available services, select desired services, and submit booking requests. Upon successful submission, the API will trigger email confirmations to the customer and the assigned runner.
Requirements
Implement a POST endpoint /api/bookings to handle customer booking requests.
Description
This API will allow customers to view available services, select desired services, and submit booking requests. Upon successful submission, the API will trigger email confirmations to the customer and the assigned runner.
Requirements
Implement a POST endpoint /api/bookings to handle customer booking requests.
request:
public class BookingRequestDto { public string CustomerId { get; set; } public string RunnerId { get; set; } public string ServiceType { get; set; } public DateTime SelectedDateTime { get; set; } }
[HttpPost("/api/bookings")] public IActionResult BookService([FromBody] BookingRequestDto bookingRequest) { // Publish booking request to RabbitMQ RabbitMqService.PublishBookingRequest(bookingRequest);
}
public class RabbitMqService { private readonly IModel _channel;
}
public class BookingRequestConsumer : BackgroundService { private readonly RabbitMqService _rabbitMqService;
}