package tutorial.core.services.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tutorial.core.models.entities.ActiveIngredientRecomendation;
import tutorial.core.repositories.ActiveIngredientRecomendationRepo;
import tutorial.core.services.ActiveIngredientRecomendationService;


/**
 * 
 * @author Xavier
 */
@Service
@Transactional
public class ActiveIngredientRecomendationServiceImpl implements ActiveIngredientRecomendationService {

    @Autowired
    private ActiveIngredientRecomendationRepo recomendationRepo;

    @Override
    public ActiveIngredientRecomendation findActiveIngredientRecomendation(Long id) {
        return recomendationRepo.findActiveIngredientRecomendation(id);
    }

    @Override
    public ActiveIngredientRecomendation deleteActiveIngredientRecomendation(Long id) {
        return recomendationRepo.deleteActiveIngredientRecomendation(id);
    }

    @Override
    public ActiveIngredientRecomendation updateActiveIngredientRecomendation(Long id, ActiveIngredientRecomendation data) {
        return recomendationRepo.updateActiveIngredientRecomendation(id, data);
    }

    @Override
    public void deleteAllRecomendations() {
        recomendationRepo.deleteAllRecomendations();
    }
}
