package de.kif.common

import de.kif.common.model.Model
import de.westermann.kobserve.event.EventHandler


interface Repository<T : Model> {

    suspend fun get(id: Long): T?

    suspend fun create(model: T): Long

    suspend fun update(model: T)

    suspend fun delete(id: Long)

    suspend fun all(): List<T>

    val onCreate: EventHandler<Long>
    val onUpdate: EventHandler<Long>
    val onDelete: EventHandler<Long>
}
