package dev.fyloz.plannervio.core.service

import dev.fyloz.plannervio.core.repository.IBoardRepository
import dev.fyloz.plannervio.core.model.Board
import org.kodein.di.DI
import org.kodein.di.instance

/** A service for boards. */
interface IBoardService {
    /** Gets an immutable list containing all boards. */
    fun getBoards(): List<Board>
}

class BoardServiceImpl(di: DI) : IBoardService {
    private val repository: IBoardRepository by di.instance()

    override fun getBoards(): List<Board> {
        return repository.findAll()
    }
}
