Ejemplo n.º 1
0
        private async Task ValidateSendKudosAsync(AddKudosDto kudos)
        {
            _kudosServiceValidator.ValidateSendingToSameUserAsReceiving(kudos.SendingUser.Id, kudos.ReceivingUser.Id);

            _kudosServiceValidator.ValidateUserAvailableKudos(kudos.SendingUser.RemainingKudos, kudos.TotalKudosPointsInLog * kudos.KudosLog.ReceivingUserIds.Count());

            await ValidateAvailableKudosThisMonthAsync(kudos, kudos.TotalKudosPointsInLog);
        }
Ejemplo n.º 2
0
        private void ValidateSendKudos(AddKudosDTO kudosDTO)
        {
            _kudosServiceValidator.ValidateSendingToSameUserAsReceiving(
                kudosDTO.SendingUser.Id,
                kudosDTO.ReceivingUser.Id);

            _kudosServiceValidator.ValidateUserAvailableKudos(
                kudosDTO.SendingUser.RemainingKudos,
                kudosDTO.TotalKudosPointsInLog * kudosDTO.KudosLog.ReceivingUserIds.Count());

            ValidateAvailableKudosThisMonth(kudosDTO, kudosDTO.TotalKudosPointsInLog);
        }