@shushed/helpers 0.0.305 → 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.
@@ -670,7 +670,7 @@ function transformMasterOrder(payload) {
670
670
  const shipDiscGross = isFirstShipment ? deliveryDiscountGrossMinor : 0;
671
671
  const shipDiscNet = isFirstShipment ? deliveryDiscountNetMinor : 0;
672
672
  const statusVal = shipmentLines.length > 0 ? "SHIPPED" : "PENDING";
673
- return {
673
+ const result = {
674
674
  erp_id: s.no || s.system_id || "",
675
675
  shipped_at: normalizeDateTime(s.shipment_date),
676
676
  status: statusVal,
@@ -687,6 +687,12 @@ function transformMasterOrder(payload) {
687
687
  discount_amount_gross: moneyFromMinor(shipDiscGross),
688
688
  discount_amount_percent: 0,
689
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;
690
696
  });
691
697
  const shipmentsBySku = new Map();
692
698
  (payload.shipments || []).forEach((s) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.305",
3
+ "version": "0.0.306",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",