import ClientData from "@business-logic/data/ClientData";
import TestCase from "@business-logic/types/TestCase";
import { DamageType, ServiceLocation, ServicePackage, VehicleDamage, VehicleLookupType } from "@business-logic/types/Enums";
import { ITestData } from "@business-logic/types/ITestData"
import { faker } from "@faker-js/faker";
import { getNextWeekday } from "@impl/utils/DateUtils";

const nextWeekday = getNextWeekday();

const essentialRepairMobileHyundaiData: Partial<ITestData> = {
    clientTag: 'ALL_ESSENTIAL',
    isDuplicateClaim: false,
    isPolicyFound: false,
    endorsements: [],
    isReplace: false,
    partQuestions: undefined,
    isSafelite: true,
    servicePackage: ServicePackage.Premium,
    customerDetails: {
        firstName: faker.person.firstName(),
        lastName: faker.person.lastName(),
        email: "itqatest@safelite.com",
        phoneNumber: faker.helpers.fromRegExp(/[2-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]/),
        notes: 'Automated Test',
        address: {
            street: faker.location.streetAddress(),
            city: 'Raleigh',
            state: 'North Carolina',
            postalCode: '27615',
            country: 'United States'
        }
    },
    claimDetails: {
        policyNumber: faker.string.alphanumeric(5),
        policyDeductible: -1,   // Not advanced, so we don't care about deductible.
        damageDate: '2024-10-10',
        damageCause: DamageType.Other
    },
    vehicleDetails: {
        year: '2013',
        make: 'Hyundai',
        model: 'Sonata',
        style: '4 door sedan',
        vin: '5NPEC4AB6DH791034'
    },
    vehicleDamage: [
        VehicleDamage.WindshieldTwoChips,
    ],
    appointmentDetails: {
        serviceLocation: ServiceLocation.Mobile,  
        serviceAddress: {
            street: "2088 Haviland Road, Columbus, OH, USA",
            city:"Vermillion",
            state: "Ohio",
            postalCode: "44089",
            country: "undefined"
        },
        appointmentDate: nextWeekday
    }

}

const essentialClients = ClientData.getEssentialClients();
const essentialRepairMobileHyundaiTests: TestCase[] = [];
for (const client of essentialClients) {
    const data = {...essentialRepairMobileHyundaiData};
    data.clientTag = client.clientTag;
    data.isAuthenticationRequired = client.clientFlags.isAuthenticationEnabled ?? false
    const tc = new TestCase({
        name: `0007 Essential Repair Hyundai Mobile Client: "${client.accountName}"`,
        tags: [`@${client.clientTag}`, `@${client.accountName}`],
        testData: data
    }, undefined, '0007');
    essentialRepairMobileHyundaiTests.push(tc);
}

export default essentialRepairMobileHyundaiTests;