public Task Handle(ProposeRebooking message, IMessageHandlerContext context)
    {
        // Find a new route and once you find a good itinerary, publish event

        logger.Info("Received ProposeRebooking command, publishing RebookingWasProposed event");
        return(context.Publish(
                   new RebookingWasProposed(
                       message.BookingReferenceId,
                       message.ReasonForRebooking)));
    }
Esempio n. 2
0
    public Task Handle(ProposeRebooking message, IMessageHandlerContext context)
    {
        // call rules engine to prioritize seating arrangement

        // Find a new better seating arrangement and once you find a good itinerary, publish event

        logger.Info("Received ProposeRebooking command, publishing RebookingWasProposed event");
        return(context.Publish(
                   new RebookingWasProposed(
                       message.BookingReferenceId,
                       message.ReasonForRebooking)));
    }
Esempio n. 3
0
    public async Task Handle(AircraftTypeHasChanged message, IMessageHandlerContext context)
    {
        // Find all the relevant booking references

        // Propose to rebook the flight for each of the bookings found.
        // foreach (affected flight in the list of bookings)
        //{

        // Get the groupings . for each group send a message
        var cmd = new ProposeRebooking(bookingReferenceId: "QAZ123",
                                       customerId: "1",
                                       reasonForRebooking: $"Aircraft type was changed from {message.OldAircraftTypeId} to {message.NewAircraftTypeId} on flight {message.FlightId}");

        logger.Info("Received AircraftTypeHasChanged event, sending ProposeRebooking command");
        await context.SendLocal(cmd).ConfigureAwait(false);

        //}
    }