package cz.moneta.test.regression.commercial.auto.smartauto.mockdata;

import cz.moneta.test.dsl.auto.smartauto.shared.*;
import cz.moneta.test.dsl.auto.smartauto.util.MonthUtil;

public class AgroMock {
    public static CalculationData prepareCalculationDataWithTP() {
        return prepareCalculationDataAgro()
                .setPrGroup(PrGroup.AGROTP)
                .setGroup(Group.T)
                .setSubsidy(Subsidy.PGRLF)
                .setSubsidy(Subsidy.YOUNG_FARMER)
                .setProduct(Product.AGRO_CREDIT_YOUNG_FARMER)
                .setItemType(ItemType.TRACTOR);
    }

    public static CalculationData prepareCalculationDataWithTPC2C() {
        return prepareCalculationDataAgro()
                .setPrGroup(PrGroup.AGROTP)
                .setGroup(Group.T)
                .setSubsidy(Subsidy.PGRLF)
                .setSubsidy(Subsidy.YOUNG_FARMER)
                .setProduct(Product.AGRO_WITHTP_YOUNG_FARMER_C2C)
                .setItemType(ItemType.TRACTOR);
    }

    public static CalculationData prepareCalculationDataWithoutTP() {
        return prepareCalculationDataAgro()
                .setPrGroup(PrGroup.AGROWITHOUTTP)
                .setGroup(Group.WORK_MACHINES)
                .setProduct(Product.AGRO_WITHOUT_TP_YOUNG_FARMER);
    }

    private static CalculationData prepareCalculationDataAgro() {
        CalculationData calculationData = new CalculationData();
        return calculationData
                .setCustomer(Customer.BUSINESSMAN_WITH_VAT)
                .setPrClass(PrClass.AGRONEW)
                .setVat(Vat.NO)
                .setVolume("250")
                .setPower("86")
                .setWeight("1850")
                .setFuel(FilterFuel.PETROL)
                .setBrand(Brand.JCB)
                .setModel(Model.MODEL)
                .setUsage(Usage.OTHERS)
                .setPrice(5000000)
                .setFirstPayment(1250000)
                .setMonth(MonthUtil.getCurrentMonth());
    }

    // CalculationAgroTPTest
    public static CalculationData prepareCalculationAgro1() {
        return prepareCalculationDataAgroTP()
                .setCustomer(Customer.BUSINESSMAN_WITH_VAT)
                .setPrClass(PrClass.AGRONEW);
    }

    public static CalculationData prepareCalculationAgro2() {
        return prepareCalculationDataAgroTP()
                .setCustomer(Customer.BUSINESSMAN_WITH_VAT)
                .setPrClass(PrClass.AGROUSED);
    }

    public static CalculationData prepareCalculationAgro3() {
        return prepareCalculationDataAgroTP()
                .setCustomer(Customer.BUSINESSMAN_WITHOUT_VAT)
                .setPrClass(PrClass.AGRONEW)
                .setSubsidy(Subsidy.PGRLF)
                .setSubsidy(Subsidy.YOUNG_FARMER);
    }

    public static CalculationData prepareCalculationAgro4() {
        return prepareCalculationDataAgroTP()
                .setCustomer(Customer.BUSINESSMAN_WITHOUT_VAT)
                .setPrClass(PrClass.AGROUSED)
                .setSubsidy(Subsidy.PGRLF)
                .setSubsidy(Subsidy.YOUNG_FARMER);
    }

    public static CalculationData prepareCalculationAgro5() {
        return prepareCalculationDataAgroTP()
                .setCustomer(Customer.BUSINESSMAN_WITHOUT_VAT)
                .setPrClass(PrClass.AGRONEW)
                .setSubsidy(Subsidy.PGRLF);
    }

    private static CalculationData prepareCalculationDataAgroTP() {
        CalculationData calculationData = new CalculationData();
        return calculationData
                .setProduct(Product.AGRO_CREDIT_YOUNG_FARMER)
                .setVat(Vat.NO)
                .setPrGroup(PrGroup.AGROTP)
                .setGroup(Group.T)
                .setBrand(Brand.JCB)
                .setModel(Model.MODEL)
                .setVolume("250")
                .setPower("86")
                .setWeight("1850")
                .setFuel(FilterFuel.PETROL)
                .setFirstPayment(125000)
                .setPrice(3000000)
                .setUsage(Usage.OTHERS)
                .setItemType(ItemType.TRACTOR);
    }

    // CalculationAgroWithoutTPTest
    public static CalculationData prepareCalculationAgroNoTP1() {
        return prepareCalculationDataAgroWithoutTP()
                .setCustomer(Customer.BUSINESSMAN_WITH_VAT);
    }

    public static CalculationData prepareCalculationAgroNoTP2() {
        return prepareCalculationDataAgroWithoutTP()
                .setCustomer(Customer.BUSINESSMAN_WITHOUT_VAT);

    }

    private static CalculationData prepareCalculationDataAgroWithoutTP() {
        CalculationData calculationData = new CalculationData();
        return calculationData
                .setProduct(Product.AGRO_WITHOUT_TP_YOUNG_FARMER)
                .setPrClass(PrClass.AGRONEW)
                .setPrGroup(PrGroup.AGROWITHOUTTP)
                .setGroup(Group.WORK_MACHINES)
                .setPrice(800000)
                .setVolume("250")
                .setPower("86")
                .setWeight("1850")
                .setFuel(FilterFuel.PETROL)
                .setUsage(Usage.OTHERS)
                .setMonth(MonthUtil.getCurrentMonth())
                .setBrand(Brand.JCB)
                .setModel(Model.MODEL)
                .setFirstPayment(125000)
                .setVat(Vat.NO);
    }

    // AGRO INSURANCE
    public static Insurance insurance() {
        return Insurance.INDIVIDUAL;
    }
}
