//Imports here
import { ITestData } from 'framework/TestData'
import { 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("CashReplaceGlassPromoInshop");

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

    // CASH Client
    paymentMethod: PaymentMethod.SelfPay,
    
    customerDetails: {
        ...getDefaultTestData().customerDetails!,
        address: {
            street: '4076 Spectacle Dr',
            city: 'Columbus',
            state: 'Ohio',
            postalCode: '43235',
        }
    },

    // Flag for recalibration vehicle
    isRecalVehicle: true,
   
    // Override vehicle details with VIN lookup
    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
   
    // Override appointment details for in-shop service
    appointmentDetails: {
        ...getDefaultTestData().appointmentDetails!,
        shopAddress: "6826 Sawmill Rd, Columbus, OH 43235"
    },

    // Flag for opting in for text message appt updates
    isOptedInForTextMessages: true,
   
    // Override payment details
    paymentDetails: {
        paymentType: PaymentType.PayAtService,
        // Add promo code - key feature of this test
        promoCode: '20CALL',
    }
}

const cashReplaceGlassPromoInshopTests: ITestCase[] = [];

const tc = {
    name: `CashReplaceGlassPromoInshop`,
    tags: ['@E2E','@CashReplaceGlassPromoInshop', '@test_report', '@CASH', '@CASH-1182'],
    testData: cashReplaceGlassPromoInshopData
};
cashReplaceGlassPromoInshopTests.push(tc);

export default cashReplaceGlassPromoInshopTests;