public async Task <IActionResult> GivePromoCodesToCustomersWithPreferenceAsync(GivePromoCodeRequest request)
        {
            if (request is null)
            {
                return(BadRequest("Request is empty"));
            }

            var customers = await _customerRepository.GetAllAsync(c => c.CustomerPreferences.Any(p => p.Preference.Name == request.Preference));

            var employee = await _employeeRepository.GetEmployeeAsync(e => (e.FirstName + " " + e.LastName) == request.PartnerName);

            if (customers.Count > 0)
            {
                var promocodes = new List <PromoCode>();
                foreach (var customer in customers)
                {
                    var promoCode = _mapper.Map <PromoCode>(request);
                    promoCode.Id               = Guid.NewGuid();
                    promoCode.CustomerId       = customer.Id;
                    promoCode.PreferenceId     = customer.CustomerPreferences.FirstOrDefault().PreferenceId;
                    promoCode.PartnerManagerId = employee.Id;
                    promocodes.Add(promoCode);
                }

                await _promoCodeRepository.CreateBulkAsync(promocodes);
            }
            else
            {
                var promoCode = _mapper.Map <PromoCode>(request);
                await _promoCodeRepository.CreateAsync(promoCode);
            }

            return(Ok());
        }