package service import ( "github.com/CesarSSH/cqrs-api-go/internal/command" "github.com/CesarSSH/cqrs-api-go/internal/models" "github.com/CesarSSH/cqrs-api-go/internal/repository" ) type UserCommandService struct { userRepository repository.UserRepository } func NewUserCommandService(repo repository.UserRepository) *UserCommandService { return &UserCommandService{ userRepository: repo, } } func (s *UserCommandService) CreateUser(cmd *command.CreateUserCommand) error { user := &models.User{ FirstName: cmd.FirstName, LastName: cmd.LastName, } return s.userRepository.Create(user) }