Esempio n. 1
0
        public bool SaveCustomerResultAfterEvaluation(MedicareCustomerResultVerifiedViewModel model)
        {
            _logger.Info("Method called : SaveCustomerResultAfterEvaluation for CustmerId: " + model.CustomerId + " EventId: " + model.EventId);
            var orgRoleUser = _organizationRoleUserRepository.GetByUserNameAndRoleAlias(model.UserName, model.RoleAlias);

            if (orgRoleUser == null)
            {
                _logger.Error(string.Format("No OrganizationRoleUser found for username: {0}, roleAlias: {1}, CustomerId: {2}, EventId: {3}", model.UserName, model.RoleAlias, model.CustomerId, model.EventId));
                _logger.Info("Method completd : SaveCustomerResultAfterEvaluation for CustmerId: " + model.CustomerId + " EventId: " + model.EventId);
                return(false);
            }

            if (orgRoleUser.RoleId != (long)Roles.NursePractitioner)
            {
                _logger.Error(string.Format("Provided role is not NursePractitioner. username: {0}, roleAlias: {1},  CustomerId: {2}, EventId: {3}", model.UserName, model.RoleAlias, model.CustomerId, model.EventId));
                _logger.Info("Method completd : SaveCustomerResultAfterEvaluation for CustmerId: " + model.CustomerId + " EventId: " + model.EventId);
                return(false);
            }

            _logger.Info(string.Format("EventCustomerResult NpSigned saved successfully for CustomerId: {0}, EventId: {1}", model.CustomerId, model.EventId));

            var isSaved = _testResultService.SaveCustomerResultAfterNpReview(model, orgRoleUser);

            _logger.Info("Method completed : SaveCustomerResultAfterEvaluation for CustmerId: " + model.CustomerId + " EventId: " + model.EventId);
            return(isSaved);
        }
Esempio n. 2
0
        public void SaveCustomerResultAfterEvaluation_Tester()
        {
            var model = new MedicareCustomerResultVerifiedViewModel
            {
                EventId    = ValidEventId,
                CustomerId = ValidCustomerId,
                RoleAlias  = "NursePractitioner",
                UserName   = "******"
            };

            var orgRoleUser = _organizationRoleUserRepository.GetByUserNameAndRoleAlias(model.UserName, model.RoleAlias);

            if (orgRoleUser == null)
            {
                Assert.IsNull(orgRoleUser);
            }
            else
            {
                Assert.IsNotNull(orgRoleUser);
                _testResultService.SaveCustomerResultAfterNpReview(model, orgRoleUser);
            }
        }