package com.izouma.nineth.service;

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

@Service
@AllArgsConstructor
public class TradingAccountService {

    private TradingAccountRepo tradingAccountRepo;

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