Пример #1
0
        private async Task <BookingId> SelectJourney()
        {
            var journeys              = new JourneysBuilder().BuildJourneys();
            var bookingId             = BookingId.New;
            var selectJourneysCommand = new Commands.Journey.SelectJourneysCommand(bookingId, journeys);

            //Act
            await CommandBus.PublishAsync(selectJourneysCommand, CancellationToken.None);

            return(bookingId);
        }
        public async Task <JourneysSelectedResource> SelectJourneys(SelectJourneysCommand selectJourneysCommand)
        {
            //Will integrate journey availability micro-service before select journey, passenger query journey availability micro-service in UI
            //Get journey from journey availability micro-service
            var journeys  = new JourneysBuilder().BuildJourneys();
            var bookingId = BookingId.New;

            var command = new Commands.Journey.SelectJourneysCommand(bookingId, journeys);
            await _commandBus.PublishAsync(command, CancellationToken.None);

            return(new JourneysSelectedResource(Url, bookingId.Value));
        }