rerobe-js-orm 3.0.29 → 3.0.31

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.
@@ -27,3 +27,47 @@ export namespace PRODUCT_STATES {
27
27
  const reservationQueue: string;
28
28
  const availableInStore: string;
29
29
  }
30
+ export namespace MEASUREMENT_CATEGORY {
31
+ const SuitsNBlazers: string;
32
+ const Bottoms: string;
33
+ const Shirts: string;
34
+ const Shoes: string;
35
+ const Accessories: string;
36
+ const Coats: string;
37
+ const Dresses: string;
38
+ const Hats: string;
39
+ const Gloves: string;
40
+ const Eyewear: string;
41
+ const GeneralItems: string;
42
+ }
43
+ export namespace MEASUREMENT_FIELDS_DICT {
44
+ const length: string;
45
+ const width: string;
46
+ const height: string;
47
+ const depth: string;
48
+ const lensWidth: string;
49
+ const bridgeWidth: string;
50
+ const templeLength: string;
51
+ const handLength: string;
52
+ const handCircumference: string;
53
+ const fingerLength: string;
54
+ const headCircumference: string;
55
+ const brimWidth: string;
56
+ const crownHeight: string;
57
+ const bustCircumference: string;
58
+ const waistCircumference: string;
59
+ const hipCircumference: string;
60
+ const shoulderWidth: string;
61
+ const sleeveLength: string;
62
+ const footLength: string;
63
+ const footWidth: string;
64
+ const heelHeight: string;
65
+ const shaftHeight: string;
66
+ const calfCircumference: string;
67
+ const chestCircumference: string;
68
+ const neckCircumference: string;
69
+ const collarLength: string;
70
+ const innerLeg: string;
71
+ const outerLeg: string;
72
+ const footCircumference: string;
73
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PRODUCT_STATES = void 0;
3
+ exports.MEASUREMENT_FIELDS_DICT = exports.MEASUREMENT_CATEGORY = exports.PRODUCT_STATES = void 0;
4
4
  exports.PRODUCT_STATES = {
5
5
  archived: 'ARCHIVED',
6
6
  sellRequestReview: 'SELL_REQUEST_REVIEW',
@@ -30,3 +30,47 @@ exports.PRODUCT_STATES = {
30
30
  reservationQueue: 'IN_RESERVATION_QUEUE',
31
31
  availableInStore: 'AVAILABLE_IN_STORE',
32
32
  };
33
+ exports.MEASUREMENT_CATEGORY = {
34
+ SuitsNBlazers: 'Suits & Blazers',
35
+ Bottoms: 'Bottoms',
36
+ Shirts: 'Shirts',
37
+ Shoes: 'Shoes',
38
+ Accessories: 'Accessories',
39
+ Coats: 'Coats',
40
+ Dresses: 'Dresses',
41
+ Hats: 'Hats',
42
+ Gloves: 'Gloves',
43
+ Eyewear: 'Eyewear',
44
+ GeneralItems: 'General Items',
45
+ };
46
+ exports.MEASUREMENT_FIELDS_DICT = {
47
+ length: 'Length',
48
+ width: 'Width',
49
+ height: 'Height',
50
+ depth: 'Depth',
51
+ lensWidth: 'Lens Width',
52
+ bridgeWidth: 'Bridge Width',
53
+ templeLength: 'Temple Width',
54
+ handLength: 'Hand Length',
55
+ handCircumference: 'Hand Circumference',
56
+ fingerLength: 'Finger Length',
57
+ headCircumference: 'Head Circumference',
58
+ brimWidth: 'Brim Width',
59
+ crownHeight: 'Crown Height',
60
+ bustCircumference: 'Bust Circumference',
61
+ waistCircumference: 'Waist Circumference',
62
+ hipCircumference: 'Hip Circumference',
63
+ shoulderWidth: 'Shoulder Width',
64
+ sleeveLength: 'Sleeve Length',
65
+ footLength: 'Foot Length',
66
+ footWidth: 'Foot Width',
67
+ heelHeight: 'Heel Height',
68
+ shaftHeight: 'Shaft Height',
69
+ calfCircumference: 'Calf Circumference',
70
+ chestCircumference: 'Chest Circumference',
71
+ neckCircumference: 'Neck Circumference',
72
+ collarLength: 'Collar Length',
73
+ innerLeg: 'Inner Leg',
74
+ outerLeg: 'Outer Leg',
75
+ footCircumference: 'Foot Circumference',
76
+ };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const Base_1 = require("../Base");
4
+ const product_constants_1 = require("../constants/product-constants");
4
5
  const options_1 = require("../form-states/Product/options");
5
6
  class Product extends Base_1.default {
6
7
  constructor(props) {
@@ -437,6 +438,7 @@ class Product extends Base_1.default {
437
438
  const color = this.filterAttributes.color;
438
439
  const productStyle = this.filterAttributes.productStyle.join(', ');
439
440
  const productRemarks = this.consignmentAttributes.productRemarks;
441
+ const conditionRemarks = this.consignmentAttributes.conditionRemarks;
440
442
  const condition = this.filterAttributes.condition;
441
443
  const priceNew = this.consignmentAttributes.purchasePrice;
442
444
  const yearPurchased = this.consignmentAttributes.yearPurchased;
@@ -447,16 +449,17 @@ class Product extends Base_1.default {
447
449
  const descriptionObj = {
448
450
  title: customHeading ? `<p>${customHeading}</p>\n` : 'REMOVE_ME',
449
451
  line1: `<ul>\n`,
450
- line2: `<li>Fit: ${fit}</li>\n`,
451
- line3: `<li>Condition: ${condition}</li>\n`,
452
- line4: `<li>Color: ${color}</li>`,
453
- line5: productStyle && productStyle.length > 0 ? `\n<li>Style: ${productStyle}</li>` : 'REMOVE_ME',
454
- line6: materials ? `\n<li>Material: ${materials}</li>` : 'REMOVE_ME',
455
- line7: measurements ? `\n<li>Measurements: ${measurements}</li>` : 'REMOVE_ME',
456
- line8: productRemarks ? `\n<li>Remarks: ${productRemarks}</li>` : 'REMOVE_ME',
457
- line9: priceNew ? `\n<li>Purchase price: ${priceNew}</li>` : 'REMOVE_ME',
458
- line10: yearPurchased ? `\n<li>Year purchased: ${yearPurchased}</li>` : 'REMOVE_ME',
459
- line11: `\n</ul>`,
452
+ line2: fit ? `<li>Fit: ${fit}</li>\n` : 'REMOVE_ME',
453
+ line3: condition ? `<li>Condition: ${condition}</li>\n` : 'REMOVE_ME',
454
+ line4: conditionRemarks ? `\n<li>Condition Remarks: ${conditionRemarks}</li>` : 'REMOVE_ME',
455
+ line5: color ? `<li>Color: ${color}</li>` : 'REMOVE_ME',
456
+ line6: productStyle && productStyle.length > 0 ? `\n<li>Style: ${productStyle}</li>` : 'REMOVE_ME',
457
+ line7: materials ? `\n<li>Material: ${materials}</li>` : 'REMOVE_ME',
458
+ line8: measurements ? `\n<li>Measurements: ${measurements}</li>` : 'REMOVE_ME',
459
+ line9: productRemarks ? `\n<li>Remarks: ${productRemarks}</li>` : 'REMOVE_ME',
460
+ line10: priceNew ? `\n<li>Purchase price: ${priceNew}</li>` : 'REMOVE_ME',
461
+ line11: yearPurchased ? `\n<li>Year purchased: ${yearPurchased}</li>` : 'REMOVE_ME',
462
+ line12: `\n</ul>`,
460
463
  };
461
464
  return Object.values(descriptionObj).reduce((acc, cur) => {
462
465
  if (!cur.includes('REMOVE_ME')) {
@@ -833,19 +836,21 @@ class Product extends Base_1.default {
833
836
  .join(', ');
834
837
  }
835
838
  measurementsJoinedString(measurementsObj) {
836
- if (Object.keys(measurementsObj).length > 0) {
837
- const measurementStr = Object.keys(measurementsObj).reduce((acc, cur) => {
838
- let result = acc;
839
- if (cur !== 'unit') {
840
- result = acc
841
- ? `${measurementsObj[cur]} ${measurementsObj.unit} ${cur} x ${acc}`
842
- : `${measurementsObj[cur]} ${measurementsObj.unit} ${cur}`;
843
- }
844
- return result;
845
- }, '');
846
- return measurementStr;
839
+ if (typeof measurementsObj !== 'object' || measurementsObj == null) {
840
+ return '';
841
+ }
842
+ if (Object.keys(measurementsObj).length === 0) {
843
+ return '';
847
844
  }
848
- return '';
845
+ return Object.keys(measurementsObj)
846
+ .filter((key) => key !== 'unit')
847
+ .map((key) => {
848
+ // @ts-ignore
849
+ const label = product_constants_1.MEASUREMENT_FIELDS_DICT[key] || key;
850
+ return `${measurementsObj[key]} ${measurementsObj.unit} ${label}`;
851
+ })
852
+ .reverse()
853
+ .join(' x ');
849
854
  }
850
855
  convertMaterialCompJoinedStrToObj(materialCompJoinedString) {
851
856
  let materialObj = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.0.29",
3
+ "version": "3.0.31",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",