package com.codenetworkz.blog.services;

import com.codenetworkz.blog.exceptions.InternalServerException;
import com.codenetworkz.blog.exceptions.UserNotFoundException;
import com.codenetworkz.blog.models.User;

import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartFile;

import java.util.Optional;

public interface UserService {

    Optional<User> findByUsername(String email, String active) throws UserNotFoundException, InternalServerException;
    public Optional<User> findByEmail(String email, String active) throws UserNotFoundException, InternalServerException;
    public Optional<User> findByUserById(Long userId, String active) throws UserNotFoundException, InternalServerException;
    public boolean checkIfUserExists(String username, String email) throws InternalServerException, InternalServerException;
    public Page<User> findAll(int  pageNo, int pageSize, String filterOn1,  String filterOn2) throws InternalServerException;


    Optional<User> save(String fristName, String lastName, String email, String password) throws UserNotFoundException, InternalServerException ;
    public Optional<User> update(Long id, String fristName, String lastName, String username, String bio, MultipartFile profilePicture) throws UserNotFoundException, InternalServerException ;

    Optional<User> delete(String email) throws InternalServerException, UserNotFoundException, UserNotFoundException;
    Optional<User> deActive(String username) throws UserNotFoundException, InternalServerException;
    Optional<User> setUserRole(String username);
    Optional<User> active(String email) throws UserNotFoundException, InternalServerException;
    Optional<User> forgotPassword(String email) throws UserNotFoundException, InternalServerException;
    Optional<User> resetPassword(String email, String password) throws UserNotFoundException, InternalServerException;
}
