package com.izouma.uwip.service;

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

@Service
@AllArgsConstructor
public class PartnerService {

    private PartnerRepo partnerRepo;

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