diff --git a/pkg/context/shared/domain/aggregate/root.go b/pkg/context/shared/domain/aggregate/root.go index 5f8f892d..02fd9183 100644 --- a/pkg/context/shared/domain/aggregate/root.go +++ b/pkg/context/shared/domain/aggregate/root.go @@ -21,5 +21,7 @@ func (root *AggregateRoot) PullMessages() []*message.Message { } func NewAggregateRoot() *AggregateRoot { - return &AggregateRoot{Messages: []*message.Message{}} + return &AggregateRoot{ + Messages: []*message.Message{}, + } } diff --git a/pkg/context/user/domain/aggregate/user.go b/pkg/context/user/domain/aggregate/user.go index 69b9cef8..c3110f8e 100644 --- a/pkg/context/user/domain/aggregate/user.go +++ b/pkg/context/user/domain/aggregate/user.go @@ -33,22 +33,22 @@ func create(id, email, username, password string, verified bool) *User { verifiedVO := valueObject.NewVerified(verified) return &User{ - aggregateRoot, - idVO, - emailVO, - usernameVO, - passwordVO, - verifiedVO, + AggregateRoot: aggregateRoot, + Id: idVO, + Email: emailVO, + Username: usernameVO, + Password: passwordVO, + Verified: verifiedVO, } } func (user *User) ToPrimitives() *UserPrimitive { return &UserPrimitive{ - user.Id.Value, - user.Email.Value, - user.Username.Value, - user.Password.Value, - user.Verified.Value, + Id: user.Id.Value, + Email: user.Email.Value, + Username: user.Username.Value, + Password: user.Password.Value, + Verified: user.Verified.Value, } } diff --git a/pkg/context/user/infrastructure/persistence/mongo.go b/pkg/context/user/infrastructure/persistence/mongo.go index ae84e0e3..89dc4190 100644 --- a/pkg/context/user/infrastructure/persistence/mongo.go +++ b/pkg/context/user/infrastructure/persistence/mongo.go @@ -122,5 +122,7 @@ func NewUserMongoRepository(mdb *database.MongoDB, collectionName string, hashin }, }) - return &UserCollection{collection, hashing} + return &UserCollection{ + collection: collection, + hashing: hashing} }