package com.prodhack.moscow2025.domain.usecase.resumes

import com.prodhack.moscow2025.domain.interfaces.resumes.ResumeRepository
import com.prodhack.moscow2025.domain.models.ResumeCreationModel
import org.koin.core.annotation.Single

@Single
class PostResumeUseCase(
	private val resumeRepository: ResumeRepository
) {
	suspend operator fun invoke(
		resumeForm: ResumeCreationModel,
		isNew: Boolean,
		resumeId: String?
	): Result<String> =
		if (isNew) resumeRepository.createResume(resumeForm) else resumeRepository.updateResume(
			resumeId!!,
			resumeForm
		)
}
