Created
May 4, 2020 14:23
-
-
Save AntonStoeckl/04889794364de8f85c3d914452f287f6 to your computer and use it in GitHub Desktop.
Example for my iDDD with Go blog article series at https://medium.com/@TonyBologni
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package domain | |
import ( | |
"github.com/AntonStoeckl/go-iddd/service/customeraccounts/application/domain/customer/value" | |
) | |
type RegisterCustomer struct { | |
customerID value.CustomerID | |
emailAddress value.EmailAddress | |
confirmationHash value.ConfirmationHash | |
personName value.PersonName | |
} | |
func BuildRegisterCustomer( | |
customerID value.CustomerID, | |
emailAddress value.EmailAddress, | |
confirmationHash value.ConfirmationHash, | |
personName value.PersonName, | |
) RegisterCustomer { | |
register := RegisterCustomer{ | |
customerID: customerID, | |
emailAddress: emailAddress, | |
confirmationHash: confirmationHash, | |
personName: personName, | |
} | |
return register | |
} | |
func (command RegisterCustomer) CustomerID() value.CustomerID { | |
return command.customerID | |
} | |
func (command RegisterCustomer) EmailAddress() value.EmailAddress { | |
return command.emailAddress | |
} | |
func (command RegisterCustomer) ConfirmationHash() value.ConfirmationHash { | |
return command.confirmationHash | |
} | |
func (command RegisterCustomer) PersonName() value.PersonName { | |
return command.personName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment