package io.nexilis.service.data.repositories

import androidx.lifecycle.LiveData
import io.nexilis.service.data.daos.MessageStatusDao
import io.nexilis.service.data.entities.MainEntity
import io.nexilis.service.data.entities.MessageStatus
import javax.inject.Inject

class MessageStatusRepository @Inject constructor(private val dao: MessageStatusDao) : Repository {

    val all: LiveData<List<MessageStatus>> = dao.getAll()

    fun get(id: String) : LiveData<List<MessageStatus>> {
        return dao.get(id)
    }

    fun get(id: String, pin: String) : LiveData<MessageStatus> {
        return dao.get(id, pin)
    }

    override suspend fun insert(entity: MainEntity) {
        dao.insert(entity as MessageStatus)
    }
}