rerobe-js-orm 4.2.4 → 4.2.6

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.
@@ -73,20 +73,20 @@ const measurementCategoryOptions = [
73
73
  value: 'Accessories',
74
74
  measurementFields: ['width', 'height', 'depth'],
75
75
  },
76
- {
77
- label: 'Bottoms (Jeans, Pants, Shorts, Skirts, etc.)',
78
- value: 'Bottoms (Jeans, Pants, Shorts, Skirts, etc.)',
79
- measurementFields: ['waistCircumference', 'innerLeg', 'outerLeg', 'footCircumference'],
80
- },
81
76
  {
82
77
  label: 'Bags',
83
78
  value: 'Bags',
84
79
  measurementFields: ['length', 'height', 'width', 'handDrop', 'shoulderDrop'],
85
80
  },
86
81
  {
87
- label: 'Jackets (Blazers, Outerwear, Coats)',
88
- value: 'Jackets (Blazers, Outerwear, Coats)',
89
- measurementFields: ['chestCircumference', 'waistCircumference', 'length', 'shoulderWidth', 'sleeveLength'],
82
+ label: 'Bottoms (Pants, Shorts, Skirts, etc.)',
83
+ value: 'Bottoms (Pants, Shorts, Skirts, etc.)',
84
+ measurementFields: ['waistCircumference', 'innerLeg', 'outerLeg', 'footCircumference'],
85
+ },
86
+ {
87
+ label: 'Collared Shirts & Tops',
88
+ value: 'Collared Shirts & Tops',
89
+ measurementFields: ['neckCircumference', 'collarLength', 'sleeveLength', 'chestCircumference'],
90
90
  },
