package ru.myitschool.work.domain.room

import ru.myitschool.work.data.repo.RoomBookingRepository

class SendRoomBookingRequestUseCase(
    private val repository: RoomBookingRepository
) {
    suspend operator fun invoke(roomId: Int, date: String): Result<Unit> {
        return repository.sendRoomBooking(roomId, date).mapCatching { success ->
            if (!success) error("Book error")
        }
    }
}