package com.altimetrik.ee.demo.service;

import com.altimetrik.ee.demo.bean.Stocks;
import com.altimetrik.ee.demo.repository.StocksRepository;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StocksService {

  @Autowired
  private StocksRepository repository;

  public List<Stocks> getStocksByIds(List<String> ids) {
    return repository.findByStockQuotes(ids);
  }

  public List<Stocks> getStocks() {
    return repository.findAll();
  }

  public List<Stocks> saveStocks(Iterable<Stocks> stocksIterable) {
    return repository.saveAll(stocksIterable);
  }
}
