Exemple #1
0
        public ISlackResponseMessage ReplaceKudo(Kudo kudo)
        {
            kudo.Text = kudo.GetKudoMessage(2);

            this.kudoRepository.UpdateText(kudo.Map <Dbo.Kudo>());

            return(SlackResponseHelper.BuildKudoReplacedResponse(kudo));
        }
Exemple #2
0
        public ISlackResponseMessage CreateKudo(Kudo kudo)
        {
            kudo.Text = kudo.GetKudoMessage(2);

            kudoRepository.Create(kudo.Map <Dbo.Kudo>());


            return(SlackResponseHelper.BuildKudoCreatedResponse(kudo));
        }
Exemple #3
0
        public ISlackResponseMessage GetNKudosByUserId(Kudo kudo)
        {
            var numberOfKudos = kudo.CommandText.Split(' ')[1];

            if (numberOfKudos == "*")
            {
                return(this.GetAllUserKudos(kudo.UserId));
            }

            var kudos = this.kudoRepository.GetNByUserId(kudo.UserId, Convert.ToInt32(numberOfKudos)).Select(x => x.Map <Kudo>());

            return(SlackResponseHelper.BuildSlashResponseFromKudoList(kudos));
        }
Exemple #4
0
 public ISlackResponseMessage GetTopUsers(string numberOfUsers)
 {
     return(SlackResponseHelper.BuildDummyResponse());
 }
Exemple #5
0
 public ISlackResponseMessage BuildHelpResponse() => SlackResponseHelper.BuildHelpResponse();
Exemple #6
0
        public ISlackResponseMessage DeleteKudo(int kudoId)
        {
            this.kudoRepository.Delete(kudoId);

            return(SlackResponseHelper.BuildKudoDeletedResponse());
        }
Exemple #7
0
        public ISlackResponseMessage GetAllUserKudos(string userId)
        {
            var kudos = this.kudoRepository.GetAllByUserId(userId).Select(x => x.Map <Kudo>());

            return(SlackResponseHelper.BuildSlashResponseFromKudoList(kudos));
        }