public CommandStatus Handle(CreateTournamentCommand command)
        {
            var tournament  = Initialize_tournament_datas(command);
            var competitors = Initialize_tournament_competitors(command.competitorsIds);

            tournament.Competitors = competitors.ToList();

            var first_round = _director.New_round(tournament.Competitors, tournament.Options, 0);

            tournament.Rounds.Add(first_round);
            _tournament_repo.Save(tournament);

            return(new Success());
        }
        public Output Process(IMessage input, IMessageContext model)
        {
            var cmd = input as CreateRoundCommand;
            var ctx_model = model as CreateRoundCommandContextModel;

            var tournament_director = new TournamentDirector();
            var round = tournament_director.New_round(Map(ctx_model));

            var round_id = _id_provider.Get_new_id().ToString();

            var events = new List<Event>();
            events.Add(Map(round, round_id, cmd.TournamentId, ctx_model.Round_count));
            events.AddRange(Map(round.Matches, ctx_model, round_id, cmd.TournamentId));
            events.AddRange(Map(round.Walkover, cmd.TournamentId));
            events.AddRange(Map(round.Matches, cmd.TournamentId));

            return new CommandOutput(new Success(), events.ToArray());
        }