示例#1
0
        /// <summary>
        /// Creates the customer.
        /// </summary>
        /// <param name="cmd">The command.</param>
        /// <returns></returns>
        private Customer ConvertToCustomer(CustomerSignupCommand cmd, SecurityUser user)
        {
            Customer customer = new Customer();

            customer.Name      = cmd.EmailAddress.ToLowerInvariant();
            customer.OriginID  = ConvertToOriginId(cmd.CommandOriginator);
            customer.Vip       = CustomerQueries.IsVip(cmd.EmailAddress.ToLowerInvariant()) ?? false; //TODO: look again in this flow, how we get vip
            customer.Id        = user.UserId;
            customer.RefNumber = RefNumGenerator.GenerateRefNumber();

            customer.Status               = CustomerStatus.Registered.ToString();
            customer.WizardStep           = (int)WizardStepType.SignUp;
            customer.CollectionStatus     = (int)CollectionStatusNames.Enabled;
            customer.TrustPilotStatusID   = (int)TrustPilotStauses.Neither;
            customer.GreetingMailSentDate = DateTime.UtcNow;
            customer.BrokerID             = null;
            return(customer);
        }