SSR-1169. Refactor to use parentAccountNumber. (#704)
This commit is contained in:
parent
3a032f6b49
commit
61beb2bbe6
7 changed files with 20 additions and 19 deletions
|
|
@ -193,7 +193,7 @@ const endpoints = Object.freeze({
|
||||||
},
|
},
|
||||||
DuplicateSearch: {
|
DuplicateSearch: {
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
url: (accountNumber, policyNumber, dateOfLoss) => `${ORDER_BASE_URL}/duplicate-check/${accountNumber}/${policyNumber}/${dateOfLoss}`,
|
url: (parentAccountNumber, policyNumber, dateOfLoss) => `${ORDER_BASE_URL}/duplicate-check/${parentAccountNumber}/${policyNumber}/${dateOfLoss}`,
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
},
|
},
|
||||||
FinalDeductible: {
|
FinalDeductible: {
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ export function updateOrCreateISSCookie() {
|
||||||
ReferralNumber: store.order.referralNumber,
|
ReferralNumber: store.order.referralNumber,
|
||||||
ReferralDate: store.order.referralDate,
|
ReferralDate: store.order.referralDate,
|
||||||
ReferralCorrelationId: store.order.referralCorrelationId,
|
ReferralCorrelationId: store.order.referralCorrelationId,
|
||||||
ReferralParentAccountNumber: store.order.accountNumber,
|
ReferralParentAccountNumber: store.order.parentAccountNumber,
|
||||||
SavedSessionId: store.applicationUser.savedSessionId
|
SavedSessionId: store.applicationUser.savedSessionId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ Object {
|
||||||
"loadedFromDupeCheck": null,
|
"loadedFromDupeCheck": null,
|
||||||
"loadedSessionClearedPreviousData": null,
|
"loadedSessionClearedPreviousData": null,
|
||||||
"originalDeductible": null,
|
"originalDeductible": null,
|
||||||
|
"parentAccountNumber": null,
|
||||||
"payment": Object {
|
"payment": Object {
|
||||||
"creditCardToken": Object {
|
"creditCardToken": Object {
|
||||||
"authCode": null,
|
"authCode": null,
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,6 @@ describe('navigation', () => {
|
||||||
|
|
||||||
useMainStore().order.policy.policyNumber = 'p_0001';
|
useMainStore().order.policy.policyNumber = 'p_0001';
|
||||||
useMainStore().order.policy.dateOfLoss = '2022-01-28';
|
useMainStore().order.policy.dateOfLoss = '2022-01-28';
|
||||||
useMainStore().order.accountNumber = '00000';
|
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ export default {
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
|
|
||||||
// Set order account number from the issConfig.
|
// Set order account number from the issConfig.
|
||||||
mainStore.order.accountNumber = mainStore.issConfig.parentAccountNumber;
|
mainStore.order.parentAccountNumber = mainStore.issConfig.parentAccountNumber;
|
||||||
|
|
||||||
return { mainStore };
|
return { mainStore };
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,7 @@ export const getDefaultState = () => ({
|
||||||
jobMaxMinutes: null,
|
jobMaxMinutes: null,
|
||||||
jobMinMinutes: null
|
jobMinMinutes: null
|
||||||
},
|
},
|
||||||
|
parentAccountNumber: null,
|
||||||
referralNumber: null,
|
referralNumber: null,
|
||||||
referralDate: null,
|
referralDate: null,
|
||||||
referralCorrelationId: '00000000-0000-0000-0000-000000000000',
|
referralCorrelationId: '00000000-0000-0000-0000-000000000000',
|
||||||
|
|
@ -400,7 +401,7 @@ export const useMainStore = defineStore({
|
||||||
funnelServices: s.order.serviceLocation.state,
|
funnelServices: s.order.serviceLocation.state,
|
||||||
funnelServiceZipCode: s.order.serviceLocation.zipCode,
|
funnelServiceZipCode: s.order.serviceLocation.zipCode,
|
||||||
funnelServiceZipCodeCtu: ctuToUse,
|
funnelServiceZipCodeCtu: ctuToUse,
|
||||||
funnelParentAccountNumber: s.order.accountNumber,
|
funnelParentAccountNumber: s.order.parentAccountNumber,
|
||||||
funnelProviderNumber: s.order.serviceLocation.provider.providerNumber,
|
funnelProviderNumber: s.order.serviceLocation.provider.providerNumber,
|
||||||
funnelIsCoverageVerified: s.order.payment.insuranceCoverage.isVerified,
|
funnelIsCoverageVerified: s.order.payment.insuranceCoverage.isVerified,
|
||||||
funnelHasRecalibrationPart: getHasRecalibrationPart(s),
|
funnelHasRecalibrationPart: getHasRecalibrationPart(s),
|
||||||
|
|
@ -548,7 +549,7 @@ export const useMainStore = defineStore({
|
||||||
method: endpoints.CoveragePolicyInfo.method,
|
method: endpoints.CoveragePolicyInfo.method,
|
||||||
endpoint: endpoints.CoveragePolicyInfo.url,
|
endpoint: endpoints.CoveragePolicyInfo.url,
|
||||||
payload: {
|
payload: {
|
||||||
accountNumber: order.accountNumber?.toString(),
|
accountNumber: order.parentAccountNumber?.toString(),
|
||||||
policyNumber: policy.policyNumber,
|
policyNumber: policy.policyNumber,
|
||||||
dateOfLoss: policy.dateOfLoss,
|
dateOfLoss: policy.dateOfLoss,
|
||||||
zipCode: policy.policyZipCode,
|
zipCode: policy.policyZipCode,
|
||||||
|
|
@ -1060,7 +1061,7 @@ export const useMainStore = defineStore({
|
||||||
const lineItemsQueryString = getLineItemQueryString(availableLineItems, 'lineItems');
|
const lineItemsQueryString = getLineItemQueryString(availableLineItems, 'lineItems');
|
||||||
|
|
||||||
let queryString =
|
let queryString =
|
||||||
`ParentAccountNumber=${this.order.accountNumber}`
|
`ParentAccountNumber=${this.order.parentAccountNumber}`
|
||||||
+ `&BillToAccountNumber=${this.billToNumberToUse}`
|
+ `&BillToAccountNumber=${this.billToNumberToUse}`
|
||||||
+ `&CTU=${ctuToUse}`
|
+ `&CTU=${ctuToUse}`
|
||||||
+ `&Deductible=${deductibleToUse}`
|
+ `&Deductible=${deductibleToUse}`
|
||||||
|
|
@ -1098,7 +1099,7 @@ export const useMainStore = defineStore({
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetMobileFeePart.method,
|
method: endpoints.GetMobileFeePart.method,
|
||||||
endpoint: `${endpoints.GetMobileFeePart.url}/${damageType}/${this.order.accountNumber}/${this.billToNumberToUse}`
|
endpoint: `${endpoints.GetMobileFeePart.url}/${damageType}/${this.order.parentAccountNumber}/${this.billToNumberToUse}`
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -2027,7 +2028,7 @@ export const useMainStore = defineStore({
|
||||||
if (appointmentType === AppointmentTypeStrings.MOBILE
|
if (appointmentType === AppointmentTypeStrings.MOBILE
|
||||||
|| appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP) {
|
|| appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP) {
|
||||||
queryString =
|
queryString =
|
||||||
`ParentAccountNumber=${this.order.accountNumber}`
|
`ParentAccountNumber=${this.order.parentAccountNumber}`
|
||||||
+ `&BillToAccountNumber=${this.billToNumberToUse}`
|
+ `&BillToAccountNumber=${this.billToNumberToUse}`
|
||||||
+ `&ProviderNumber=${providerNumber}`
|
+ `&ProviderNumber=${providerNumber}`
|
||||||
+ `&AppointmentType=${appointmentType}`
|
+ `&AppointmentType=${appointmentType}`
|
||||||
|
|
@ -2037,7 +2038,7 @@ export const useMainStore = defineStore({
|
||||||
+ `${lineItemsQueryString}`;
|
+ `${lineItemsQueryString}`;
|
||||||
} else {
|
} else {
|
||||||
queryString =
|
queryString =
|
||||||
`ParentAccountNumber=${this.order.accountNumber}`
|
`ParentAccountNumber=${this.order.parentAccountNumber}`
|
||||||
+ `&BillToAccountNumber=${this.billToNumberToUse}`
|
+ `&BillToAccountNumber=${this.billToNumberToUse}`
|
||||||
+ `&ProviderNumber=${providerNumber}`
|
+ `&ProviderNumber=${providerNumber}`
|
||||||
+ `&AppointmentType=${appointmentType}`
|
+ `&AppointmentType=${appointmentType}`
|
||||||
|
|
|
||||||
|
|
@ -1229,12 +1229,12 @@ describe('Store', () => {
|
||||||
});
|
});
|
||||||
it('calls api with expected data', async () => {
|
it('calls api with expected data', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const accountNumber = getRandomString(6, 6);
|
const parentAccountNumber = getRandomString(6, 6);
|
||||||
const policyNumber = getRandomString(6, 6);
|
const policyNumber = getRandomString(6, 6);
|
||||||
const dateOfLoss = getRandomString(6, 6);
|
const dateOfLoss = getRandomString(6, 6);
|
||||||
const zipCode = getRandomString(6, 6);
|
const zipCode = getRandomString(6, 6);
|
||||||
const referralCorrelationId = getRandomString(6, 6);
|
const referralCorrelationId = getRandomString(6, 6);
|
||||||
store.order.accountNumber = accountNumber;
|
store.order.parentAccountNumber = parentAccountNumber;
|
||||||
store.order.policy.policyNumber = policyNumber;
|
store.order.policy.policyNumber = policyNumber;
|
||||||
store.order.policy.dateOfLoss = dateOfLoss;
|
store.order.policy.dateOfLoss = dateOfLoss;
|
||||||
store.order.policy.policyZipCode = zipCode;
|
store.order.policy.policyZipCode = zipCode;
|
||||||
|
|
@ -1247,7 +1247,7 @@ describe('Store', () => {
|
||||||
// Asserts
|
// Asserts
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining({
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining({
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
accountNumber,
|
accountNumber: parentAccountNumber,
|
||||||
policyNumber,
|
policyNumber,
|
||||||
dateOfLoss,
|
dateOfLoss,
|
||||||
zipCode,
|
zipCode,
|
||||||
|
|
@ -1679,7 +1679,7 @@ describe('Store', () => {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
const referralCorrelationId = getRandomGuid();
|
const referralCorrelationId = getRandomGuid();
|
||||||
const accountNumber = getRandomString(6, 6);
|
const parentAccountNumber = getRandomString(6, 6);
|
||||||
const endorsements = [];
|
const endorsements = [];
|
||||||
const manualGlassNames = [location];
|
const manualGlassNames = [location];
|
||||||
const policyState = getRandomString(2, 2);
|
const policyState = getRandomString(2, 2);
|
||||||
|
|
@ -1698,7 +1698,7 @@ describe('Store', () => {
|
||||||
const isItac = getRandomBoolean();
|
const isItac = getRandomBoolean();
|
||||||
|
|
||||||
store.order.referralCorrelationId = referralCorrelationId;
|
store.order.referralCorrelationId = referralCorrelationId;
|
||||||
store.issConfig.parentAccountNumber = accountNumber;
|
store.issConfig.parentAccountNumber = parentAccountNumber;
|
||||||
store.order.currentDeductible = currentDeductible;
|
store.order.currentDeductible = currentDeductible;
|
||||||
store.order.originalDeductible = originalDeductible;
|
store.order.originalDeductible = originalDeductible;
|
||||||
store.order.policy.noCoverage = noCoverage;
|
store.order.policy.noCoverage = noCoverage;
|
||||||
|
|
@ -1726,7 +1726,7 @@ describe('Store', () => {
|
||||||
endpoint: endpoints.FinalDeductible.url,
|
endpoint: endpoints.FinalDeductible.url,
|
||||||
payload: ({
|
payload: ({
|
||||||
referralCorrelationId,
|
referralCorrelationId,
|
||||||
accountNumber,
|
accountNumber: parentAccountNumber,
|
||||||
endorsements,
|
endorsements,
|
||||||
manualGlassNames,
|
manualGlassNames,
|
||||||
policyState,
|
policyState,
|
||||||
|
|
@ -1762,7 +1762,7 @@ describe('Store', () => {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
const referralCorrelationId = getRandomGuid();
|
const referralCorrelationId = getRandomGuid();
|
||||||
const accountNumber = getRandomString(6, 6);
|
const parentAccountNumber = getRandomString(6, 6);
|
||||||
const manualGlassNames = [location];
|
const manualGlassNames = [location];
|
||||||
const policyState = getRandomString(2, 2);
|
const policyState = getRandomString(2, 2);
|
||||||
const status = getRandomString(6, 8);
|
const status = getRandomString(6, 8);
|
||||||
|
|
@ -1800,7 +1800,7 @@ describe('Store', () => {
|
||||||
const isItac = false;
|
const isItac = false;
|
||||||
|
|
||||||
store.order.referralCorrelationId = referralCorrelationId;
|
store.order.referralCorrelationId = referralCorrelationId;
|
||||||
store.issConfig.parentAccountNumber = accountNumber;
|
store.issConfig.parentAccountNumber = parentAccountNumber;
|
||||||
store.order.currentDeductible = currentDeductible;
|
store.order.currentDeductible = currentDeductible;
|
||||||
store.order.originalDeductible = originalDeductible;
|
store.order.originalDeductible = originalDeductible;
|
||||||
store.order.policy.noCoverage = noCoverage;
|
store.order.policy.noCoverage = noCoverage;
|
||||||
|
|
@ -1830,7 +1830,7 @@ describe('Store', () => {
|
||||||
endpoint: endpoints.FinalDeductible.url,
|
endpoint: endpoints.FinalDeductible.url,
|
||||||
payload: ({
|
payload: ({
|
||||||
referralCorrelationId,
|
referralCorrelationId,
|
||||||
accountNumber,
|
accountNumber: parentAccountNumber,
|
||||||
endorsements: expected,
|
endorsements: expected,
|
||||||
manualGlassNames,
|
manualGlassNames,
|
||||||
policyState,
|
policyState,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue