Пример #1
0
        /// <summary>
        /// Starts a revision session from a card box set
        /// </summary>
        /// <param name="input">Id of a card box set from which to start a revision session</param>
        /// <param name="connection"></param>
        /// <param name="commandsHandler"></param>
        /// <returns></returns>
        public async Task <RevisionSessionType> StartRevisionSession(StartRevisionSessionInput input,
                                                                     [Service] IDbConnection connection, [Service] RevisionSessionsCommandsHandler commandsHandler)
        {
            await commandsHandler.Handle(input, TestUserGuid);

            // TODO: currently there is no check that there is only one active revision at the moment.
            return(await GetRevisionSessionModelBySetId(connection, input.CardBoxSetId));
        }
Пример #2
0
        /// <summary>
        /// Completed a revision session with the given id
        /// </summary>
        /// <param name="input">An input object for completing revision sessions</param>
        /// <param name="connection"></param>
        /// <param name="commandsHandler"></param>
        /// <returns></returns>
        public async Task <RevisionSessionType> CompleteRevisionSession(CompleteRevisionSessionInput input,
                                                                        [Service] IDbConnection connection, [Service] RevisionSessionsCommandsHandler commandsHandler)
        {
            await commandsHandler.Handle(input, TestUserGuid);

            return(await GetRevisionSessionModelById(connection, input.RevisionSessionId));
        }