public Task Consume(ConsumeContext <CreateConcertCommand> context)
        {
            CreateConcertCommand command = context.Message;

            Logger.LogInformation($"Processing command Create concert: Maximum number of tickets:{command.MaximumNumberOfTickets}, Place: {command.Place}, Title: {command.Title} - started. ");

            try
            {
                Concert concert = ConcertFactory.Create(command.Place, command.MaximumNumberOfTickets, command.Date, command.Title, ConcertRepository.GetNextId());

                ConcertRepository.Add(concert);

                foreach (var @event in concert.Changes)
                {
                    var publisher = EventHandlerFactory.CreatePublisher(@event);
                    publisher.Publish(@event, context);
                }

                Logger.LogInformation($"Processing command Create concert: Maximum number of tickets:{command.MaximumNumberOfTickets}, Place: {command.Place}, Title: {command.Title} - finished successfully. ");
            }
            catch (IntialTicketsCapacityNotSet ticketsCapacityNotSetException)
            {
                Logger.LogError($"{ticketsCapacityNotSetException.Message}. Can not execute command Create concert: Maximum number of tickets:{command.MaximumNumberOfTickets}, Place: {command.Place}, Title: {command.Title}.Command rejected. ");
            }
            return(Task.CompletedTask);
        }
        public Task Consume(ConsumeContext <BuyConcertTicketsCommand> context)
        {
            BuyConcertTicketsCommand command = context.Message;

            Logger.LogInformation($"Processing command Buy concert tickets: Tickets to buy:{command.NumberOfTicketsToBuy}, User id: {command.UserId}, Concert id: {command.ConcertId} - started. ");

            try
            {
                /// kod unutar try bloka bi trebao da ide u poseban hendler
                Concert concert;

                if (!ConcertRepository.TryFindBy(command.ConcertId, out concert))
                {
                    return(Task.CompletedTask);
                }

                concert.BuyTickets(command.NumberOfTicketsToBuy, command.UserId);

                ConcertRepository.Save(concert);

                foreach (var @event in concert.Changes)
                {
                    var handler = EventHandlerFactory.CreatePublisher(@event);
                    handler.Publish(@event, context);
                }

                Logger.LogInformation($"Processing command Buy concert tickets: Tickets to buy:{command.NumberOfTicketsToBuy}, User id: {command.UserId}, Concert id: {command.ConcertId} - finished succesfully. ");
            } catch (MaximumNumberOfTicketsReached ticketsReachedException)
            {
                Logger.LogError($"{ticketsReachedException.Message}. Can not execute command Buy concert tickets: Tickets to buy:{command.NumberOfTicketsToBuy}, User id: {command.UserId}, Concert id: {command.ConcertId}.Command rejected. ");
            }
            return(Task.CompletedTask);
        }