package ru.myitschool.work.domain.open;

import androidx.annotation.NonNull;

import java.util.function.Consumer;

import ru.myitschool.work.data.dto.Code;
import ru.myitschool.work.domain.entities.Status;

public class OpenUseCase {
    private final OpenRepository repository;

    public OpenUseCase(OpenRepository repository) {
        this.repository = repository;
    }

    public void execute(@NonNull String login, @NonNull Long code, @NonNull Consumer<Status<Void>> callback) {
        repository.open(login, new Code(code), callback);
    }
}
