package com.izouma.dingdong.repo;

import com.izouma.dingdong.domain.MoneyRecord;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.lang.Nullable;

import java.util.List;

public interface MoneyRecordRepo extends JpaRepository<MoneyRecord, Long>, JpaSpecificationExecutor<MoneyRecord> {
    List<MoneyRecord> findAllByUserId(Long userId);

    Page<MoneyRecord> findAllByUserId(Long userId, @Nullable Specification<MoneyRecord> spec, Pageable pageable);
}