Esempio n. 1
0
        public bool IsTestPurchased(long eventId, long customerId, long testId)
        {
            var eventTests      = _eventCustomerPackageTestDetailService.GetTestsPurchasedByCustomer(eventId, customerId);
            var isTestPurchased = eventTests.Any(et => et.Id == testId);

            return(isTestPurchased);
        }
Esempio n. 2
0
        public BloodworksLabelViewModel GetBloodworksLabelForCustomer(long eventId, long customerId)
        {
            var eventData = _eventRepository.GetById(eventId);
            var customer  = _customerRepository.GetCustomer(customerId);

            var tests = _eventCustomerPackageTestDetailService.GetTestsPurchasedByCustomer(eventId, customerId);

            return(GetBloodworksLabelForCustomer(eventData, customer, tests));
        }
Esempio n. 3
0
        public KynNotificationViewModel IsApplicableForNotification(EventCustomer eventCustomer)
        {
            if (!eventCustomer.AppointmentId.HasValue)
            {
                return(null);
            }

            var isKynIntegrationEnabled = _eventPodRepository.IsKynIntegrationEnabled(eventCustomer.EventId);

            if (!isKynIntegrationEnabled)
            {
                return(null);
            }

            var tests = _eventCustomerPackageTestDetailService.GetTestsPurchasedByCustomer(eventCustomer.EventId, eventCustomer.CustomerId);
            var isKynTestPurchased = tests != null && tests.Any(t => t.Id == (long)TestType.Kyn);

            if (!isKynTestPurchased)
            {
                return(null);
            }

            var customer = _customerRepository.GetCustomer(eventCustomer.CustomerId);

            var isDemographicInfoFilled = CheckDemographicInfo(customer);

            var isHafFilled = _kynHealthAssessmentHelper.IsKynHafFilled(eventCustomer.EventId, eventCustomer.CustomerId);

            if (isDemographicInfoFilled && isHafFilled)
            {
                return(null);
            }

            var eventHostViewData = _eventService.GetById(eventCustomer.EventId);
            var appointment       = _appointmentRepository.GetById(eventCustomer.AppointmentId.Value);

            return(_notificationModelsFactory.GetKynNotificationViewModel(customer, eventHostViewData, appointment, isDemographicInfoFilled, isHafFilled));
        }
        public bool IsTestPurchased(long eventId, long customerId, long[] testId)
        {
            var tests = _eventCustomerPackageTestDetailService.GetTestsPurchasedByCustomer(eventId, customerId);

            return(tests != null && tests.Any(t => testId.Contains(t.Id)));
        }