package com.izouma.nineth.service;

import com.izouma.nineth.domain.PrivilegeOption;
import com.izouma.nineth.dto.PageQuery;
import com.izouma.nineth.repo.PrivilegeOptionRepo;
import com.izouma.nineth.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class PrivilegeOptionService {

    private PrivilegeOptionRepo privilegeOptionRepo;

    public Page<PrivilegeOption> all(PageQuery pageQuery) {
        return privilegeOptionRepo.findAll(JpaUtils.toSpecification(pageQuery, PrivilegeOption.class), JpaUtils.toPageRequest(pageQuery));
    }
}
