Skip to content

Instantly share code, notes, and snippets.

@godrm
Created May 2, 2019 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save godrm/c8ae04c60e64598744da946f46b64ae8 to your computer and use it in GitHub Desktop.
Save godrm/c8ae04c60e64598744da946f46b64ae8 to your computer and use it in GitHub Desktop.
class Customer :
Entity,
AggregateProtocol
{
private (set) var id : UUID
private (set) var email : String
private var orders : Array<Order>
init?(email : String, name : String, uniqueChecker : CustomerUniqueCheckerDelegate) {
id = UUID.init()
self.email = email
self.orders = Array<Order>()
super.init(name: name)
guard uniqueChecker.isUnique(self) else { return nil }
}
//...중간생략
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment