private Customer( CustomerId id, string email, string password, string firstName, string lastName, DateTime registrationDate, ICustomerChecker customerChecker ) { CheckRule(new CustomerEmailMustBeUniqueRule(email, customerChecker)); Id = id; _email = email; _password = password; _firstName = firstName; _lastName = lastName; _registrationDate = registrationDate; AddDomainEvent(new CustomerCreatedDomainEvent( id, email, password, firstName, lastName, registrationDate )); }
private CustomerRegistration( CustomerRegistrationId id, string email, string password, string firstName, string lastName, ICustomerChecker customerChecker ) { CheckRule(new CustomerEmailMustBeUniqueRule(email, customerChecker)); Id = id; _email = email; _password = password; _firstName = firstName; _lastName = lastName; _status = CustomerRegistrationStatus.WaitingForConfirmation; _registrationDate = SystemClock.Now; AddDomainEvent(new NewCustomerRegisteredDomainEvent( Id, _email, _password, _firstName, _lastName, _registrationDate )); }
public CustomerRegistrationConfirmedHandler( ICustomerRegistrationRepository customerRegistrationRepository, ICustomerRepository customerRepository, ICustomerChecker customerChecker ) { _customerRegistrationRepository = customerRegistrationRepository; _customerRepository = customerRepository; _customerChecker = customerChecker; }
public RegisterNewCustomerCommandHandler( ICustomerRegistrationRepository customerRegistrationRepository, ICustomerChecker customerChecker, IPasswordHasher passwordHasher ) { _customerRegistrationRepository = customerRegistrationRepository; _customerChecker = customerChecker; _passwordHasher = passwordHasher; }
public CreateCustomerCommandHandler( ICustomerRepository customerRepository, ICustomerChecker customerChecker, IPasswordHasher passwordHasher ) { _customerRepository = customerRepository; _customerChecker = customerChecker; _passwordHasher = passwordHasher; }
public static CustomerRegistration RegisterNewCustomer( CustomerRegistrationId id, string email, string password, string firstName, string lastName, ICustomerChecker customerChecker ) { return(new CustomerRegistration(id, email, password, firstName, lastName, customerChecker)); }
public static Customer CreateNew( CustomerId id, string email, string password, string firstName, string lastName, DateTime registrationDate, ICustomerChecker customerChecker ) { return(new Customer(id, email, password, firstName, lastName, registrationDate, customerChecker)); }
public Customer CreateCustomer(ICustomerChecker customerChecker) { return(Customer.CreateNew( new CustomerId(Id.Value), _email, _password, _firstName, _lastName, _registrationDate, customerChecker )); }
public CustomerEmailMustBeUniqueRule(string email, ICustomerChecker customerChecker) { _email = email; _customerChecker = customerChecker; }