Merge pull request #881 from Safelite/feature/CSR-984
CSR-984 only persist to Dynamo fields not in sv2/salesforce
This commit is contained in:
commit
8b6d25c76a
3 changed files with 26 additions and 12 deletions
|
|
@ -88,7 +88,7 @@ const endpoints = {
|
||||||
},
|
},
|
||||||
LoadSession: {
|
LoadSession: {
|
||||||
url: "/order/api/v1/order/load-session",
|
url: "/order/api/v1/order/load-session",
|
||||||
method: "GET",
|
method: "POST",
|
||||||
},
|
},
|
||||||
ValidateZip: {
|
ValidateZip: {
|
||||||
url: "/location/api/v1/location/zip",
|
url: "/location/api/v1/location/zip",
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,12 @@ export async function loadSessionIfPresent(isConceptInsurance) {
|
||||||
const funnelCookie = getFunnelCookie();
|
const funnelCookie = getFunnelCookie();
|
||||||
|
|
||||||
// Do nothing if there is no cookie or session to use for loading.
|
// Do nothing if there is no cookie or session to use for loading.
|
||||||
if (funnelCookie == null || funnelCookie.SavedSessionId == null) {
|
if (
|
||||||
|
funnelCookie == null ||
|
||||||
|
funnelCookie.SavedSessionId == null ||
|
||||||
|
funnelCookie.ReferralCorrelationId == null ||
|
||||||
|
!funnelCookie.ReferralNumber
|
||||||
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,6 +39,7 @@ export async function loadSessionIfPresent(isConceptInsurance) {
|
||||||
await loadSession(
|
await loadSession(
|
||||||
funnelCookie.SavedSessionId,
|
funnelCookie.SavedSessionId,
|
||||||
funnelCookie.ReferralNumber,
|
funnelCookie.ReferralNumber,
|
||||||
|
funnelCookie.ReferralDate,
|
||||||
funnelCookie.ReferralParentAccountNumber,
|
funnelCookie.ReferralParentAccountNumber,
|
||||||
funnelCookie.ReferralCorrelationId,
|
funnelCookie.ReferralCorrelationId,
|
||||||
isConceptInsurance
|
isConceptInsurance
|
||||||
|
|
@ -72,6 +78,7 @@ export async function saveSession() {
|
||||||
async function loadSession(
|
async function loadSession(
|
||||||
savedSessionId,
|
savedSessionId,
|
||||||
referralNumber,
|
referralNumber,
|
||||||
|
referralDate,
|
||||||
accountNumber,
|
accountNumber,
|
||||||
referralCorrelationId,
|
referralCorrelationId,
|
||||||
isConceptInsurance
|
isConceptInsurance
|
||||||
|
|
@ -84,6 +91,7 @@ async function loadSession(
|
||||||
{
|
{
|
||||||
savedSessionId: savedSessionId?.toString(),
|
savedSessionId: savedSessionId?.toString(),
|
||||||
referralNumber,
|
referralNumber,
|
||||||
|
referralDate,
|
||||||
accountNumber,
|
accountNumber,
|
||||||
referralCorrelationId,
|
referralCorrelationId,
|
||||||
isConceptInsurance,
|
isConceptInsurance,
|
||||||
|
|
|
||||||
|
|
@ -1041,22 +1041,28 @@ export const actions = {
|
||||||
},
|
},
|
||||||
loadSession(
|
loadSession(
|
||||||
context,
|
context,
|
||||||
{ savedSessionId, referralNumber, referralCorrelationId, accountNumber, isConceptInsurance }
|
{
|
||||||
|
savedSessionId,
|
||||||
|
referralNumber,
|
||||||
|
referralDate,
|
||||||
|
referralCorrelationId,
|
||||||
|
accountNumber,
|
||||||
|
isConceptInsurance,
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
const order = context.state.order;
|
const order = context.state.order;
|
||||||
|
|
||||||
return globalMethods
|
return globalMethods
|
||||||
.callHttpClient({
|
.callHttpClient({
|
||||||
method: endpoints.LoadSession.method,
|
method: endpoints.LoadSession.method,
|
||||||
endpoint: `${
|
endpoint: endpoints.LoadSession.url,
|
||||||
endpoints.LoadSession.url
|
payload: {
|
||||||
}?savedSessionId=${savedSessionId?.toString()}&referralNumber=${
|
savedSessionId: savedSessionId?.toString(),
|
||||||
referralNumber && referralNumber !== "" ? referralNumber : order.referralNumber
|
referralNumber: referralNumber?.toString(),
|
||||||
}&accountNumber=${accountNumber}&referralCorrelationId=${
|
referralDate: referralDate?.toString(),
|
||||||
referralCorrelationId !== ""
|
accountNumber: accountNumber?.toString(),
|
||||||
? referralCorrelationId
|
referralCorrelationId: referralCorrelationId,
|
||||||
: order.referralCorrelationId
|
},
|
||||||
}`,
|
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
// Flatten location and name properties
|
// Flatten location and name properties
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue