package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class CommissionRecordService {

    private CommissionRecordRepo commissionRecordRepo;

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