//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("CashReplaceMultiGlassMobile");

// Now get the test data with the seeded faker
const cashReplaceMultiGlassMobileData: 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: Premium Package
    servicePackage: ServicePackage.Premium,
   
    // Override appointment details
    appointmentDetails: {
        serviceLocation: AppointmentType.Mobile,
        appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
        serviceAddress: {
            // Use street address from current faker seed
            street: getDefaultTestData().customerDetails!.address.street,
            city: 'Rosedale',
            state: 'Maryland',
            postalCode: '21237',
            country: 'United States'
        },
    },
   
    // Override vehicle details with VIN lookup
    vehicleDetails: {
        ...getDefaultTestData().vehicleDetails!,
        year: '2014',
        make: 'Jeep',
        model: 'Cherokee',
        style: '4 door utility',
        vin: '1C4PJLCS6EW288461',
        vehicleLookupType: VehicleLookupType.Vin
    },
   
    // Key feature: multiple damaged glasses
    vehicleDamage: [
        VehicleDamage.WindshieldCrack,
        VehicleDamage.DriverQuarterPanel,
        VehicleDamage.PassengerQuarterPanel,
    ],
   
    // Override payment details
    paymentDetails: {
        paymentType: PaymentType.PayAtService
    },
   
    // Vehicle part questions for multiple glass parts
    vehiclePartQuestions: [
        {
            partQuestionType: PartQuestionType.WindshieldColor,
            isOnPage: true,
            optionToSelect: 'Green Tint',
            secondaryQuestionOptionToSelect: 'solar'
        },
        {
            partQuestionType: PartQuestionType.DriverQuarterColor,
            isOnPage: true,
            optionToSelect: 'Green Tint',
            secondaryQuestionOptionToSelect: 'solar, driver side, encap, chrome molding'
        },
        {
            partQuestionType: PartQuestionType.PassengerQuarterColor,
            isOnPage: true,
            optionToSelect: 'Gray Tint Privacy',
            secondaryQuestionOptionToSelect: 'solar, passenger side, encap, chrome molding'
        }
    ]
}

const cashReplaceMultiGlassMobileTests: TestCase[] = [];

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

export default cashReplaceMultiGlassMobileTests;