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

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

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

    // CASH Client
    paymentMethod: PaymentMethod.SelfPay,
   
    // Key feature: Premium package with Rain Defense
    servicePackage: ServicePackage.Premium,
   
    // Flag for recalibration vehicle
    isRecalVehicle: true,
   
    // Override customer details
    customerDetails: {
        ...getDefaultTestData().customerDetails!,
        address: {
            ...getDefaultTestData().customerDetails!.address,
            postalCode: '43085'
        }
    },
   
    // Override vehicle details
    vehicleDetails: {
        ...getDefaultTestData().vehicleDetails!,
        year: '2020',
        make: 'Ford',
        model: 'Fusion',
        style: '4 door sedan',
        vin: '3FA6P0HD8LR234510',
        vehicleLookupType: VehicleLookupType.Vin
    },
   
    // No need to override vehicleDamage as it already defaults to WindshieldCrack
   
    // Payment at service
    paymentDetails: {
        paymentType: PaymentType.PayAtService,
        // Rain Defense promo code
        promoCode: 'rd50'
    },
}

const cashReplaceRainDefensePromoInshopTests: ITestCase[] = [];

const tc = {
    name: `CashReplaceRainDefensePromoInshop`,
    tags: ['@E2E','@CashReplaceRainDefensePromoInshop', '@test_report', '@CASH'],
    testData: cashReplaceRainDefensePromoInshopData
};
cashReplaceRainDefensePromoInshopTests.push(tc);

export default cashReplaceRainDefensePromoInshopTests;