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

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

    // CASH Client
    paymentMethod: PaymentMethod.SelfPay,
   
    // Flag for recalibration vehicle
    isRecalVehicle: true,

    // Flag for dynamic Recalibration vehicle
    isDynamicRecal: true,

    customerDetails: {
        ...getDefaultTestData().customerDetails!,
        address: {
            ...getDefaultTestData().customerDetails!.address,
            postalCode: '21237'
        }
    },
   
    // Override vehicle details
    vehicleDetails: {
        ...getDefaultTestData().vehicleDetails!,
        year: '2018',
        make: 'Ford',
        model: 'Expedition',
        style: '4 door utility',
        vin: '1FMJU1JT2JEA59123',
        vehicleLookupType: VehicleLookupType.Vin
    },
   
    // No need to override vehicleDamage as it already defaults to WindshieldCrack
   
    // Override appointment details
    appointmentDetails: {
        serviceLocation: ServiceLocation.Mobile,
        appointmentDate: getDefaultTestData().appointmentDetails?.appointmentDate,
        serviceAddress: {
            // Use street address from current faker seed
            street: "5050 Silver Oak Dr",
            city: 'Rosedale',
            state: 'MD',
            postalCode: '21237',
            country: 'United States'
        },
    },
   
    // Override payment details
    paymentDetails: {
        paymentType: PaymentType.PayAtService
    }
}

const cashReplaceDynamicRecalMobileTests: ITestCase[] = [];

const tc = {
    name: `CashReplaceDynamicRecalMobile`,
    tags: ['@E2E','@CashReplaceDynamicRecalMobile', '@test_report', '@CASH'],
    testData: cashReplaceDynamicRecalMobileData
};
cashReplaceDynamicRecalMobileTests.push(tc);

export default cashReplaceDynamicRecalMobileTests;