Skip to content

Instantly share code, notes, and snippets.

@AntonStoeckl
Created May 4, 2020 14:23
Show Gist options
  • Save AntonStoeckl/04889794364de8f85c3d914452f287f6 to your computer and use it in GitHub Desktop.
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
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