package com.isidroid.job_sender.data.source.local

import com.isidroid.job.constant.SendJobStatus
import com.isidroid.job_sender.domain.model.PrintJobSender

class SendJobLocalSource(private val dao: SendJobDao) : SendJobDao {
    override fun find(id: String, printJobId: String): PrintJobSender? = dao.find(id, printJobId)
    override fun findByStatus(status: Int?) = dao.findByStatus(status)
    override fun insert(vararg item: PrintJobSender) = dao.insert(*item)

    fun updateStatus(item: PrintJobSender, @SendJobStatus status: Int) = item.copy(status = status).also { insert(it) }
}