package roleRepo

import (
	"git.ma-al.com/goc_daniel/b2b/app/db"
	"git.ma-al.com/goc_daniel/b2b/app/model"
)

type UIRolesRepo interface {
	Get(id uint) (*model.Role, error)
}

type RolesRepo struct{}

func New() UIRolesRepo {
	return &RolesRepo{}
}

func (r *RolesRepo) Get(id uint) (*model.Role, error) {
	var role model.Role
	err := db.DB.First(&role, id).Error
	return &role, err
}
