From 0cc245ca84afcc57042b07b53fb2e0094ca85fd6 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Fri, 17 Jul 2026 17:31:10 -0400 Subject: [PATCH 01/11] INSR-10442: Add function for customizing claim registration payload for specific clients Needed to be able to include ITAC fields for USAA --- src/constants/parent-account-numbers.js | 5 +++++ src/helpers/coverage-helper.js | 16 ++++++++++++++++ src/store/index.js | 2 ++ 3 files changed, 23 insertions(+) create mode 100644 src/constants/parent-account-numbers.js create mode 100644 src/helpers/coverage-helper.js diff --git a/src/constants/parent-account-numbers.js b/src/constants/parent-account-numbers.js new file mode 100644 index 00000000..70419bf8 --- /dev/null +++ b/src/constants/parent-account-numbers.js @@ -0,0 +1,5 @@ +const parentAccountNumber = Object.freeze({ + USAA: 900040 +}); + +export default parentAccountNumber; \ No newline at end of file diff --git a/src/helpers/coverage-helper.js b/src/helpers/coverage-helper.js new file mode 100644 index 00000000..cece9348 --- /dev/null +++ b/src/helpers/coverage-helper.js @@ -0,0 +1,16 @@ +import parentAccountNumber from "@/constants/parent-account-numbers"; +import { useMainStore } from "@/store"; + +export function updateClientSpecificFieldsForClaimRegistration(payload) { + const mainStore = useMainStore(); + switch (mainStore.order.parentAccountNumber) { + case parentAccountNumber.USAA: + payload.additionalInfo = { + offeredItac: mainStore.isITAC.toString(), + qualifiedForItac: mainStore.isITAC.toString() + } + break; + default: + break; + } +} \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 675618a2..0938eb33 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -28,6 +28,7 @@ import { getDateForSavedSessionTimeout } from '@/helpers/session-helper'; import { isMobileDevice } from '@/helpers/useragent-helper'; import issPageValues from '@/router/router-constants/issPage-values'; import { getNonFalseValuesOfPropertyInArrayOfObjects, sortArrayOfObjectsByPropertyValue } from '@/helpers/object-helper'; +import { updateClientSpecificFieldsForClaimRegistration } from '@/helpers/coverage-helper'; const storeId = 'main'; @@ -713,6 +714,7 @@ export const useMainStore = defineStore({ if (this.issConfig.useMemberNumber) { payload.memberNumber = this.order.policy.policyNumber; } + updateClientSpecificFieldsForClaimRegistration(payload); const response = await globalMethods.callHttpClient({ method: endpoints.RegisterClaim.method, endpoint: endpoints.RegisterClaim.url, From d1af95bc15f19a59596314b4bdaa472dbb83ff1e Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Fri, 17 Jul 2026 17:45:27 -0400 Subject: [PATCH 02/11] ISR-10442: Add unit tests for new helper --- src/helpers/coverage-helper.spec.js | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/helpers/coverage-helper.spec.js diff --git a/src/helpers/coverage-helper.spec.js b/src/helpers/coverage-helper.spec.js new file mode 100644 index 00000000..6b10cf84 --- /dev/null +++ b/src/helpers/coverage-helper.spec.js @@ -0,0 +1,68 @@ +import { updateClientSpecificFieldsForClaimRegistration } from '@/helpers/coverage-helper'; +import parentAccountNumber from '@/constants/parent-account-numbers'; + +let mockStore; + +jest.mock('@/store', () => ({ + useMainStore: jest.fn(() => mockStore) +})); + +describe('coverage-helper.js', () => { + describe('updateClientSpecificFieldsForClaimRegistration', () => { + beforeEach(() => { + mockStore = { + order: { + parentAccountNumber: null + }, + isITAC: false + }; + + jest.clearAllMocks(); + }); + + test('Sets additionalInfo fields when parent account is USAA and isITAC is true', () => { + // Arrange + const payload = {}; + mockStore.order.parentAccountNumber = parentAccountNumber.USAA; + mockStore.isITAC = true; + + // Act + updateClientSpecificFieldsForClaimRegistration(payload); + + // Assert + expect(payload.additionalInfo).toEqual({ + offeredItac: 'true', + qualifiedForItac: 'true' + }); + }); + + test('Sets additionalInfo fields when parent account is USAA and isITAC is false', () => { + // Arrange + const payload = {}; + mockStore.order.parentAccountNumber = parentAccountNumber.USAA; + mockStore.isITAC = false; + + // Act + updateClientSpecificFieldsForClaimRegistration(payload); + + // Assert + expect(payload.additionalInfo).toEqual({ + offeredItac: 'false', + qualifiedForItac: 'false' + }); + }); + + test('Does not set additionalInfo when parent account is not USAA', () => { + // Arrange + const payload = {}; + mockStore.order.parentAccountNumber = 123456; + mockStore.isITAC = true; + + // Act + updateClientSpecificFieldsForClaimRegistration(payload); + + // Assert + expect(payload.additionalInfo).toBeUndefined(); + }); + }); +}); From 7f424a1f4f67aabb67ac371321d625364f9408a6 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 20 Jul 2026 11:05:41 -0400 Subject: [PATCH 03/11] INSR-10442: Update client specific logic to use dynamic imports This prevents the exposure of client name -> parent account number mapping. Probably cleaner overal, as well --- src/constants/parent-account-numbers.js | 5 - .../client-mappers/Client900040Coverage.js | 10 ++ src/helpers/coverage-helper.js | 20 ++-- src/helpers/coverage-helper.spec.js | 97 +++++++++---------- src/store/index.js | 2 +- 5 files changed, 68 insertions(+), 66 deletions(-) delete mode 100644 src/constants/parent-account-numbers.js create mode 100644 src/helpers/client-mappers/Client900040Coverage.js diff --git a/src/constants/parent-account-numbers.js b/src/constants/parent-account-numbers.js deleted file mode 100644 index 70419bf8..00000000 --- a/src/constants/parent-account-numbers.js +++ /dev/null @@ -1,5 +0,0 @@ -const parentAccountNumber = Object.freeze({ - USAA: 900040 -}); - -export default parentAccountNumber; \ No newline at end of file diff --git a/src/helpers/client-mappers/Client900040Coverage.js b/src/helpers/client-mappers/Client900040Coverage.js new file mode 100644 index 00000000..b85ba1c0 --- /dev/null +++ b/src/helpers/client-mappers/Client900040Coverage.js @@ -0,0 +1,10 @@ +import { useMainStore } from "@/store"; + +export function updateClaimRegistrationPayload(payload) { + console.log(`updating payload for USAA`) + const mainStore = useMainStore(); + payload.additionalInfo = { + offeredItac: mainStore.isITAC ? 'true' : 'false', + qualifiedForItac: mainStore.isITAC ? 'true' : 'false' + } +} \ No newline at end of file diff --git a/src/helpers/coverage-helper.js b/src/helpers/coverage-helper.js index cece9348..61177121 100644 --- a/src/helpers/coverage-helper.js +++ b/src/helpers/coverage-helper.js @@ -1,16 +1,14 @@ -import parentAccountNumber from "@/constants/parent-account-numbers"; import { useMainStore } from "@/store"; -export function updateClientSpecificFieldsForClaimRegistration(payload) { +export async function updateClientSpecificFieldsForClaimRegistration(payload) { const mainStore = useMainStore(); - switch (mainStore.order.parentAccountNumber) { - case parentAccountNumber.USAA: - payload.additionalInfo = { - offeredItac: mainStore.isITAC.toString(), - qualifiedForItac: mainStore.isITAC.toString() - } - break; - default: - break; + try { + console.log(`Updating client-specific fields for claim registration for parent account number: ${mainStore.order.parentAccountNumber}`); + const clientMapper = await import(`@/helpers/client-mappers/Client${mainStore.order.parentAccountNumber}Coverage.js`); + console.log(`Loaded client mapper: ${clientMapper}`); + clientMapper.updateClaimRegistrationPayload(payload); + } + catch (error) { + console.error('Error updating client-specific fields for claim registration:', error); } } \ No newline at end of file diff --git a/src/helpers/coverage-helper.spec.js b/src/helpers/coverage-helper.spec.js index 6b10cf84..fd1fb2bc 100644 --- a/src/helpers/coverage-helper.spec.js +++ b/src/helpers/coverage-helper.spec.js @@ -1,68 +1,67 @@ import { updateClientSpecificFieldsForClaimRegistration } from '@/helpers/coverage-helper'; -import parentAccountNumber from '@/constants/parent-account-numbers'; let mockStore; jest.mock('@/store', () => ({ - useMainStore: jest.fn(() => mockStore) + useMainStore: jest.fn(() => mockStore) })); describe('coverage-helper.js', () => { - describe('updateClientSpecificFieldsForClaimRegistration', () => { - beforeEach(() => { - mockStore = { - order: { - parentAccountNumber: null - }, - isITAC: false - }; + describe('updateClientSpecificFieldsForClaimRegistration', () => { + beforeEach(() => { + mockStore = { + order: { + parentAccountNumber: null + }, + isITAC: false + }; - jest.clearAllMocks(); - }); + jest.clearAllMocks(); + }); - test('Sets additionalInfo fields when parent account is USAA and isITAC is true', () => { - // Arrange - const payload = {}; - mockStore.order.parentAccountNumber = parentAccountNumber.USAA; - mockStore.isITAC = true; + test('Sets additionalInfo fields when parent account is 900040 and isITAC is true', async () => { + // Arrange + const payload = {}; + mockStore.order.parentAccountNumber = 900040; + mockStore.isITAC = true; - // Act - updateClientSpecificFieldsForClaimRegistration(payload); + // Act + await updateClientSpecificFieldsForClaimRegistration(payload); - // Assert - expect(payload.additionalInfo).toEqual({ - offeredItac: 'true', - qualifiedForItac: 'true' - }); - }); + // Assert + expect(payload.additionalInfo).toEqual({ + offeredItac: 'true', + qualifiedForItac: 'true' + }); + }); - test('Sets additionalInfo fields when parent account is USAA and isITAC is false', () => { - // Arrange - const payload = {}; - mockStore.order.parentAccountNumber = parentAccountNumber.USAA; - mockStore.isITAC = false; + test('Sets additionalInfo fields when parent account is 900040 and isITAC is false', async () => { + // Arrange + const payload = {}; + mockStore.order.parentAccountNumber = 900040; + mockStore.isITAC = false; - // Act - updateClientSpecificFieldsForClaimRegistration(payload); + // Act + await updateClientSpecificFieldsForClaimRegistration(payload); - // Assert - expect(payload.additionalInfo).toEqual({ - offeredItac: 'false', - qualifiedForItac: 'false' - }); - }); + // Assert + expect(payload.additionalInfo).toEqual({ + offeredItac: 'false', + qualifiedForItac: 'false' + }); + }); - test('Does not set additionalInfo when parent account is not USAA', () => { - // Arrange - const payload = {}; - mockStore.order.parentAccountNumber = 123456; - mockStore.isITAC = true; + test('Does not set additionalInfo when parent account is not 900040', async () => { + // Arrange + const payload = {}; + mockStore.order.parentAccountNumber = 123456; + mockStore.isITAC = true; - // Act - updateClientSpecificFieldsForClaimRegistration(payload); + // Act + await updateClientSpecificFieldsForClaimRegistration(payload); - // Assert - expect(payload.additionalInfo).toBeUndefined(); - }); - }); + // Assert + expect(payload.additionalInfo).toBeUndefined(); + }); + }); }); diff --git a/src/store/index.js b/src/store/index.js index 0938eb33..9de98893 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -714,7 +714,7 @@ export const useMainStore = defineStore({ if (this.issConfig.useMemberNumber) { payload.memberNumber = this.order.policy.policyNumber; } - updateClientSpecificFieldsForClaimRegistration(payload); + await updateClientSpecificFieldsForClaimRegistration(payload); const response = await globalMethods.callHttpClient({ method: endpoints.RegisterClaim.method, endpoint: endpoints.RegisterClaim.url, From 6ba3a55274fc14288a51b98810e342d7cc8747e6 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 20 Jul 2026 11:44:17 -0400 Subject: [PATCH 04/11] INSR-10442: Remove debug logging, update some tests --- .../client-mappers/Client900040Coverage.js | 1 - src/helpers/coverage-helper.js | 6 +-- src/helpers/coverage-helper.spec.js | 46 ++++++++----------- 3 files changed, 19 insertions(+), 34 deletions(-) diff --git a/src/helpers/client-mappers/Client900040Coverage.js b/src/helpers/client-mappers/Client900040Coverage.js index b85ba1c0..bed99f42 100644 --- a/src/helpers/client-mappers/Client900040Coverage.js +++ b/src/helpers/client-mappers/Client900040Coverage.js @@ -1,7 +1,6 @@ import { useMainStore } from "@/store"; export function updateClaimRegistrationPayload(payload) { - console.log(`updating payload for USAA`) const mainStore = useMainStore(); payload.additionalInfo = { offeredItac: mainStore.isITAC ? 'true' : 'false', diff --git a/src/helpers/coverage-helper.js b/src/helpers/coverage-helper.js index 61177121..32d2b18e 100644 --- a/src/helpers/coverage-helper.js +++ b/src/helpers/coverage-helper.js @@ -3,12 +3,8 @@ import { useMainStore } from "@/store"; export async function updateClientSpecificFieldsForClaimRegistration(payload) { const mainStore = useMainStore(); try { - console.log(`Updating client-specific fields for claim registration for parent account number: ${mainStore.order.parentAccountNumber}`); const clientMapper = await import(`@/helpers/client-mappers/Client${mainStore.order.parentAccountNumber}Coverage.js`); - console.log(`Loaded client mapper: ${clientMapper}`); clientMapper.updateClaimRegistrationPayload(payload); } - catch (error) { - console.error('Error updating client-specific fields for claim registration:', error); - } + catch (error) { } } \ No newline at end of file diff --git a/src/helpers/coverage-helper.spec.js b/src/helpers/coverage-helper.spec.js index fd1fb2bc..4bdac1c5 100644 --- a/src/helpers/coverage-helper.spec.js +++ b/src/helpers/coverage-helper.spec.js @@ -18,36 +18,26 @@ describe('coverage-helper.js', () => { jest.clearAllMocks(); }); + describe.each([ + [900040, true], + [900040, false], + ['900040', true], + ['900040', false] + ])('custom claim registration for client 900040', (parentAccountNumber, isITAC) => { + test(`Sets additionalInfo fields when parent account is ${parentAccountNumber} and isITAC is ${isITAC}`, async () => { + // Arrange + const payload = {}; + mockStore.order.parentAccountNumber = parentAccountNumber; + mockStore.isITAC = isITAC; - test('Sets additionalInfo fields when parent account is 900040 and isITAC is true', async () => { - // Arrange - const payload = {}; - mockStore.order.parentAccountNumber = 900040; - mockStore.isITAC = true; + // Act + await updateClientSpecificFieldsForClaimRegistration(payload); - // Act - await updateClientSpecificFieldsForClaimRegistration(payload); - - // Assert - expect(payload.additionalInfo).toEqual({ - offeredItac: 'true', - qualifiedForItac: 'true' - }); - }); - - test('Sets additionalInfo fields when parent account is 900040 and isITAC is false', async () => { - // Arrange - const payload = {}; - mockStore.order.parentAccountNumber = 900040; - mockStore.isITAC = false; - - // Act - await updateClientSpecificFieldsForClaimRegistration(payload); - - // Assert - expect(payload.additionalInfo).toEqual({ - offeredItac: 'false', - qualifiedForItac: 'false' + // Assert + expect(payload.additionalInfo).toEqual({ + offeredItac: isITAC.toString(), + qualifiedForItac: isITAC.toString() + }); }); }); From 64de868c96156b4bb0c2b2758f043c38f1a07b44 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 20 Jul 2026 11:56:53 -0400 Subject: [PATCH 05/11] INSR-10442: Simplify isITAC conversion, more robust client-specific payload handling --- .../client-mappers/Client900040Coverage.js | 6 +++--- src/helpers/coverage-helper.js | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/helpers/client-mappers/Client900040Coverage.js b/src/helpers/client-mappers/Client900040Coverage.js index bed99f42..9008de2e 100644 --- a/src/helpers/client-mappers/Client900040Coverage.js +++ b/src/helpers/client-mappers/Client900040Coverage.js @@ -1,9 +1,9 @@ -import { useMainStore } from "@/store"; +import { useMainStore } from '@/store'; export function updateClaimRegistrationPayload(payload) { const mainStore = useMainStore(); payload.additionalInfo = { - offeredItac: mainStore.isITAC ? 'true' : 'false', - qualifiedForItac: mainStore.isITAC ? 'true' : 'false' + offeredItac: mainStore.isITAC.toString(), + qualifiedForItac: mainStore.isITAC.toString() } } \ No newline at end of file diff --git a/src/helpers/coverage-helper.js b/src/helpers/coverage-helper.js index 32d2b18e..18991e64 100644 --- a/src/helpers/coverage-helper.js +++ b/src/helpers/coverage-helper.js @@ -1,10 +1,20 @@ -import { useMainStore } from "@/store"; +import { useMainStore } from '@/store'; export async function updateClientSpecificFieldsForClaimRegistration(payload) { const mainStore = useMainStore(); + const parentAccountNumber = mainStore?.order?.parentAccountNumber; + if (!parentAccountNumber) { return; } + + let clientMapper; try { - const clientMapper = await import(`@/helpers/client-mappers/Client${mainStore.order.parentAccountNumber}Coverage.js`); - clientMapper.updateClaimRegistrationPayload(payload); + clientMapper = await import(`@/helpers/client-mappers/Client${parentAccountNumber}Coverage.js`); + } catch (error) { + // No client-specific mapper found; proceed with the default payload. + return; } - catch (error) { } + + if (typeof clientMapper.updateClaimRegistrationPayload === 'function') { + await clientMapper.updateClaimRegistrationPayload(payload); + } + } \ No newline at end of file From 471247696d4e9431c2b7a011bada34367f3dd8cc Mon Sep 17 00:00:00 2001 From: AHumphriesSL Date: Mon, 20 Jul 2026 12:08:01 -0400 Subject: [PATCH 06/11] Add missing semicolo Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/helpers/client-mappers/Client900040Coverage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/client-mappers/Client900040Coverage.js b/src/helpers/client-mappers/Client900040Coverage.js index 9008de2e..38ab396b 100644 --- a/src/helpers/client-mappers/Client900040Coverage.js +++ b/src/helpers/client-mappers/Client900040Coverage.js @@ -5,5 +5,5 @@ export function updateClaimRegistrationPayload(payload) { payload.additionalInfo = { offeredItac: mainStore.isITAC.toString(), qualifiedForItac: mainStore.isITAC.toString() - } + }; } \ No newline at end of file From ac8b485760b38d4c9a15708aa75086c282be5706 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 20 Jul 2026 13:05:05 -0400 Subject: [PATCH 07/11] INSR-10442: Fix spacing issue, add clarifying comment --- src/helpers/client-mappers/Client900040Coverage.js | 2 +- src/helpers/coverage-helper.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/helpers/client-mappers/Client900040Coverage.js b/src/helpers/client-mappers/Client900040Coverage.js index 38ab396b..316946ba 100644 --- a/src/helpers/client-mappers/Client900040Coverage.js +++ b/src/helpers/client-mappers/Client900040Coverage.js @@ -1,5 +1,5 @@ import { useMainStore } from '@/store'; - +// USAA coverage overrides export function updateClaimRegistrationPayload(payload) { const mainStore = useMainStore(); payload.additionalInfo = { diff --git a/src/helpers/coverage-helper.js b/src/helpers/coverage-helper.js index 18991e64..8cd5333f 100644 --- a/src/helpers/coverage-helper.js +++ b/src/helpers/coverage-helper.js @@ -2,8 +2,8 @@ import { useMainStore } from '@/store'; export async function updateClientSpecificFieldsForClaimRegistration(payload) { const mainStore = useMainStore(); - const parentAccountNumber = mainStore?.order?.parentAccountNumber; - if (!parentAccountNumber) { return; } + const parentAccountNumber = mainStore?.order?.parentAccountNumber; + if (!parentAccountNumber) { return; } let clientMapper; try { @@ -16,5 +16,4 @@ export async function updateClientSpecificFieldsForClaimRegistration(payload) { if (typeof clientMapper.updateClaimRegistrationPayload === 'function') { await clientMapper.updateClaimRegistrationPayload(payload); } - } \ No newline at end of file From 696a673ec70f2f61fdd6dc1ffeffc69ac0dce120 Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 20 Jul 2026 13:15:05 -0400 Subject: [PATCH 08/11] INSR-10442: Fix circular dependency --- src/helpers/client-mappers/Client900040Coverage.js | 9 ++++----- src/helpers/coverage-helper.js | 9 +++------ src/store/index.js | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/helpers/client-mappers/Client900040Coverage.js b/src/helpers/client-mappers/Client900040Coverage.js index 316946ba..44aaac68 100644 --- a/src/helpers/client-mappers/Client900040Coverage.js +++ b/src/helpers/client-mappers/Client900040Coverage.js @@ -1,9 +1,8 @@ -import { useMainStore } from '@/store'; // USAA coverage overrides -export function updateClaimRegistrationPayload(payload) { - const mainStore = useMainStore(); +export function updateClaimRegistrationPayload(payload, order) { + const isITAC = order.insuranceCoverage.coverageType === coverageType.ITAC; payload.additionalInfo = { - offeredItac: mainStore.isITAC.toString(), - qualifiedForItac: mainStore.isITAC.toString() + offeredItac: isITAC.toString(), + qualifiedForItac: isITAC.toString() }; } \ No newline at end of file diff --git a/src/helpers/coverage-helper.js b/src/helpers/coverage-helper.js index 8cd5333f..ee2be8f0 100644 --- a/src/helpers/coverage-helper.js +++ b/src/helpers/coverage-helper.js @@ -1,8 +1,5 @@ -import { useMainStore } from '@/store'; - -export async function updateClientSpecificFieldsForClaimRegistration(payload) { - const mainStore = useMainStore(); - const parentAccountNumber = mainStore?.order?.parentAccountNumber; +export async function updateClientSpecificFieldsForClaimRegistration(payload, order) { + const parentAccountNumber = order.parentAccountNumber; if (!parentAccountNumber) { return; } let clientMapper; @@ -14,6 +11,6 @@ export async function updateClientSpecificFieldsForClaimRegistration(payload) { } if (typeof clientMapper.updateClaimRegistrationPayload === 'function') { - await clientMapper.updateClaimRegistrationPayload(payload); + await clientMapper.updateClaimRegistrationPayload(payload, order); } } \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 9de98893..a6a8258e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -714,7 +714,7 @@ export const useMainStore = defineStore({ if (this.issConfig.useMemberNumber) { payload.memberNumber = this.order.policy.policyNumber; } - await updateClientSpecificFieldsForClaimRegistration(payload); + await updateClientSpecificFieldsForClaimRegistration(payload, this.order); const response = await globalMethods.callHttpClient({ method: endpoints.RegisterClaim.method, endpoint: endpoints.RegisterClaim.url, From 85d8448f247aa3626405f4aaa1748fd4432bc88f Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Mon, 20 Jul 2026 13:49:44 -0400 Subject: [PATCH 09/11] INSR-10442: Fix import and tests after previous change --- .../client-mappers/Client900040Coverage.js | 4 +++- src/helpers/coverage-helper.js | 2 +- src/helpers/coverage-helper.spec.js | 17 ++++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/helpers/client-mappers/Client900040Coverage.js b/src/helpers/client-mappers/Client900040Coverage.js index 44aaac68..37481ff7 100644 --- a/src/helpers/client-mappers/Client900040Coverage.js +++ b/src/helpers/client-mappers/Client900040Coverage.js @@ -1,6 +1,8 @@ +import coverageType from "@/constants/coverage-type"; + // USAA coverage overrides export function updateClaimRegistrationPayload(payload, order) { - const isITAC = order.insuranceCoverage.coverageType === coverageType.ITAC; + const isITAC = order.insuranceCoverage?.coverageType === coverageType.ITAC; payload.additionalInfo = { offeredItac: isITAC.toString(), qualifiedForItac: isITAC.toString() diff --git a/src/helpers/coverage-helper.js b/src/helpers/coverage-helper.js index ee2be8f0..1c3a8431 100644 --- a/src/helpers/coverage-helper.js +++ b/src/helpers/coverage-helper.js @@ -12,5 +12,5 @@ export async function updateClientSpecificFieldsForClaimRegistration(payload, or if (typeof clientMapper.updateClaimRegistrationPayload === 'function') { await clientMapper.updateClaimRegistrationPayload(payload, order); - } + } } \ No newline at end of file diff --git a/src/helpers/coverage-helper.spec.js b/src/helpers/coverage-helper.spec.js index 4bdac1c5..46481325 100644 --- a/src/helpers/coverage-helper.spec.js +++ b/src/helpers/coverage-helper.spec.js @@ -1,4 +1,5 @@ import { updateClientSpecificFieldsForClaimRegistration } from '@/helpers/coverage-helper'; +import coverageType from '@/constants/coverage-type'; let mockStore; @@ -11,9 +12,11 @@ describe('coverage-helper.js', () => { beforeEach(() => { mockStore = { order: { - parentAccountNumber: null - }, - isITAC: false + parentAccountNumber: null, + insuranceCoverage: { + coverageType: coverageType.NONE + } + } }; jest.clearAllMocks(); @@ -28,10 +31,10 @@ describe('coverage-helper.js', () => { // Arrange const payload = {}; mockStore.order.parentAccountNumber = parentAccountNumber; - mockStore.isITAC = isITAC; + mockStore.order.insuranceCoverage.coverageType = isITAC ? coverageType.ITAC : coverageType.Deductible; // Act - await updateClientSpecificFieldsForClaimRegistration(payload); + await updateClientSpecificFieldsForClaimRegistration(payload, mockStore.order); // Assert expect(payload.additionalInfo).toEqual({ @@ -45,10 +48,10 @@ describe('coverage-helper.js', () => { // Arrange const payload = {}; mockStore.order.parentAccountNumber = 123456; - mockStore.isITAC = true; + mockStore.order.insuranceCoverage.coverageType = coverageType.ITAC; // Act - await updateClientSpecificFieldsForClaimRegistration(payload); + await updateClientSpecificFieldsForClaimRegistration(payload, mockStore.order); // Assert expect(payload.additionalInfo).toBeUndefined(); From 3bd6d0051b57340bfe80fd8578b2ba91a7081cd8 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Mon, 20 Jul 2026 14:50:42 -0400 Subject: [PATCH 10/11] Added VinRequired field to digitalconsumer-session-logging call. --- src/mixins/analytics-mixin.js | 1 + src/store/index.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index 0da2a43d..19e0c70b 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -578,6 +578,7 @@ export default { sessionData.userAgent = navigator.userAgent; sessionData.bailoutCodeValue = bailoutCombinedString; + sessionData.vinRequired = order?.vehicle?.vinRequired ?? ""; store.logIssSessionData(sessionData); }, diff --git a/src/store/index.js b/src/store/index.js index a6a8258e..72c443ba 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2834,6 +2834,7 @@ export const useMainStore = defineStore({ userAgent, cashPriceSubTotal, bailoutCodeValue, + vinRequired, } ) { var payload = { @@ -2886,6 +2887,7 @@ export const useMainStore = defineStore({ cashPriceSubTotal: cashPriceSubTotal, billToAccountNumber: billToAccountNumber, bailoutCode: bailoutCodeValue, + vinRequired: vinRequired, }; return globalMethods.callHttpClient({ From 3e70a01a7580c2c537a607d5abbac840a8b87433 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Mon, 20 Jul 2026 14:53:42 -0400 Subject: [PATCH 11/11] Updates. --- src/mixins/analytics-mixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index 19e0c70b..afa79a6a 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -578,7 +578,7 @@ export default { sessionData.userAgent = navigator.userAgent; sessionData.bailoutCodeValue = bailoutCombinedString; - sessionData.vinRequired = order?.vehicle?.vinRequired ?? ""; + sessionData.vinRequired = order?.vehicle?.vinRequired ?? false; store.logIssSessionData(sessionData); },