public virtual CustomerAction InsertCustomerActionModel(CustomerActionModel model)
        {
            var customeraction = model.ToEntity();

            _customerActionService.InsertCustomerAction(customeraction);
            _customerActivityService.InsertActivity("AddNewCustomerAction", customeraction.Id, _localizationService.GetResource("ActivityLog.AddNewCustomerAction"), customeraction.Name);
            return(customeraction);
        }
        public virtual async Task <CustomerAction> InsertCustomerActionModel(CustomerActionModel model)
        {
            var customeraction = model.ToEntity(_dateTimeHelper);
            await _customerActionService.InsertCustomerAction(customeraction);

            await _customerActivityService.InsertActivity("AddNewCustomerAction", customeraction.Id, _localizationService.GetResource("ActivityLog.AddNewCustomerAction"), customeraction.Name);

            return(customeraction);
        }
        public async Task InsertCustomerActionTest()
        {
            var customerAction = new CustomerAction()
            {
                Active           = true,
                StartDateTimeUtc = DateTime.UtcNow,
                EndDateTimeUtc   = DateTime.UtcNow.AddMonths(1),
                Name             = "Test action",
                ReactionTypeId   = (int)CustomerReactionTypeEnum.AssignToCustomerTag,
                Condition        = CustomerActionConditionEnum.OneOfThem,
            };
            await _customerActionService.InsertCustomerAction(customerAction);

            Assert.IsTrue(!String.IsNullOrEmpty(customerAction.Id));
        }