package com.codenetworkz.blog.services;

import com.codenetworkz.blog.dtos.TagDto;
import com.codenetworkz.blog.exceptions.InternalServerException;
import com.codenetworkz.blog.exceptions.ResourceNotAvailable;
import com.codenetworkz.blog.models.Tag;
import org.springframework.data.domain.Page;

import java.util.List;
import java.util.Optional;

public interface TagService {

    Optional<TagDto> save(String tagName, String description) throws InternalServerException, ResourceNotAvailable;
    Optional<TagDto> update(String slug, String tagName , String description) throws ResourceNotAvailable, InternalServerException;
    Optional<TagDto> delete(String slug) throws InternalServerException, ResourceNotAvailable;
    Optional<Tag> findByTagSlug(String slug) throws InternalServerException, ResourceNotAvailable; //throws TagNotFoundException;
    public List<TagDto> findAll() throws InternalServerException;
    public Page<TagDto> findAll(Integer pageNo, Integer PageSize) throws InternalServerException;
    public List<TagDto> findByTagIds(List<Long> tagIds) throws InternalServerException, ResourceNotAvailable;
    Optional<TagDto> changeActivateStatus(String slug) throws InternalServerException, ResourceNotAvailable;
    Optional<TagDto> changeApprovalStatus(String slug) throws InternalServerException, ResourceNotAvailable;

    public Page<TagDto> getTagsWithPagination(int page, int size) throws InternalServerException;
}
