package service

import (
	"bitbucket.org/nemt/nemt-portal-api/domain/entity"
)

// userService is the domain service for user operations
type profileService struct {
	svc *Service
}

// newUserService returns an instance of userService
func newProfileService(svc *Service) *profileService {
	return &profileService{
		svc: svc,
	}
}

func (s *profileService) GetAll() ([]entity.Profile, error) {
	return s.svc.db.Profile().GetAll()
}

func (s *profileService) GetByKey(key string) (entity.Profile, error) {
	return s.svc.db.Profile().GetByKey(key)
}

func (s *profileService) GetVisibles(visible bool) ([]entity.Profile, error) {
	return s.svc.db.Profile().GetVisibles(visible)
}

func (s *profileService) GetByOrganizationType(organizationTypeID int64) ([]entity.Profile, error) {
	return s.svc.db.Profile().GetByOrganizationType(organizationTypeID)
}
