rerobe-js-orm 3.0.16 → 3.0.18
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.
- package/lib/factories/Product/ProductFromFormState.js +1 -0
- package/lib/form-states/Product/ProductFormState.js +1 -0
- package/lib/helpers/ReRobeProductHelpers.d.ts +1 -0
- package/lib/helpers/ReRobeProductHelpers.js +9 -0
- package/lib/models/Product.js +8 -0
- package/lib/types/rerobe-product-types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -32,6 +32,7 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
32
32
|
merchantId: ((_m = props.props) === null || _m === void 0 ? void 0 : _m.merchantId) || '',
|
|
33
33
|
editorAuthorizations: props.fields.editorAuthorizations.selectedValue,
|
|
34
34
|
rfidTag: props.fields.rfidTag.inputValue || '',
|
|
35
|
+
sku: props.fields.sku.inputValue || '',
|
|
35
36
|
};
|
|
36
37
|
const productFilterAttributes = {
|
|
37
38
|
documentId: (_o = props.props) === null || _o === void 0 ? void 0 : _o.documentId,
|
|
@@ -71,6 +71,7 @@ class ProductFormState extends FormState_1.default {
|
|
|
71
71
|
this.fields.vendorId = this.fieldFactory('singleSelect', 'vendorId');
|
|
72
72
|
this.fields.vendorName = this.fieldFactory('singleSelect', 'vendorName');
|
|
73
73
|
this.fields.rfidTag = this.fieldFactory('textInput', 'rfidTag');
|
|
74
|
+
this.fields.sku = this.fieldFactory('textInput', 'sku');
|
|
74
75
|
this.fields.locationIds = this.fieldFactory('multiSelect', 'locationIds');
|
|
75
76
|
this.fields.inventoryLocations = this.fieldFactory('multiSelect', 'inventoryLocations');
|
|
76
77
|
this.fields.featuredCollections = this.fieldFactory('multiSelect', 'featuredCollections');
|
|
@@ -24,5 +24,6 @@ export default class ReRobeProductHelpers {
|
|
|
24
24
|
static getSubtitle(title: string): string;
|
|
25
25
|
static sizeFinder(sizeLabel: string, sizeToMatch: string): boolean;
|
|
26
26
|
static convertReRobeSizeToStandardSize(productObj: CompleteProduct): string;
|
|
27
|
+
static mapToOldSizesToStandardSize(productObj: CompleteProduct): string;
|
|
27
28
|
static buildLineItem(productObj: CompleteProduct, quantity?: number): ProductLineItem;
|
|
28
29
|
}
|
|
@@ -453,6 +453,15 @@ class ReRobeProductHelpers {
|
|
|
453
453
|
}
|
|
454
454
|
return size;
|
|
455
455
|
}
|
|
456
|
+
static mapToOldSizesToStandardSize(productObj) {
|
|
457
|
+
const { clothingSize = [], jeanSize = '', shoeSize = '' } = productObj;
|
|
458
|
+
const validSizes = clothingSize.filter((size) => typeof size === 'string' && size);
|
|
459
|
+
if (jeanSize)
|
|
460
|
+
validSizes.push(jeanSize);
|
|
461
|
+
if (shoeSize)
|
|
462
|
+
validSizes.push(shoeSize);
|
|
463
|
+
return validSizes.join(' ').trim() || '';
|
|
464
|
+
}
|
|
456
465
|
// RibbnProductHelper candidate
|
|
457
466
|
static buildLineItem(productObj, quantity = 1) {
|
|
458
467
|
const { documentId, title, price, coverPhotoUrl, imageUrls, brand } = productObj;
|
package/lib/models/Product.js
CHANGED
|
@@ -33,6 +33,7 @@ class Product extends Base_1.default {
|
|
|
33
33
|
merchantId: (props === null || props === void 0 ? void 0 : props.merchantId) || '',
|
|
34
34
|
editorAuthorizations: (props === null || props === void 0 ? void 0 : props.editorAuthorizations) || {},
|
|
35
35
|
rfidTag: (props === null || props === void 0 ? void 0 : props.rfidTag) || '',
|
|
36
|
+
sku: (props === null || props === void 0 ? void 0 : props.sku) || '',
|
|
36
37
|
};
|
|
37
38
|
this.filterAttributes = {
|
|
38
39
|
documentId: (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28),
|
|
@@ -288,6 +289,7 @@ class Product extends Base_1.default {
|
|
|
288
289
|
productStyle: this.utilities.sanitzeStringArr(this.filterAttributes.productStyle),
|
|
289
290
|
reRobeCommission: this.sanitizeCommission(),
|
|
290
291
|
rfidTag: this.utilities.sanitizeString(this.attributes.rfidTag),
|
|
292
|
+
sku: this.utilities.sanitizeString(this.attributes.sku),
|
|
291
293
|
salesChannel: this.utilities.sanitzeStringArr(this.consignmentAttributes.salesChannel),
|
|
292
294
|
status: this.utilities.sanitizeString(this.consignmentAttributes.status),
|
|
293
295
|
tags: this.utilities.sanitzeStringArr(this.filterAttributes.tags),
|
|
@@ -585,6 +587,12 @@ class Product extends Base_1.default {
|
|
|
585
587
|
name: 'rfidTag',
|
|
586
588
|
type: 'string',
|
|
587
589
|
},
|
|
590
|
+
{
|
|
591
|
+
facet: true,
|
|
592
|
+
optional: true,
|
|
593
|
+
name: 'sku',
|
|
594
|
+
type: 'string',
|
|
595
|
+
},
|
|
588
596
|
{
|
|
589
597
|
facet: true,
|
|
590
598
|
optional: true,
|
|
@@ -25,6 +25,7 @@ declare type ProductAttributes = {
|
|
|
25
25
|
merchantId?: string;
|
|
26
26
|
editorAuthorizations?: EditorAuthorization;
|
|
27
27
|
rfidTag?: string;
|
|
28
|
+
sku?: string;
|
|
28
29
|
};
|
|
29
30
|
declare type ProductFilterAttributes = {
|
|
30
31
|
documentId: string;
|
|
@@ -155,6 +156,7 @@ declare type ProductAttributesFormFields = {
|
|
|
155
156
|
vendorId: SingleSelectFormField<string>;
|
|
156
157
|
vendorName: SingleSelectFormField<string>;
|
|
157
158
|
rfidTag: TextInputFormField<string>;
|
|
159
|
+
sku: TextInputFormField<string>;
|
|
158
160
|
};
|
|
159
161
|
declare type ProductFilterAttributesFormFields = {
|
|
160
162
|
brand: SingleSelectFormField<string>;
|
|
@@ -260,6 +262,7 @@ declare type TypesenseProductObj = {
|
|
|
260
262
|
productStyle: string[];
|
|
261
263
|
reRobeCommission: number;
|
|
262
264
|
rfidTag: string;
|
|
265
|
+
sku: string;
|
|
263
266
|
salesChannel: string[];
|
|
264
267
|
status: string;
|
|
265
268
|
tags: string[];
|