package pedidos.pedidos.core.pedidos;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
    
@Service
public class PedidoService {
    
    @Autowired
    PedidoRepository repository;
    
    public Pedido save( Pedido entity){
        return repository.save(entity);
    }
    
    public void deleteById(long id){
        repository.deleteById(id);
    }
    
    public Pedido findById(long id){
        return repository.findById(id).orElse(null);
    }
    
    public List<Pedido> findAll(){
        return repository.findAll();
    }
}