package cz.moneta.test.dsl.util.task.auto.smartauto.queue;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.smartauto.QueuePage;
import cz.moneta.test.dsl.auto.smartauto.shared.DateData;

import java.util.function.Function;

public class QueueTasks {

    private final Harness harness;
    public QueueTasks(Harness harness) {
        this.harness = harness;
    }

    public Function<QueuePage, QueuePage> setFromDate(DateData date) {
        return start -> start
                .clickDateFrom()
                .setDateFromYear(date.year())
                .clickDateFromMonth()
                .setDateFromMonthValue(date.month())
                .setDateFromDayValue(date.day());

    }

    public Function<QueuePage, QueuePage> setToDate(DateData date) {
        return start -> start
                .clickDateTo()
                .clickDateToMonth()
                .setDateToMonthValue(date.month())
                .setDateToDayValue(date.day());
    }

    public Function<QueuePage, QueuePage> search() {
        return QueuePage::clickSearch;
    }

    public Function<QueuePage, QueuePage> checkQueueItem() {
        return QueuePage::checkQueueItem;
    }
}
