Last active
September 4, 2021 17:41
-
-
Save percybolmer/e68a769462f26aa2031e17ce6d6d12e0 to your computer and use it in GitHub Desktop.
#ddd-tavern
This file contains hidden or 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 aggregates holds aggregates that combines many entities into a full object | |
package aggregate | |
import ( | |
"github.com/percybolmer/ddd-go/entity" | |
"github.com/percybolmer/ddd-go/valueobject" | |
) | |
// Customer is a aggregate that combines all entities needed to represent a customer | |
type Customer struct { | |
// person is the root entity of a customer | |
// which means the person.ID is the main identifier for this aggregate | |
person *entity.Person | |
// a customer can hold many products | |
products []*entity.Item | |
// a customer can perform many transactions | |
transactions []valueobject.Transaction | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment