package vn.azteam.tpf.service;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import vn.azteam.tpf.service.dto.CasbinDTO;

import java.util.Optional;

/**
 * Service Interface for managing Casbin.
 */
public interface CasbinService {

    /**
     * Save a casbin.
     *
     * @param casbinDTO the entity to save
     * @return the persisted entity
     */
    CasbinDTO save(CasbinDTO casbinDTO);

    /**
     * Get all the casbin.
     *
     * @param pageable the pagination information
     * @return the list of entities
     */
    Page<CasbinDTO> findAll(Pageable pageable);


    /**
     * Get the "id" casbin.
     *
     * @param id the id of the entity
     * @return the entity
     */
    Optional<CasbinDTO> findOne(Long id);

    /**
     * Delete the "id" casbin.
     *
     * @param id the id of the entity
     */
    void delete(Long id);

    /**
     * Delete all the casbin with roleId.
     *
     * @param id the id of the role
     */
    void deleteByRoleId(Long id);

    /**
     * Search for the casbin corresponding to the query.
     *
     * @param query the query of the search
     *
     * @param pageable the pagination information
     * @return the list of entities
     */
    Page<CasbinDTO> search(String query, Pageable pageable);
}

