@shushed/helpers 0.0.304 → 0.0.306

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -601,6 +601,12 @@ function transformMasterOrder(payload) {
601
601
  if (code === 'TRACKED48') {
602
602
  return 'EVRI';
603
603
  }
604
+ if (code === 'HSHERMES48') {
605
+ return 'EVRI';
606
+ }
607
+ if (code === 'HSHERMES24') {
608
+ return 'EVRI';
609
+ }
604
610
  if (code === 'EVRID') {
605
611
  return 'EVRI';
606
612
  }
@@ -664,7 +670,7 @@ function transformMasterOrder(payload) {
664
670
  const shipDiscGross = isFirstShipment ? deliveryDiscountGrossMinor : 0;
665
671
  const shipDiscNet = isFirstShipment ? deliveryDiscountNetMinor : 0;
666
672
  const statusVal = shipmentLines.length > 0 ? "SHIPPED" : "PENDING";
667
- return {
673
+ const result = {
668
674
  erp_id: s.no || s.system_id || "",
669
675
  shipped_at: normalizeDateTime(s.shipment_date),
670
676
  status: statusVal,
@@ -681,6 +687,12 @@ function transformMasterOrder(payload) {
681
687
  discount_amount_gross: moneyFromMinor(shipDiscGross),
682
688
  discount_amount_percent: 0,
683
689
  };
690
+ if (!result.courier_name && result.tracking_code) {
691
+ if (result.tracking_code.startsWith('H0')) {
692
+ result.courier_name = 'EVRI';
693
+ }
694
+ }
695
+ return result;
684
696
  });
685
697
  const shipmentsBySku = new Map();
686
698
  (payload.shipments || []).forEach((s) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.304",
3
+ "version": "0.0.306",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",