91
91
  {
92
92
  label: 'Eyewear',
@@ -108,15 +108,37 @@ const measurementCategoryOptions = [
108
108
  value: 'Hats',
109
109
  measurementFields: ['headCircumference', 'brimWidth', 'crownHeight'],
110
110
  },
111
+ {
112
+ label: 'Jackets (Blazers, Outerwear, Coats)',
113
+ value: 'Jackets (Blazers, Outerwear, Coats)',
114
+ measurementFields: ['chestCircumference', 'waistCircumference', 'length', 'shoulderWidth', 'sleeveLength'],
115
+ },
116
+ {
117
+ label: 'Jeans',
118
+ value: 'Jeans',
119
+ measurementFields: ['waistCircumference', 'innerLeg', 'outerLeg', 'footCircumference'],
120
+ },
111
121
  {
112
122
  label: 'Jewelry',
113
123
  value: 'Jewelry',
114
124
  measurementFields: ['length', 'width', 'diameter'],
115
125
  },
116
126
  {
117
- label: 'Collared Shirts & Tops',
118
- value: 'Collared Shirts & Tops',
119
- measurementFields: ['neckCircumference', 'collarLength', 'sleeveLength', 'chestCircumference'],
127
+ label: 'Non-collared Shirts & Tops (Sweaters, Knitwear, etc.)',
128
+ value: 'Non-collared Shirts & Tops (Sweaters, Knitwear, etc.)',
129
+ measurementFields: ['chestCircumference', 'waistCircumference', 'length', 'shoulderWidth', 'sleeveLength'],
130
+ },
131
+ {
132
+ label: 'One-piece Apparel (Dresses, Jumpsuits, etc.)',
133
+ value: 'One-piece Apparel (Dresses, Jumpsuits, etc.)',
134
+ measurementFields: [
135
+ 'bustCircumference',
136
+ 'waistCircumference',
137
+ 'hipCircumference',
138
+ 'length',
139
+ 'shoulderWidth',
140
+ 'sleeveLength',
141
+ ],
120
142
  },
121
143
  {
122
144
  label: 'Shoes',
@@ -124,8 +146,8 @@ const measurementCategoryOptions = [
124
146
  measurementFields: ['footLength', 'footWidth', 'heelHeight', 'shaftHeight', 'calfCircumference'],
125
147
  },
126
148
  {
127
- label: 'Suits',
128
- value: 'Suits',
149
+ label: 'Suits & Sets',
150
+ value: 'Suits & Sets',
129
151
  measurementFields: [
130
152
  'chestCircumference',
131
153
  'length',
@@ -137,23 +159,6 @@ const measurementCategoryOptions = [
137
159
  'footCircumference',
138
160
  ],
139
161
  },
140
- {
141
- label: 'Non-collared Shirts & Tops (Sweaters, Knitwear, etc.)',
142
- value: 'Non-collared Shirts & Tops (Sweaters, Knitwear, etc.)',
143
- measurementFields: ['chestCircumference', 'waistCircumference', 'length', 'shoulderWidth', 'sleeveLength'],
144
- },
145
- {
146
- label: 'One-piece Apparel (Dresses, Jumpsuits, etc.)',
147
- value: 'One-piece Apparel (Dresses, Jumpsuits, etc.)',
148
- measurementFields: [
149
- 'bustCircumference',
150
- 'waistCircumference',
151
- 'hipCircumference',
152
- 'length',
153
- 'shoulderWidth',
154
- 'sleeveLength',
155
- ],
156
- },
157
162
  {
158
163
  label: 'Tops (Blouses, Shirts, Sweaters, etc.)',
159
164
  value: 'Tops (Blouses, Shirts, Sweaters, etc.)',
@@ -80,7 +80,7 @@ class Utilities {
80
80
  }
81
81
  sanitizeMillisTimeStamp(t) {
82
82
  if (t && typeof t === 'number') {
83
- return t;
83
+ return Math.max(t, 0);
84
84
  }
85
85
  if (t && typeof t === 'string') {
86
86
  const result = Date.parse(t);
@@ -60,11 +60,11 @@ export default class Product extends Base {
60
60
  label: string;
61
61
  value: string;
62
62
  }[];
63
+ sanitizeCommission(): number;
63
64
  private materialCompTagsArrayForShopify;
64
65
  private materialCompJoinedString;
65
66
  private measurementsJoinedString;
66
67
  private convertMaterialCompJoinedStrToObj;
67
68
  private sanitizeMaterialComp;
68
- private sanitizeCommission;
69
69
  private validateInventoryLocation;
70
70
  }
@@ -316,7 +316,7 @@ class Product extends Base_1.default {
316
316
  productCategory: this.utilities.sanitizeString(this.filterAttributes.productCategory),
317
317
  productType: this.utilities.sanitizeString(this.filterAttributes.productType),
318
318
  productStyle: this.utilities.sanitzeStringArr(this.filterAttributes.productStyle),
319
- calculatedCommission: this.utilities.sanitizeNumber(calculatedCommission),
319
+ calculatedCommission: this.utilities.sanitizeNumber(calculatedCommission, this.sanitizeCommission()),
320
320
  reRobeCommission: this.sanitizeCommission(),
321
321
  rfidTag: this.utilities.sanitizeString(this.attributes.rfidTag),
322
322
  sku: this.utilities.sanitizeString(this.attributes.sku),
@@ -1000,6 +1000,12 @@ class Product extends Base_1.default {
1000
1000
  value: key,
1001
1001
  };
1002
1002
  }
1003
+ if (key === 'size') {
1004
+ return {
1005
+ label: 'Label Size',
1006
+ value: key,
1007
+ };
1008
+ }
1003
1009
  if (key === 'gender') {
1004
1010
  return {
1005
1011
  label: this.utilities.humanize('primarySegment'),
@@ -1017,9 +1023,18 @@ class Product extends Base_1.default {
1017
1023
  value: key,
1018
1024
  };
1019
1025
  })
1020
- .filter((obj) => ![...restrictedKeys, ...systemManagedKeys, ...configurableAfterCreationKeys, ...obsoleteKeys].includes(obj.value));
1026
+ .filter((obj) => ![
1027
+ ...restrictedKeys,
1028
+ ...systemManagedKeys,
1029
+ ...configurableAfterCreationKeys,
1030
+ ...obsoleteKeys,
1031
+ ...timestampAttributeKeys,
1032
+ ].includes(obj.value));
1021
1033
  return options;
1022
1034
  }
1035
+ sanitizeCommission() {
1036
+ return parseFloat(ReRobeProductHelpers_1.default.commissionFixer(this.consignmentAttributes.reRobeCommission));
1037
+ }
1023
1038
  materialCompTagsArrayForShopify() {
1024
1039
  return Object.keys(this.filterAttributes.materialComposition).reduce((acc, cur, idx) => {
1025
1040
  acc.push(`${cur} ${Object.values(this.filterAttributes.materialComposition)[idx]}`);
@@ -1087,16 +1102,6 @@ class Product extends Base_1.default {
1087
1102
  }
1088
1103
  return materialComp;
1089
1104
  }
1090
- sanitizeCommission() {
1091
- const com = this.consignmentAttributes.reRobeCommission;
1092
- if (Number.isNaN(parseFloat(String(com)))) {
1093
- return 0.5;
1094
- }
1095
- if (parseFloat(String(com)) <= 1) {
1096
- return parseFloat(String(com));
1097
- }
1098
- return parseFloat(String(com)) / 100;
1099
- }
1100
1105
  validateInventoryLocation(locationLike) {
1101
1106
  if (locationLike && Array.isArray(locationLike) && locationLike.length > 0) {
1102
1107
  return locationLike
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "4.2.4",
3
+ "version": "4.2.6",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",