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

import java.util.List;
import java.util.Optional;

import com.ecep.contract.ds.MyRepository;
import org.springframework.stereotype.Repository;

import com.ecep.contract.ds.contract.model.Contract;
import com.ecep.contract.ds.customer.model.SalesOrder;

@Repository
public interface SalesOrderRepository extends MyRepository<SalesOrder, Integer> {

    Optional<SalesOrder> findByCode(String code);

    List<SalesOrder> findAllByContract(Contract contract);
    List<SalesOrder> findAllByContractId(Integer contractId);

    List<SalesOrder> findByCodeStartsWith(String code);
}
