package com.izouma.uwip.service;

import com.izouma.uwip.domain.Fee;
import com.izouma.uwip.dto.PageQuery;
import com.izouma.uwip.repo.FeeRepo;
import com.izouma.uwip.utils.JpaUtils;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class FeeService {

    private FeeRepo feeRepo;

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