package de.htwsaar.webshop.service;

import de.htwsaar.webshop.model.ArticleModel;
import de.htwsaar.webshop.repository.entities.Article;

import java.util.List;
import java.util.UUID;

@SuppressWarnings("unused")
public interface ArticleService {
    List<Article> findAll();

    Article findByUUID(UUID uuid);

    Article findByTitle(String title);

    Article findById(Long articleId);

    void delete(Long id);

    void delete(UUID uuid);

    Article save(Article article);

    double getRating(Long id);

    double getRating(UUID uuid);

    ArticleModel from(Article article);

    /**
     * @param articles Articles to Map
     * @return an <b>unmodifiable</b> {@link List} of {@link ArticleModel}s
     */
    List<ArticleModel> from(List<Article> articles);
}
