package pedidos.pedidos.core.cliente;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

    
@Service
public class ClienteService {
    @Autowired ClienteRepository clienteRepository;

    public Cliente save(Cliente entity){
        return clienteRepository.save(entity);
    }

    public Cliente findById( long id){
        return clienteRepository.findById(id).orElse(new Cliente());
    }

    public void deleteById(long id){
        clienteRepository.deleteById(id);
    }

    public List<Cliente> findAll(){
        return clienteRepository.findAll();
    }
}