Merge pull request #853 from Safelite/feature/digital/SSR-1489

SSR-1489 Update to mobile-fee endpoint
This commit is contained in:
Josh Dassinger 2024-09-27 08:16:19 -05:00 committed by GitHub
commit f9ba781ec4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 4 deletions

View file

@ -12,7 +12,16 @@ const coverageStatuses = Object.freeze({
/** /**
* We have attempted claim registration, and we got a success response * We have attempted claim registration, and we got a success response
*/ */
VERIFIED: 2 VERIFIED: 2,
mapToApi: (status) => {
switch (status) {
case coverageStatuses.PENDING: return 'Pending';
case coverageStatuses.NO_COVERAGE: return 'NoCoverage';
case coverageStatuses.VERIFIED: return 'Verified';
default: return null;
}
}
}); });
export default coverageStatuses; export default coverageStatuses;

View file

@ -22,7 +22,17 @@ const coverageType = Object.freeze({
* The vehicle policy does not have comprehensive coverage * The vehicle policy does not have comprehensive coverage
* No Comp quotes are enabled by the client * No Comp quotes are enabled by the client
*/ */
NO_COMP: 3 NO_COMP: 3,
mapToApi: (status) => {
switch (status) {
case coverageType.None: return 'None';
case coverageType.Deductible: return 'Deductible';
case coverageType.ITAC: return 'ITAC';
case coverageType.NO_COMP: return 'NoComp';
default: return null;
}
}
}); });
export default coverageType; export default coverageType;

View file

@ -1205,11 +1205,23 @@ export const useMainStore = defineStore({
}, },
getMobileFeePart() { getMobileFeePart() {
const damageType = this.damage.isRepair ? 'Repair' : 'Replace'; const { vehicle, insuranceCoverage } = this.order;
const params = new URLSearchParams({
serviceType: this.damage.isRepair ? 'Repair' : 'Install',
facilityType: 'Mobile',
parentAccountNumber: this.order.parentAccountNumber,
billToAccountNumber: this.billToAccountNumber,
isItacOptimized: false, //TODO: Implement with response from getITACPriceOrderItems
providerNumber: this.providerNumber,
carId: vehicle.carId,
coverageStatus: coverageStatuses.mapToApi(insuranceCoverage.coverageStatus),
coverageType: coverageType.mapToApi(insuranceCoverage.coverageType)
});
return globalMethods.callHttpClient({ return globalMethods.callHttpClient({
method: endpoints.GetMobileFeePart.method, method: endpoints.GetMobileFeePart.method,
endpoint: `${endpoints.GetMobileFeePart.url}/${damageType}/${this.order.parentAccountNumber}/${this.billToAccountNumber}` endpoint: `${endpoints.GetMobileFeePart.url}?${params.toString()}`
}); });
}, },