public async Task <IActionResult> Post(string email, int roleType)
        {
            bool emailExist = await userRepository.DoesEmailExist(email);

            if (!emailExist)
            {
                Mdls.Invite invite = new Mdls.Invite
                {
                    Email = email,
                    ParticipationRoleType = (Mdls.RoleType)roleType
                };

                string inviteId = await inviteRepository.Add(invite);

                await emailProvider.SendEmailAsHtml(email, EmailTemplate.getInviteTemplate(inviteId));
            }
            else
            {
                return(BadRequest(new DTOs.Error(ErrorResponses.NVITE_USER_EXIST)));
            }

            return(Ok(new ActionResponse {
                State = true
            }));
        }
        public async Task <IActionResult> Complete([FromBody] DTOs.InviteCompletion completionRequest)
        {
            ActionResponse actionResponse = new ActionResponse()
            {
                State = false
            };

            //check if inviation is active
            Mdls.Invite invite = await inviteRepository.Get(completionRequest.InvitationId);

            if (invite.InviteStatus == Mdls.InviteStatus.Pending)
            {
                string encryptedPassword = encryptionProvider.Encrypt(completionRequest.User.Password);
                string encryptionKey     = encryptionProvider.EncryiptionKey;

                completionRequest.User.Password      = encryptedPassword;
                completionRequest.User.EncryptionKey = encryptionKey;



                string userId = await userRepository.Add(completionRequest.User);

                #region Image
                if (completionRequest.User.Image != null && completionRequest.User.Image.StartsWith("data:image/png;base64,"))
                {
                    string path = await amazonS3ImageProvider.Add($"users/{userId}/profile.png", completionRequest.User.Image);

                    bool saved = await userRepository.UpdateImage(userId, path);
                }
                #endregion
                if (!String.IsNullOrEmpty(userId))
                {
                    bool updated = await inviteRepository.CompleteInvite(completionRequest.InvitationId);

                    actionResponse.State = updated;
                }
            }
            else if (invite.InviteStatus == Mdls.InviteStatus.Completed)
            {
                return(BadRequest(new DTOs.Error(ErrorResponses.INVITE_COMPLETED_EXIST)));
            }

            return(Ok(actionResponse));
        }
        public async Task <Mdls.Invite> Get(string id)
        {
            Mdls.Invite invite = await inviteRepository.Get(id);

            return(invite);
        }