package dev.fyloz.plannervio.core.repository

import dev.fyloz.plannervio.core.model.Board

/**
 * A data access object for boards.
 */
interface IBoardRepository {

    /**
     * Verify if a given board exists in the repository.
     *
     * @param board The board
     * @return If the board exists or not
     */
    fun exists(board: Board): Boolean

    /**
     * Find all boards in the repository.
     *
     * @return An immutable list containing all found boards
     */
    fun findAll(): List<Board>

    /**
     * Find the board with the given identifier in the repository.
     *
     * @param id The identifier
     * @return The board found or null
     */
    fun findById(id: Long): Board?

    /**
     * Persist a given board in the repository.
     *
     * @param board The board
     * @return The persisted board
     */
    fun save(board: Board)

    /**
     * Delete a given board from the repository.
     */
    fun delete(board: Board)

}
