package io.gmss.fiscad.interfaces.user;

import io.gmss.fiscad.entities.user.Role;
import io.gmss.fiscad.enums.UserRole;
import io.gmss.fiscad.exceptions.BadRequestException;
import io.gmss.fiscad.exceptions.NotFoundException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Optional;

public interface RoleService {

    Role createRole(Role role) throws BadRequestException;

    Role updateRole(Long id, Role role) throws NotFoundException;

    void deleteRole(Long id) throws NotFoundException;

    Page<Role> getRoleList(Pageable pageable);

    List<Role> getRoleList();

    Optional<Role> getRoleById(Long id);

    Optional<Role> getRoleByRoleName(UserRole userRole);

    boolean roleExistByRoleName(UserRole userRole);

    Role retrieveRoleByRoleName(UserRole userRole);

}
