import ClientData from "@business-logic/data/ClientData"; import TestCase from "@business-logic/types/TestCase"; import { DamageType, PartQuestionType, PaymentType, ServiceLocation, ServicePackage, VehicleDamage } from "@business-logic/types/Enums"; import { ITestData } from "@business-logic/types/ITestData" import { faker } from "@faker-js/faker"; import { getNextWeekday } from "@impl/utils/DateUtils"; import MockPolicyData from "@business-logic/data/MockPolicyData"; import { ICustomerDetails } from "@business-logic/types/CustomerDetails"; import { IAddress } from "@business-logic/types/IAddress"; const nextWeekday = getNextWeekday(); const customerAddress: IAddress = { street: faker.location.streetAddress(), city: 'PLANO', state: 'TX', postalCode: '75023', country: 'United States' } const customerDetails: ICustomerDetails = { firstName: faker.person.firstName(), lastName: faker.person.lastName(), email: 'itqatest@safelite.com', phoneNumber: '614-531-0031', notes: 'Automated Test', address: customerAddress } const policyNumber = `~AutomatedScenario0003a${crypto.randomUUID().replace(/-/g, '').slice(0, 16).toUpperCase()}`; const policySoap = MockPolicyData.getPolicySoapByScenario('0003a', customerDetails, policyNumber); const advancedScenario0003Data: Partial = { clientTag: '', isDuplicateClaim: false, isPolicyFound: true, isNoComp: false, hasOemEndorsement: true, hasStateLawPopup: false, endorsements: undefined, vehiclePartQuestions: [ { partQuestionType: PartQuestionType.WindshieldColor, isOnPage: true, optionToSelect: '05-10 Chrysler 300c' }, { partQuestionType: PartQuestionType.PassengerRearColor, isOnPage: true, optionToSelect: 'Solar, Passenger side, Rear' }, ], isSafelite: true, servicePackage: faker.helpers.enumValue(ServicePackage), customerDetails: customerDetails, claimDetails: { policyNumber: policyNumber, policyDeductible: 50, damageDate: '2026-01-02', damageCause: DamageType.Rock }, policySoap: policySoap, vehicleDetails: { year: '2006', make: 'Chrysler', model: '300', style: '' }, vehicleDamage: [ VehicleDamage.WindshieldCrack, VehicleDamage.PassengerRearDoor ], appointmentDetails: { serviceLocation: ServiceLocation.Mobile, shopAddress: undefined, serviceAddress: customerAddress, appointmentDate: nextWeekday }, paymentDetailsAdyen: ClientData.getAfterpayDetailsAdyen() } // TODO: Add validation for deductible/covered amount const advancedClients = ClientData.getAdvancedClients(); const advancedScenario0003TestCases: TestCase[] = []; for (const client of advancedClients) { const data = {...advancedScenario0003Data}; data.clientTag = client.clientTag; data.accountNumber = client.accountNumber; const tc = new TestCase({ name: `0003a Advanced Replace Deductible Mobile Afterpay Client: "${client.accountName}"`, tags: [`@${client.clientTag}`, `@${client.accountName}`, '@Advanced'], testData: data }, undefined, '0003a'); advancedScenario0003TestCases.push(tc); } export default advancedScenario0003TestCases;