package com.nisum.epe.demo.service;

import com.nisum.epe.demo.dao.OfferRepo;
import com.nisum.epe.demo.model.Offer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class OfferService {

    @Autowired
    private OfferRepo offerRepo;

    public List<Offer> getAllOffers() {
        List<Offer> offers = new ArrayList<>();
        offerRepo.findAll().forEach(t -> offers.add(t));
        return offers;
    }
}
