//Imports here
import { ITestData } from "@business-logic/types/ITestData"
import { VehicleDamage, PartQuestionType, PaymentType, ServicePackage, AppointmentType } from "@business-logic/types/Enums";
import TestCase from "@business-logic/types/TestCase";
import { VehicleLookupType } from "@business-logic/types/Enums";
import { getDefaultTestData, setFakerSeedFromTestName } from "@business-logic/constants/DefaultTestData";

// Set the seed before generating any data
setFakerSeedFromTestName("CashReplaceMultiSlidingGlassDropoff");

// Now get the test data with the seeded faker
const cashReplaceMultiSlidingGlassDropoffData: Partial<ITestData> = {
    ...getDefaultTestData(),  // Get default data with current seed

    // Override customer postal code
    customerDetails: {
        ...getDefaultTestData().customerDetails!,
        address: {
            ...getDefaultTestData().customerDetails!.address,
            postalCode: '43085'
        }
    },
   
    // Flag for recalibration vehicle
    isRecalVehicle: true,

    // Key feature: Standard Package
    servicePackage: ServicePackage.Standard,
   
    // Override for drop-off service
    appointmentDetails: {
        serviceLocation: AppointmentType.DropOff,
        appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate
    },
   
    // Override vehicle details
    vehicleDetails: {
        ...getDefaultTestData().vehicleDetails!,
        year: '2018',
        make: 'Ford',
        model: 'F Series F150',
        style: '4 door crew cab',
        vehicleLookupType: VehicleLookupType.Zip
    },
   
    // Key feature: multiple damaged glasses
    vehicleDamage: [
        VehicleDamage.WindshieldCrack,
        VehicleDamage.PassengerFrontDoor,
        VehicleDamage.PassengerRearDoor,
        VehicleDamage.RearSliding
    ],
   
    // Override payment details
    paymentDetails: {
        paymentType: PaymentType.PayAtService
    },

    // Part questions related to rain sensing
    partQuestions: [
        {
            partQuestionType: PartQuestionType.GeneralQuestion1,
            isOnPage: true,
            optionToSelect: 'Yes'
        },
    ],

    // Capability Questions
    capabilityQuestions: [
        {
            partQuestionType: PartQuestionType.GeneralQuestion1,
            isOnPage: true,
            optionToSelect: 'Yes'
        },
    ],
   
    // Vehicle part questions for multiple glass parts
    vehiclePartQuestions: [
        {
            partQuestionType: PartQuestionType.WindshieldColor,
            isOnPage: true,
            optionToSelect: 'Green Tint',
            secondaryQuestionOptionToSelect: 'rain sensor, solar, soundproofing, third visor frit, lane departure warning system, heated glass wiper park, w/combination bracket'
        },
        {
            partQuestionType: PartQuestionType.PassengerFrontColor,
            isOnPage: true,
            optionToSelect: 'Green Tint',
            secondaryQuestionOptionToSelect: 'solar, passenger side, front, laminated, soundproofing'
        },
        {
            partQuestionType: PartQuestionType.PassengerRearColor,
            isOnPage: true,
            optionToSelect: 'Gray Tint Privacy',
            secondaryQuestionOptionToSelect: 'solar, passenger side, rear, platinum edition, 2 hole'
        },
        {
            partQuestionType: PartQuestionType.RearSlidingWindowColor,
            isOnPage: true,
            optionToSelect: 'Gray Tint Privacy',
            secondaryQuestionOptionToSelect: 'heated glass, solar, slider, power, kit'
        }
    ]
}

const cashReplaceMultiSlidingGlassDropoffTests: TestCase[] = [];

const tc = new TestCase({
    name: `CashReplaceMultiSlidingGlassDropoff`,
    tags: ['@E2E','@CashReplaceMultiSlidingGlassDropoff', '@test_report', '@CASH'],
    testData: cashReplaceMultiSlidingGlassDropoffData
}, undefined, 'CashReplaceMultiSlidingGlassDropoff');
cashReplaceMultiSlidingGlassDropoffTests.push(tc);

export default cashReplaceMultiSlidingGlassDropoffTests;