package com.mzh.library.service;

import com.mzh.library.entity.AuthenticatedUser;
import com.mzh.library.entity.Book;
import com.mzh.library.entity.BookCategory;
import com.mzh.library.entity.BookSearchCriteria;

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

public interface BookService {
    ServiceResult<List<BookCategory>> listCategories();

    ServiceResult<Optional<BookCategory>> findCategory(long id);

    ServiceResult<Long> createCategory(AuthenticatedUser actor, BookCategory category);

    ServiceResult<Void> updateCategory(AuthenticatedUser actor, BookCategory category);

    ServiceResult<Void> deleteCategory(AuthenticatedUser actor, long id);

    ServiceResult<List<Book>> searchBooks(BookSearchCriteria criteria);

    ServiceResult<Optional<Book>> findBook(long id);

    ServiceResult<Long> createBook(AuthenticatedUser actor, Book book);

    ServiceResult<Void> updateBook(AuthenticatedUser actor, Book book);

    ServiceResult<Void> deleteBook(AuthenticatedUser actor, long id);
}
