Skip to content

Commit

Permalink
Merge pull request #697 from ymaheshwari1/#86cvzt9cc-#695
Browse files Browse the repository at this point in the history
Implemented: support to display trackingNumber information on the orderLookup details page(#695)
  • Loading branch information
ymaheshwari1 authored Aug 5, 2024
2 parents afa9029 + 87837f0 commit f7d7016
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/store/modules/orderLookup/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,16 @@ const actions: ActionTree<OrderLookupState, RootState> = {
},
viewSize: 50,
entityName: "OrderItemShipGroupAndFacility"
}, {
inputFields: {
orderId
},
fieldList: ["orderId", "shipGroupSeqId", "shipmentId", "trackingIdNumber"],
viewSize: 50,
entityName: "OrderShipmentAndRouteSegment"
}]

const [orderHeader, orderContactMech, orderIdentifications, orderAttributes, orderBrokeringInfo, orderStatusInfo, orderPaymentPreference, orderShipGroups] = await Promise.allSettled(apiPayload.map((payload: any) => OrderLookupService.performFind(payload)))
const [orderHeader, orderContactMech, orderIdentifications, orderAttributes, orderBrokeringInfo, orderStatusInfo, orderPaymentPreference, orderShipGroups, orderRouteSegment] = await Promise.allSettled(apiPayload.map((payload: any) => OrderLookupService.performFind(payload)))

if(orderHeader.status === "fulfilled" && !hasError(orderHeader.value) && orderHeader.value.data.count > 0) {
order = orderHeader.value.data.docs[0]
Expand Down Expand Up @@ -283,6 +290,11 @@ const actions: ActionTree<OrderLookupState, RootState> = {
const productIds: Array<string> = []
const shipmentMethodIds: Array<string> = []

const orderRouteSegmentInfo = orderRouteSegment.status === "fulfilled" && orderRouteSegment.value.data.docs.length > 0 ? orderRouteSegment.value.data.docs.reduce((orderSegmentInfo: any, routeSegment: any) => {
orderSegmentInfo[routeSegment.shipGroupSeqId] = routeSegment
return orderSegmentInfo
}, {}) : []

if(orderShipGroups.status === "fulfilled" && !hasError(orderShipGroups.value) && orderShipGroups.value.data.count > 0) {
shipGroups = orderShipGroups.value.data.docs.reduce((shipGroups: any, shipGroup: any) => {
productIds.push(shipGroup.productId)
Expand All @@ -292,7 +304,10 @@ const actions: ActionTree<OrderLookupState, RootState> = {
if(shipGroups[shipGroup.shipGroupSeqId]) {
shipGroups[shipGroup.shipGroupSeqId].push(shipGroup)
} else {
shipGroups[shipGroup.shipGroupSeqId] = [shipGroup]
shipGroups[shipGroup.shipGroupSeqId] = [{
...shipGroup,
trackingIdNumber: orderRouteSegmentInfo[shipGroup.shipGroupSeqId] ? orderRouteSegmentInfo[shipGroup.shipGroupSeqId].trackingIdNumber : ""
}]
}
return shipGroups;
}, {})
Expand Down
1 change: 1 addition & 0 deletions src/views/OrderLookupDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
<h1>{{ shipGroups[0].facilityName || shipGroups[0].facilityId }}</h1>
<p v-if="shipGroups[0].facilityId !== '_NA_'">{{ getShipmentMethodDesc(shipGroups[0].shipmentMethodTypeId) || shipGroups[0].shipmentMethodTypeId }}</p>
</ion-label>
<ion-label slot="end" v-if="shipGroups[0].trackingIdNumber">{{ translate("Tracking Code") }}{{ ":" }} {{ shipGroups[0].trackingIdNumber }}</ion-label>
</ion-item>

<div class="product-card">
Expand Down

0 comments on commit f7d7016

Please sign in to comment.