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

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.smartauto.CustomerPage;

import java.util.function.Function;

public class FinancialTasks {

    private final Harness harness;

    public FinancialTasks(Harness harness) {
        this.harness = harness;
    }

    public Function<CustomerPage, CustomerPage> fillDoubleEntry(int equity, int foreignSources, int profitBeforeTax, int shortTimeReceivables, int incomeTotal) {
        return start -> start.clickBusinessmanDoubleEntry()
                .typeBusinessmanDoubleEntryEquity(equity)
                .typeBusinessmanDoubleEntryForeignSources(foreignSources)
                .typeBusinessmanDoubleEntryProfitBeforeTax(profitBeforeTax)
                .typeBusinessmanDoubleEntryShortTimeReceivables(shortTimeReceivables)
                .typeBusinessmanDoubleEntryIncomeTotal(incomeTotal);
    }

    public Function<CustomerPage, CustomerPage> clickDoubleEntry() {
        return start -> start.clickBusinessmanDoubleEntry();
    }

    public Function<CustomerPage, CustomerPage> fillTaxRecords(int ownAssets, int incomeCommitmentSum, int incomeCommitmentDifference, int shortTimeReceivables, int incomeTotal) {
        return start -> start.clickBusinessmanTaxRecords()
                .typeBusinessmanTaxRecordsOwnAssets(ownAssets)
                .typeBusinessmanTaxRecordsIncomeCommitmentSum(incomeCommitmentSum)
                .typeBusinessmanTaxRecordsIncomeCommitmentDifference(incomeCommitmentDifference)
                .typeBusinessmanTaxRecordsShortTimeReceivables(shortTimeReceivables)
                .typeBusinessmanTaxRecordsIncomeTotal(incomeTotal);
    }
}
