rerobe-js-orm 2.6.8 → 2.6.93

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.
@@ -77,6 +77,8 @@ class ProductFromFormState extends ProductFactory_1.default {
77
77
  selectedForClearance: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.selectedForClearance) || '',
78
78
  locationIds: props.fields.locationIds.selectedValues || [],
79
79
  inventoryLocations: props.fields.inventoryLocations.selectedValues || [],
80
+ majorDefects: props.fields.majorDefects.selectedValues || [],
81
+ minorDefects: props.fields.minorDefects.selectedValues || [],
80
82
  };
81
83
  const timestampAttributes = {
82
84
  createdAtTimestamp: (_s = props.props) === null || _s === void 0 ? void 0 : _s.createdAtTimestamp,
@@ -30,6 +30,8 @@ class ProductFormState extends FormState_1.default {
30
30
  this.fields.clothingSize = this.fieldFactory('multiSelect', 'clothingSize', options_1.clothingSizeOptions);
31
31
  this.fields.color = this.fieldFactory('singleSelect', 'color', options_1.colors);
32
32
  this.fields.condition = this.fieldFactory('singleSelect', 'condition', options_1.conditions);
33
+ this.fields.majorDefects = this.fieldFactory('multiSelect', 'majorDefects', options_1.majorDefectOptions);
34
+ this.fields.minorDefects = this.fieldFactory('multiSelect', 'minorDefects', options_1.minorDefectOptions);
33
35
  this.fields.gender = this.fieldFactory('singleSelect', 'gender', options_1.gender);
34
36
  this.fields.jeanSize = this.fieldFactory('singleSelect', 'jeanSize', options_1.jeanSizes);
35
37
  this.fields.materialComposition = this.fieldFactory('singleSelect', 'materialComposition', options_1.clothingMaterials);
@@ -160,3 +160,11 @@ export const productOptions: {
160
160
  value: string;
161
161
  label: string;
162
162
  }[];
163
+ export const majorDefectOptions: {
164
+ label: string;
165
+ value: string;
166
+ }[];
167
+ export const minorDefectOptions: {
168
+ label: string;
169
+ value: string;
170
+ }[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.productOptions = exports.productIsOnSaleOptions = exports.discountTypeOptions = exports.salesChannelOptions = exports.unisexJewelry = exports.mensJewelry = exports.jewelry = exports.unisexAccessories = exports.mensAccessories = exports.accessories = exports.unisexBags = exports.mensBags = exports.bags = exports.unisexShoes = exports.mensShoes = exports.shoes = exports.unisexClothing = exports.mensClothing = exports.clothing = exports.productCategories = exports.clothingMaterials = exports.shoeSizes = exports.jeanSizes = exports.gender = exports.conditions = exports.colors = exports.brands = exports.sizeCommentOptions = exports.clothingSizeOptions = exports.statusOptions = exports.publishTypeOptions = exports.availableForSaleOptions = void 0;
3
+ exports.minorDefectOptions = exports.majorDefectOptions = exports.productOptions = exports.productIsOnSaleOptions = exports.discountTypeOptions = exports.salesChannelOptions = exports.unisexJewelry = exports.mensJewelry = exports.jewelry = exports.unisexAccessories = exports.mensAccessories = exports.accessories = exports.unisexBags = exports.mensBags = exports.bags = exports.unisexShoes = exports.mensShoes = exports.shoes = exports.unisexClothing = exports.mensClothing = exports.clothing = exports.productCategories = exports.clothingMaterials = exports.shoeSizes = exports.jeanSizes = exports.gender = exports.conditions = exports.colors = exports.brands = exports.sizeCommentOptions = exports.clothingSizeOptions = exports.statusOptions = exports.publishTypeOptions = exports.availableForSaleOptions = void 0;
4
4
  const product_constants_1 = require("../../constants/product-constants");
5
5
  const lodash_1 = require("lodash");
6
6
  const availableForSaleOptions = [
@@ -1616,6 +1616,24 @@ const conditions = [
1616
1616
  // },
1617
1617
  ];
1618
1618
  exports.conditions = conditions;
1619
+ const majorDefectOptions = [
1620
+ { label: 'Zipper', value: 'Zipper' },
1621
+ { label: 'Missing buttons', value: 'Missing buttons' },
1622
+ { label: 'Major stain', value: 'Major stain' },
1623
+ { label: 'Broken buttons', value: 'Broken buttons' },
1624
+ { label: 'Big tears or holes', value: 'Big tears or holes' },
1625
+ { label: 'Other major Issue', value: 'Other major issue' },
1626
+ ];
1627
+ exports.majorDefectOptions = majorDefectOptions;
1628
+ const minorDefectOptions = [
1629
+ { label: 'Minor stains', value: 'Minor stains' },
1630
+ { label: 'Small tears or holes', value: 'Small tears or holes' },
1631
+ { label: 'Pilling', value: 'Pilling' },
1632
+ { label: 'Fading', value: 'Fading' },
1633
+ { label: 'Stretching', value: 'Stretching' },
1634
+ { label: 'Other minor Issue', value: 'Other minor issue' },
1635
+ ];
1636
+ exports.minorDefectOptions = minorDefectOptions;
1619
1637
  const gender = [
1620
1638
  {
1621
1639
  label: 'Woman',
@@ -82,6 +82,10 @@ class Utilities {
82
82
  if (t && typeof t === 'number') {
83
83
  return t;
84
84
  }
85
+ if (t && typeof t === 'string') {
86
+ const result = Date.parse(t);
87
+ return Number.isNaN(result) ? 0 : result;
88
+ }
85
89
  return 0;
86
90
  }
87
91
  }
@@ -111,6 +111,7 @@ class ChatRoom extends Base_1.default {
111
111
  return result;
112
112
  }, []);
113
113
  const stagedObj = {
114
+ id: this.utilities.sanitizeString(this.documentId),
114
115
  documentId: this.utilities.sanitizeString(this.documentId),
115
116
  createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
116
117
  type: this.utilities.sanitizeString(this.type),
@@ -81,6 +81,8 @@ class Product extends Base_1.default {
81
81
  selectedForClearance: (props === null || props === void 0 ? void 0 : props.selectedForClearance) || '',
82
82
  locationIds: (props === null || props === void 0 ? void 0 : props.locationIds) || [],
83
83
  inventoryLocations: (props === null || props === void 0 ? void 0 : props.inventoryLocations) || [],
84
+ majorDefects: (props === null || props === void 0 ? void 0 : props.majorDefects) || [],
85
+ minorDefects: (props === null || props === void 0 ? void 0 : props.minorDefects) || [],
84
86
  };
85
87
  this.timestampAttributes = {
86
88
  createdAtTimestamp: (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.createdAtTimestamp) : null,
@@ -183,6 +183,7 @@ class ProductCollection extends Base_1.default {
183
183
  }
184
184
  toObjForTypesense() {
185
185
  const stagedObj = {
186
+ id: this.utilities.sanitizeString(this.documentId),
186
187
  documentId: this.utilities.sanitizeString(this.documentId),
187
188
  merchantId: this.utilities.sanitizeString(this.merchantId),
188
189
  createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
@@ -64,6 +64,7 @@ declare type ProductCollectionFormFields = {
64
64
  collectionId: TextInputFormField<string>;
65
65
  };
66
66
  declare type TypesenseProductCollectionObj = {
67
+ id: string;
67
68
  documentId: string;
68
69
  merchantId: string;
69
70
  createdAtTimestamp: number;
@@ -31,6 +31,7 @@ declare type ChatRoomUserInfo = {
31
31
  firstName?: string;
32
32
  };
33
33
  declare type TypesenseChatRoomObj = {
34
+ id: string;
34
35
  documentId: string;
35
36
  createdAtTimestamp: number;
36
37
  type: string;
@@ -70,6 +70,8 @@ declare type ProductConsignmentAttributes = {
70
70
  selectedForClearance: string;
71
71
  locationIds?: string[];
72
72
  inventoryLocations: InventoryLocation[];
73
+ majorDefects: string[];
74
+ minorDefects: string[];
73
75
  };
74
76
  declare type ProductTimestampAttributes = {
75
77
  createdAtTimestamp: number | null;
@@ -194,6 +196,8 @@ declare type ProductConsignmentAttributesFormFields = {
194
196
  discountValue: TextInputFormField<string>;
195
197
  locationIds: MultiSelectFormField<string>;
196
198
  inventoryLocations: MultiSelectFormField<InventoryLocation>;
199
+ majorDefects: MultiSelectFormField<string>;
200
+ minorDefects: MultiSelectFormField<string>;
197
201
  };
198
202
  declare type ProductFormFields = ProductAttributesFormFields & ProductFilterAttributesFormFields & ProductConsignmentAttributesFormFields;
199
203
  interface ParamsForBuildProductInputObjForShopify {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.6.8",
3
+ "version": "2.6.93",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",