@mediocre/bloodhound
Advanced tools
Comparing version 1.11.1 to 1.11.2
@@ -7,7 +7,7 @@ const async = require('async'); | ||
// These tracking codes indicate the shipment was delivered | ||
const DELIVERED_TRACKING_STATUS_CODES = ['600', '607']; | ||
// These tracking codes indicate the shipment was delivered - [600, 607] | ||
const DELIVERED_TRACKING_DESCRIPTIONS = ['DELIVERED', 'SECOND DELIVERY ATTEMPT SUCCESSFUL']; | ||
// These tracking codes should indicate the shipment was shipped (shows movement beyond a shipping label being created) | ||
const SHIPPED_TRACKING_STATUS_CODES = ['520', '526', '540', '580', '598']; | ||
// These tracking codes should indicate the shipment was shipped (shows movement beyond a shipping label being created) - [350, 400, 520, 526, 540, 580, 598] | ||
const SHIPPED_TRACKING_DESCRIPTIONS = ['ARRIVAL DESTINATION DHL ECOMMERCE FACILITY', 'TENDERED TO DELIVERY SERVICE PROVIDER', 'ARRIVAL AT POST OFFICE', 'ARRIVED USPS SORT FACILITY', 'PROCESSED THROUGH USPS SORT FACILITY', 'OUT FOR SECOND DELIVERY ATTEMPT', 'OUT FOR DELIVERY']; | ||
// EST is listed as an abbreviation for the America/Chicago timezone. America/Boise lists MST, MDT, PST and PDT, and alphabetically comes before any other timezone that lists those abbreviations. The whole abbreviation situation is a mess in Moment Timezone. | ||
@@ -172,7 +172,7 @@ // Further, the generic 'ET', 'CT', etc. are not listed at all. Instead, we are just going to maintain our own mapping. | ||
if (!results.deliveredAt && _event.description && DELIVERED_TRACKING_STATUS_CODES.includes(event.primaryEventId.toString())) { | ||
if (!results.deliveredAt && _event.description && DELIVERED_TRACKING_DESCRIPTIONS.includes(_event.description.toUpperCase())) { | ||
results.deliveredAt = _event.date; | ||
} | ||
if (!results.shippedAt && _event.description && SHIPPED_TRACKING_STATUS_CODES.includes(event.primaryEventId.toString())) { | ||
if (!results.shippedAt && _event.description && SHIPPED_TRACKING_DESCRIPTIONS.includes(_event.description.toUpperCase())) { | ||
results.shippedAt = _event.date; | ||
@@ -179,0 +179,0 @@ } |
@@ -43,3 +43,3 @@ { | ||
}, | ||
"version": "1.11.1" | ||
"version": "1.11.2" | ||
} |
77190