//Imports here
import { ITestData } from 'framework/TestData'
import { PartQuestionType, PaymentType, VehicleDamage } from 'safelite-playwright-core';
import { ITestCase } from '../framework/Typedefs'
import { VehicleLookupType } from 'safelite-playwright-core';
import { getDefaultTestData, setFakerSeedFromTestName } from 'safelite-playwright-core';

// Set the seed before generating any data
setFakerSeedFromTestName("CashReplaceSplitWindshield.ts");

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

    isHeavyTruck: true, // Flag for big truck

    customerDetails: {
        ...getDefaultTestData().customerDetails!,
        address: {
            ...getDefaultTestData().customerDetails!.address,
            postalCode: '55414'
        }
    },
   
    // Override vehicle details
    vehicleDetails: {
        ...getDefaultTestData().vehicleDetails!,
        year: '2006',
        make: 'Navistar',
        model: '5000 I',
        style: '2 door conventional cab',
        vehicleLookupType: VehicleLookupType.Zip
    },
   
    vehiclePartQuestions: [
        {
            partQuestionType: PartQuestionType.DriverWindshield,
            isOnPage: true,
            optionToSelect: 'Green Tint',
            secondaryQuestionOptionToSelect: 'driver side, encap, asymmetrically strengthen'
        },
        {
            partQuestionType: PartQuestionType.PassengerWindshield,
            isOnPage: true,
            optionToSelect: 'Green Tint',
            secondaryQuestionOptionToSelect: 'passenger side, encap, asymmetrically strengthen'
        },
    ],
    
    // Override default vehicle damage (Split Windshield)
    vehicleDamage: [VehicleDamage.DriverSplitWindshield, VehicleDamage.PassengerSplitWindshield],
   
    // Override appointment details
    appointmentDetails: {
        ...getDefaultTestData().appointmentDetails!,
        shopAddress: "504 Malcolm Ave Se, Minneapolis, MN 55414"
    },

    // Override payment details
    paymentDetails: {
        paymentType: PaymentType.PayAtService
    }
}

const CashReplaceSplitWindshieldTests: ITestCase[] = [];

const tc = {
    name: `CashReplaceSplitWindshield`,
    tags: ['@E2E','@CashReplaceSplitWindshield', '@test_report', '@CASH', '@CASH-848'],
    testData: CashReplaceSplitWindshieldData
};
CashReplaceSplitWindshieldTests.push(tc);

export default CashReplaceSplitWindshieldTests;