package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class UserCouponService {

    private UserCouponRepo userCouponRepo;

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