Skip to content

Instantly share code, notes, and snippets.

@j5ik2o
Last active August 29, 2015 14:00
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 j5ik2o/11168732 to your computer and use it in GitHub Desktop.
Save j5ik2o/11168732 to your computer and use it in GitHub Desktop.
case class Cart
(id: CartId,
status: StatusType.Value,
customerId: CustomerId,
cartItems: List[CartItem],
version: Option[Long]) extends Entity[CartId] {
def customer(implicit cr: CustomerRepository,
ctx: EntityIOContext): Try[Customer] =
cr.resolveById(customerId)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment