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

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

import org.springframework.stereotype.Repository;

import com.ecep.contract.ds.MyRepository;
import com.ecep.contract.model.Company;
import com.ecep.contract.model.CompanyContact;

@Repository
public interface CompanyContactRepository extends MyRepository<CompanyContact, Integer> {

    Optional<CompanyContact> findFirstByCompany(Company company);

    List<CompanyContact> findAllByCompany(Company company);

    List<CompanyContact> findAllByCompanyAndName(Company company, String name);

    int deleteAllByCompany(Company company);
}
