public async Task <HttpResponseMessage> Put(string clientId, string subscriptionId, AdminClientSubscriptionUpdateModel adminClientSubscriptionModel)
        {
            var domainSubscription = new DomainAdminClientSubscription
            {
                Id = subscriptionId,
                IsManuallyEnabled = adminClientSubscriptionModel.IsManuallyEnabled,
                State             = adminClientSubscriptionModel.State
            };

            domainSubscription = await _adminClientSubscriptionService.EditSubscriptionAsync(clientId, domainSubscription);

            AdminClientSubscription subscription = _mapper.Map <DomainAdminClientSubscription, AdminClientSubscription>(domainSubscription);

            return(Request.CreateResponse(HttpStatusCode.OK, subscription));
        }
        public async Task <DomainAdminClientSubscription> EditSubscriptionAsync(string clientId, DomainAdminClientSubscription domainSubscription)
        {
            CompanyEntity company = await _companyRepository.GetAsync(clientId);

            if (company == null)
            {
                throw new NotFoundException();
            }

            SubscriptionEntity subscription = company.Subscriptions.FirstOrDefault(s => s.Id == domainSubscription.Id);

            if (subscription == null)
            {
                throw new NotFoundException();
            }

            subscription.State             = (int)domainSubscription.State;
            subscription.IsManuallyEnabled = domainSubscription.IsManuallyEnabled;

            await _companyRepository.UpdateAsync(company);

            return(_mapper.Map <SubscriptionEntity, DomainAdminClientSubscription>(subscription));
        }