Пример #1
0
        public async Task <bool> CheckIn(int meetingId, int userId)
        {
            try
            {
                var meeting = await GetMeeting(meetingId);

                if (meeting == null)
                {
                    throw new ChallengeException("La meeting no existe.");
                }

                var totalDays = (meeting.Date - DateTime.Now).TotalDays;

                // La siguiente validacion la quite prque calculo las cervezas(packs de 6) en base a los checkins
                //if (totalDays > 0)
                //{
                //    throw new ChallengeException("No se puede avisar que se asistió a una meeting que no ha ocurrido.");
                //}

                return(await _meetingRepository.CheckIn(meetingId, userId));
            }
            catch (Exception e)
            {
                throw new ChallengeException(e.Message);
            }
        }