package com.ecep.contract.ds.contract.repository;

import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import com.ecep.contract.model.PurchaseBillVoucher;

@Repository
public interface PurchaseBillVoucherRepository extends
        // JDBC interfaces
        CrudRepository<PurchaseBillVoucher, Integer>, PagingAndSortingRepository<PurchaseBillVoucher, Integer>,
        // JPA interfaces
        JpaRepository<PurchaseBillVoucher, Integer>, JpaSpecificationExecutor<PurchaseBillVoucher> {

    Optional<PurchaseBillVoucher> findByCode(String code);

    Optional<PurchaseBillVoucher> findByRefId(Integer refId);

}
