package com.isidroid.job_sender.domain.use_case

import com.isidroid.core.DiMock
import com.isidroid.job.constant.JobStatus
import com.isidroid.job.constant.SendJobStatus
import com.isidroid.job_sender.repository.JobSendRepository
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class SendPrintJobsUseCase @Inject constructor(
    private val repository: JobSendRepository,
    @DiMock private val debug: Boolean
) {
    suspend fun start() {
        repository.checkNotRenderedPrintJobs(repository.getJobList(JobStatus.IDLE))
        repository.readFilesAndSend(repository.getJobSenderList(SendJobStatus.RENDERED))
        repository.markJobUploaded(repository.getJobList(JobStatus.RENDER_UPLOAD))
    }
}