package cz.moneta.test.regression.commercial.smallbusiness.digital;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.util.DateUtils;
import cz.moneta.test.dsl.util.data.client.*;

import java.time.LocalDate;

import static cz.moneta.test.dsl.util.DateUtils.getSpecificDayRaw;

public final class DataPrepare {

    public static NonClient setUpFop(Harness harness) {
        return harness.data().newNonClient()
                .withEmail("dummy.a1a2a3a4a5a6a7a8@hanka.hu")
                .withMobileNumber("725559544")
                .withIdNumber("208243633")
                .withIdNumberExpiration("09.06.2027")
                .withDriverLicenceId("EK 608907")
                .withDriveLicenceExpiryDateRaw(getSpecificDayRaw(31, 8, 2026))
                .withMaritalStatus(MaritalStatus.SINGLE)
                .withEducationLevel(EducationLevel.HIGHER)
                .withAccommodationType(AccommodationType.OWN)
                .withOccupationType(OccupationType.PODNIKATEL)
                .withDependants(0);
    }

    public static NonClient setUpPo(Harness harness) {
        return harness.data().newNonClient()
                .withEmail("dummy.a1a2a3a4a5a6a7a8@hanka.hu")
                .withMobileNumber("725559544")
                .withIdNumber("208243633")
                .withIdNumberExpiration("09.06.2027")
                .withDriverLicenceId("EK 608907")
                .withDriveLicenceExpiryDateRaw(getSpecificDayRaw(31, 8, 2026))
                .withEmployer(Employer.builder()
                        .name("Ministerstvo automatizovaných testů")
                        .build())
                .withOccupationStatus(OccupationStatus.ENTREPRENEUR)
                .withIncomeType(IncomeType.BUSINESS_INCOME)
                .withIncomeSubtype(IncomeSubtype.BUSINESS)
                .withOccupationType(OccupationType.PODNIKATEL)
                .withAccommodationType(AccommodationType.OWN)
                .withMaritalStatus(MaritalStatus.SINGLE)
                .withEducationLevel(EducationLevel.HIGHER)
                .withResidencyAddress(Address.builder()
                        .street("Horní lán")
                        .descriptiveNumber("445")
                        .city("Olomouc")
                        .zip("78301")
                        .build());
    }

    public static NonClient setAssociatedFop(Harness harness) {
        return harness.data().newNonClient()
                .withIncomeType(IncomeType.BUSINESS_INCOME)
                .withIncomeSubtype(IncomeSubtype.BUSINESS)
                .withOccupationType(OccupationType.PODNIKATEL);
    }

    public static String getLastYear() {
        return DateUtils.getLastDayOfYear(LocalDate.now().minusYears(1).getYear(), "dd.MM.yyyy");
    }

    public static String getYearBeforeLast() {
        return DateUtils.getLastDayOfYear(LocalDate.now().minusYears(2).getYear(), "dd.MM.yyyy");
    }
}
