rerobe-js-orm 3.0.8 → 3.0.10
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 +32 -35
- package/lib/form-states/Merchant/MerchantFormState.js +1 -1
- package/lib/form-states/Product/ProductFormState.d.ts +1 -0
- package/lib/form-states/Product/ProductFormState.js +28 -14
- package/lib/helpers/ReRobeProductHelpers.js +8 -16
- package/lib/helpers/ShopifyHelpers.js +0 -5
- package/lib/models/Merchant.js +1 -1
- package/lib/models/Product.js +16 -19
- package/lib/types/merchant-types.d.ts +1 -1
- package/lib/types/rerobe-product-types.d.ts +5 -10
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ const ProductFactory_1 = require("./ProductFactory");
|
|
|
4
4
|
const Product_1 = require("../../models/Product");
|
|
5
5
|
class ProductFromFormState extends ProductFactory_1.default {
|
|
6
6
|
createProduct(props) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16;
|
|
8
8
|
const productAttributes = {
|
|
9
9
|
availableForSale: props.fields.availableForSale.selectedValue,
|
|
10
10
|
description: props.fields.description.inputValue,
|
|
@@ -27,11 +27,12 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
27
27
|
compareAtPrice: props.fields.compareAtPrice.inputValue,
|
|
28
28
|
quantity: props.fields.quantity.inputValue,
|
|
29
29
|
merchants: ((_l = props.props) === null || _l === void 0 ? void 0 : _l.merchants) || [],
|
|
30
|
+
merchantId: ((_m = props.props) === null || _m === void 0 ? void 0 : _m.merchantId) || '',
|
|
30
31
|
editorAuthorizations: props.fields.editorAuthorizations.selectedValue,
|
|
31
32
|
rfidTag: props.fields.rfidTag.inputValue || '',
|
|
32
33
|
};
|
|
33
34
|
const productFilterAttributes = {
|
|
34
|
-
documentId: (
|
|
35
|
+
documentId: (_o = props.props) === null || _o === void 0 ? void 0 : _o.documentId,
|
|
35
36
|
brand: props.fields.brand.selectedValue,
|
|
36
37
|
size: props.fields.size.selectedValue,
|
|
37
38
|
clothingSize: props.fields.clothingSize.selectedValues,
|
|
@@ -47,11 +48,11 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
47
48
|
productStyle: props.fields.productStyle.selectedValues,
|
|
48
49
|
measurements: props.fields.measurements.selectedValue || {},
|
|
49
50
|
featuredCollections: props.fields.featuredCollections.selectedValues || [],
|
|
51
|
+
primaryAgeCategory: props.fields.primaryAgeCategory.selectedValue || '',
|
|
50
52
|
tags: props.fields.tags.selectedValues || [],
|
|
51
53
|
};
|
|
52
54
|
const consignmentAttributes = {
|
|
53
|
-
|
|
54
|
-
sellRequestId: ((_o = props.props) === null || _o === void 0 ? void 0 : _o.sellRequestId) || '',
|
|
55
|
+
sellRequestId: ((_p = props.props) === null || _p === void 0 ? void 0 : _p.sellRequestId) || '',
|
|
55
56
|
publishType: props.fields.publishType.selectedValue,
|
|
56
57
|
conditionRemarks: props.fields.conditionRemarks.inputValue,
|
|
57
58
|
productRemarks: props.fields.productRemarks.inputValue,
|
|
@@ -64,48 +65,44 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
64
65
|
nextAvailableSeason: props.fields.nextAvailableSeason.selectedValue,
|
|
65
66
|
notesForProductionTeam: props.fields.notesForProductionTeam.inputValue,
|
|
66
67
|
reviewedBy: props.fields.reviewedBy.selectedValue,
|
|
67
|
-
sellRequestImageUrls: ((
|
|
68
|
-
dateSold: props.fields.dateSold.selectedValue || '',
|
|
69
|
-
dateInQualityControl: props.fields.dateInQualityControl.selectedValue || '',
|
|
70
|
-
dateInPendingPublication: props.fields.dateInPendingPublication.selectedValue || '',
|
|
71
|
-
dateListedOnline: props.fields.dateListedOnline.selectedValue || '',
|
|
68
|
+
sellRequestImageUrls: ((_q = props.props) === null || _q === void 0 ? void 0 : _q.sellRequestImageUrls) || [],
|
|
72
69
|
salesChannel: props.fields.salesChannel.selectedValues || [],
|
|
73
70
|
sizeComment: props.fields.sizeComment.selectedValue,
|
|
74
|
-
salePrice: ((
|
|
71
|
+
salePrice: ((_r = props.props) === null || _r === void 0 ? void 0 : _r.salePrice) || '',
|
|
75
72
|
isOnSale: props.fields.isOnSale.selectedValue || '',
|
|
76
73
|
discountType: props.fields.discountType.selectedValue || '',
|
|
77
74
|
discountValue: props.fields.discountValue.inputValue || '',
|
|
78
|
-
selectedForClearance: ((
|
|
75
|
+
selectedForClearance: ((_s = props.props) === null || _s === void 0 ? void 0 : _s.selectedForClearance) || '',
|
|
79
76
|
locationIds: props.fields.locationIds.selectedValues || [],
|
|
80
77
|
inventoryLocations: props.fields.inventoryLocations.selectedValues || [],
|
|
81
78
|
majorDefects: props.fields.majorDefects.selectedValues || [],
|
|
82
79
|
minorDefects: props.fields.minorDefects.selectedValues || [],
|
|
83
80
|
};
|
|
84
81
|
const timestampAttributes = {
|
|
85
|
-
createdAtTimestamp: (
|
|
86
|
-
updatedAtTimestamp: (
|
|
87
|
-
sellRequestReviewTimestamp: (
|
|
88
|
-
sellRequestReviewDraftTimestamp: (
|
|
89
|
-
rejectedTimestamp: (
|
|
90
|
-
holdTimestamp: (
|
|
91
|
-
acceptedTimestamp: (
|
|
92
|
-
sellerToDropOffTimestamp: (
|
|
93
|
-
sellerToShipTimestamp: (
|
|
94
|
-
sellerToGetPickUpTimestamp: (
|
|
95
|
-
qualityControlTimestamp: (
|
|
96
|
-
pendingPublicationTimestamp: (
|
|
97
|
-
listedTimestamp: (
|
|
98
|
-
clearanceTimestamp: (
|
|
99
|
-
reservedTimestamp: (
|
|
100
|
-
soldTimestamp: (
|
|
101
|
-
returnedTimestamp: (
|
|
102
|
-
soldSellerToBePaidTimestamp: (
|
|
103
|
-
soldSellerPaidTimestamp: (
|
|
104
|
-
sellerSelfRejectTimestamp: (
|
|
105
|
-
liquidationRequestedTimestamp: (
|
|
106
|
-
sellerLiquidatedTimestamp: (
|
|
107
|
-
archivedTimestamp: (
|
|
108
|
-
liquidationReadyTimestamp: (
|
|
82
|
+
createdAtTimestamp: (_t = props.props) === null || _t === void 0 ? void 0 : _t.createdAtTimestamp,
|
|
83
|
+
updatedAtTimestamp: (_u = props.props) === null || _u === void 0 ? void 0 : _u.updatedAtTimestamp,
|
|
84
|
+
sellRequestReviewTimestamp: (_v = props.props) === null || _v === void 0 ? void 0 : _v.sellRequestReviewTimestamp,
|
|
85
|
+
sellRequestReviewDraftTimestamp: (_w = props.props) === null || _w === void 0 ? void 0 : _w.sellRequestReviewDraftTimestamp,
|
|
86
|
+
rejectedTimestamp: (_x = props.props) === null || _x === void 0 ? void 0 : _x.rejectedTimestamp,
|
|
87
|
+
holdTimestamp: (_y = props.props) === null || _y === void 0 ? void 0 : _y.holdTimestamp,
|
|
88
|
+
acceptedTimestamp: (_z = props.props) === null || _z === void 0 ? void 0 : _z.acceptedTimestamp,
|
|
89
|
+
sellerToDropOffTimestamp: (_0 = props.props) === null || _0 === void 0 ? void 0 : _0.sellerToDropOffTimestamp,
|
|
90
|
+
sellerToShipTimestamp: (_1 = props.props) === null || _1 === void 0 ? void 0 : _1.sellerToShipTimestamp,
|
|
91
|
+
sellerToGetPickUpTimestamp: (_2 = props.props) === null || _2 === void 0 ? void 0 : _2.sellerToGetPickUpTimestamp,
|
|
92
|
+
qualityControlTimestamp: (_3 = props.props) === null || _3 === void 0 ? void 0 : _3.qualityControlTimestamp,
|
|
93
|
+
pendingPublicationTimestamp: (_4 = props.props) === null || _4 === void 0 ? void 0 : _4.pendingPublicationTimestamp,
|
|
94
|
+
listedTimestamp: (_5 = props.props) === null || _5 === void 0 ? void 0 : _5.listedTimestamp,
|
|
95
|
+
clearanceTimestamp: (_6 = props.props) === null || _6 === void 0 ? void 0 : _6.clearanceTimestamp,
|
|
96
|
+
reservedTimestamp: (_7 = props.props) === null || _7 === void 0 ? void 0 : _7.reservedTimestamp,
|
|
97
|
+
soldTimestamp: (_8 = props.props) === null || _8 === void 0 ? void 0 : _8.soldTimestamp,
|
|
98
|
+
returnedTimestamp: (_9 = props.props) === null || _9 === void 0 ? void 0 : _9.returnedTimestamp,
|
|
99
|
+
soldSellerToBePaidTimestamp: (_10 = props.props) === null || _10 === void 0 ? void 0 : _10.soldSellerToBePaidTimestamp,
|
|
100
|
+
soldSellerPaidTimestamp: (_11 = props.props) === null || _11 === void 0 ? void 0 : _11.soldSellerPaidTimestamp,
|
|
101
|
+
sellerSelfRejectTimestamp: (_12 = props.props) === null || _12 === void 0 ? void 0 : _12.sellerSelfRejectTimestamp,
|
|
102
|
+
liquidationRequestedTimestamp: (_13 = props.props) === null || _13 === void 0 ? void 0 : _13.liquidationRequestedTimestamp,
|
|
103
|
+
sellerLiquidatedTimestamp: (_14 = props.props) === null || _14 === void 0 ? void 0 : _14.sellerLiquidatedTimestamp,
|
|
104
|
+
archivedTimestamp: (_15 = props.props) === null || _15 === void 0 ? void 0 : _15.archivedTimestamp,
|
|
105
|
+
liquidationReadyTimestamp: (_16 = props.props) === null || _16 === void 0 ? void 0 : _16.liquidationReadyTimestamp,
|
|
109
106
|
};
|
|
110
107
|
return new Product_1.default(Object.assign(Object.assign(Object.assign(Object.assign({}, productAttributes), productFilterAttributes), consignmentAttributes), timestampAttributes));
|
|
111
108
|
}
|
|
@@ -43,7 +43,6 @@ class ProductFormState extends FormState_1.default {
|
|
|
43
43
|
this.fields.shoeSize = this.fieldFactory('singleSelect', 'shoeSize', options_1.shoeSizes);
|
|
44
44
|
this.fields.jeanSize = this.fieldFactory('singleSelect', 'jeanSize', options_1.jeanSizes);
|
|
45
45
|
// ProductConsignmentAttributesFormFields
|
|
46
|
-
this.fields.previousSellers = this.fieldFactory('multiSelect', 'previousSellers');
|
|
47
46
|
this.fields.publishType = this.fieldFactory('singleSelect', 'publishType', options_1.publishTypeOptions);
|
|
48
47
|
this.fields.conditionRemarks = this.fieldFactory('textInput', 'conditionRemarks');
|
|
49
48
|
this.fields.productRemarks = this.fieldFactory('textInput', 'productRemarks');
|
|
@@ -56,10 +55,6 @@ class ProductFormState extends FormState_1.default {
|
|
|
56
55
|
this.fields.nextAvailableSeason = this.fieldFactory('singleSelect', 'nextAvailableSeason');
|
|
57
56
|
this.fields.notesForProductionTeam = this.fieldFactory('textInput', 'notesForProductionTeam');
|
|
58
57
|
this.fields.reviewedBy = this.fieldFactory('singleSelect', 'reviewedBy');
|
|
59
|
-
this.fields.dateSold = this.fieldFactory('singleSelect', 'dateSold');
|
|
60
|
-
this.fields.dateInQualityControl = this.fieldFactory('singleSelect', 'dateInQualityControl');
|
|
61
|
-
this.fields.dateInPendingPublication = this.fieldFactory('singleSelect', 'dateInPendingPublication');
|
|
62
|
-
this.fields.dateListedOnline = this.fieldFactory('singleSelect', 'dateListedOnline');
|
|
63
58
|
this.fields.salesChannel = this.fieldFactory('multiSelect', 'salesChannel', options_1.salesChannelOptions);
|
|
64
59
|
this.fields.sizeComment = this.fieldFactory('singleSelect', 'sizeComment', options_1.sizeCommentOptions);
|
|
65
60
|
this.fields.filesToUpload = {
|
|
@@ -77,6 +72,7 @@ class ProductFormState extends FormState_1.default {
|
|
|
77
72
|
this.fields.locationIds = this.fieldFactory('multiSelect', 'locationIds');
|
|
78
73
|
this.fields.inventoryLocations = this.fieldFactory('multiSelect', 'inventoryLocations');
|
|
79
74
|
this.fields.featuredCollections = this.fieldFactory('multiSelect', 'featuredCollections');
|
|
75
|
+
this.fields.primaryAgeCategory = this.fieldFactory('singleSelect', 'primaryAgeCategory');
|
|
80
76
|
this.fields.tags = this.fieldFactory('multiSelect', 'tags');
|
|
81
77
|
}
|
|
82
78
|
autoCreateTitle() {
|
|
@@ -215,13 +211,16 @@ class ProductFormState extends FormState_1.default {
|
|
|
215
211
|
this.fields.size.hidden = false;
|
|
216
212
|
}
|
|
217
213
|
setPriceRangeFromPrice(value) {
|
|
218
|
-
if (Number(value) > 0 && Number(value)
|
|
219
|
-
return '100
|
|
214
|
+
if (Number(value) > 0 && Number(value) < 100) {
|
|
215
|
+
return 'Less than 100';
|
|
216
|
+
}
|
|
217
|
+
if (Number(value) >= 100 && Number(value) <= 500) {
|
|
218
|
+
return '100-500';
|
|
220
219
|
}
|
|
221
220
|
if (Number(value) > 500 && Number(value) <= 1000) {
|
|
222
|
-
return '501-1000
|
|
221
|
+
return '501-1000';
|
|
223
222
|
}
|
|
224
|
-
return '1000+
|
|
223
|
+
return '1000+';
|
|
225
224
|
}
|
|
226
225
|
setProductCategoreisFromGender(genderSelected) {
|
|
227
226
|
let productCategoryOptions = [];
|
|
@@ -427,7 +426,7 @@ class ProductFormState extends FormState_1.default {
|
|
|
427
426
|
}
|
|
428
427
|
}
|
|
429
428
|
fieldFactory(fieldType, fieldKey, fieldOptions) {
|
|
430
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
429
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
431
430
|
let options = fieldOptions || [];
|
|
432
431
|
let hidden = false;
|
|
433
432
|
if (fieldType === 'singleSelect') {
|
|
@@ -558,8 +557,23 @@ class ProductFormState extends FormState_1.default {
|
|
|
558
557
|
options = this.utilities.uniqObjArray([...selectedColorOptions, ...colorsOptions], 'value');
|
|
559
558
|
}
|
|
560
559
|
}
|
|
560
|
+
if (fieldKey === 'primaryAgeCategory') {
|
|
561
|
+
let selectedPrimaryAgeCategoryOptions = [];
|
|
562
|
+
if (this.props.primaryAgeCategory) {
|
|
563
|
+
selectedPrimaryAgeCategoryOptions = [
|
|
564
|
+
{ label: this.props.primaryAgeCategory, value: this.props.primaryAgeCategory },
|
|
565
|
+
];
|
|
566
|
+
if (!options.map((o) => o.value).includes(this.props.primaryAgeCategory)) {
|
|
567
|
+
options.splice(0, 0, ...selectedPrimaryAgeCategoryOptions);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
if ((_m = (_l = this.opts) === null || _l === void 0 ? void 0 : _l.primaryAgeCategories) === null || _m === void 0 ? void 0 : _m.length) {
|
|
571
|
+
const primaryAgeCategoryOptions = this.opts.primaryAgeCategories.map((t) => ({ label: t, value: t }));
|
|
572
|
+
options = this.utilities.uniqObjArray([...selectedPrimaryAgeCategoryOptions, ...primaryAgeCategoryOptions], 'value');
|
|
573
|
+
}
|
|
574
|
+
}
|
|
561
575
|
if (fieldKey === 'condition') {
|
|
562
|
-
if ((
|
|
576
|
+
if ((_p = (_o = this.opts) === null || _o === void 0 ? void 0 : _o.conditions) === null || _p === void 0 ? void 0 : _p.length) {
|
|
563
577
|
const conditionsOptions = this.opts.conditions.map((t) => ({
|
|
564
578
|
label: t.label || '',
|
|
565
579
|
value: t.value || '',
|
|
@@ -614,7 +628,7 @@ class ProductFormState extends FormState_1.default {
|
|
|
614
628
|
if (this.props.gender === 'Man') {
|
|
615
629
|
options = options_1.manClothingSizeOptions;
|
|
616
630
|
}
|
|
617
|
-
if ((
|
|
631
|
+
if ((_r = (_q = this.opts) === null || _q === void 0 ? void 0 : _q.clothingSizes) === null || _r === void 0 ? void 0 : _r.length) {
|
|
618
632
|
const clothingSizesOptions = this.opts.clothingSizes.map((t) => ({ label: t, value: t }));
|
|
619
633
|
options = this.utilities.uniqObjArray(clothingSizesOptions, 'value');
|
|
620
634
|
}
|
|
@@ -626,7 +640,7 @@ class ProductFormState extends FormState_1.default {
|
|
|
626
640
|
selectedMajorDefectsOptions = this.props.majorDefects.map((t) => ({ label: t, value: t }));
|
|
627
641
|
}
|
|
628
642
|
let majorDefectsOptions = [];
|
|
629
|
-
if ((
|
|
643
|
+
if ((_t = (_s = this.opts) === null || _s === void 0 ? void 0 : _s.majorDefects) === null || _t === void 0 ? void 0 : _t.length) {
|
|
630
644
|
majorDefectsOptions = this.opts.majorDefects.map((t) => ({ label: t, value: t }));
|
|
631
645
|
}
|
|
632
646
|
options = this.utilities.uniqObjArray([...selectedMajorDefectsOptions, ...majorDefectsOptions], 'value');
|
|
@@ -637,7 +651,7 @@ class ProductFormState extends FormState_1.default {
|
|
|
637
651
|
selectedMinorDefectsOptions = this.props.minorDefects.map((t) => ({ label: t, value: t }));
|
|
638
652
|
}
|
|
639
653
|
let minorDefectsOptions = [];
|
|
640
|
-
if ((
|
|
654
|
+
if ((_v = (_u = this.opts) === null || _u === void 0 ? void 0 : _u.minorDefects) === null || _v === void 0 ? void 0 : _v.length) {
|
|
641
655
|
minorDefectsOptions = this.opts.minorDefects.map((t) => ({ label: t, value: t }));
|
|
642
656
|
}
|
|
643
657
|
options = this.utilities.uniqObjArray([...selectedMinorDefectsOptions, ...minorDefectsOptions], 'value');
|
|
@@ -263,28 +263,20 @@ class ReRobeProductHelpers {
|
|
|
263
263
|
}
|
|
264
264
|
static prepareProductForMutation(productObj, mediaInputArr = []) {
|
|
265
265
|
const productObjClone = Object.assign({}, productObj);
|
|
266
|
-
const {
|
|
267
|
-
if (status === product_constants_1.PRODUCT_STATES.qualityControl && !dateInQualityControl) {
|
|
268
|
-
productObjClone.dateInQualityControl = new Date().toISOString().split('T')[0];
|
|
269
|
-
}
|
|
270
|
-
if (status === product_constants_1.PRODUCT_STATES.pendingPublication && !dateInPendingPublication) {
|
|
271
|
-
productObjClone.dateInPendingPublication = new Date().toISOString().split('T')[0];
|
|
272
|
-
}
|
|
273
|
-
if (status === product_constants_1.PRODUCT_STATES.listed && !dateListedOnline) {
|
|
274
|
-
productObjClone.dateListedOnline = publishedAt
|
|
275
|
-
? new Date(publishedAt).toISOString().split('T')[0]
|
|
276
|
-
: new Date().toISOString().split('T')[0];
|
|
277
|
-
}
|
|
266
|
+
const { price } = productObj;
|
|
278
267
|
if (Array.isArray(mediaInputArr) && mediaInputArr.length > 0) {
|
|
279
268
|
productObjClone.imageUrls = mediaInputArr.map((m) => m.originalSource);
|
|
280
269
|
}
|
|
281
270
|
if (price) {
|
|
282
|
-
let priceRange = '1000+
|
|
283
|
-
if (Number(price) > 0 && Number(price)
|
|
284
|
-
priceRange = '100
|
|
271
|
+
let priceRange = '1000+';
|
|
272
|
+
if (Number(price) > 0 && Number(price) < 100) {
|
|
273
|
+
priceRange = 'Less than 100';
|
|
274
|
+
}
|
|
275
|
+
if (Number(price) >= 100 && Number(price) <= 500) {
|
|
276
|
+
priceRange = '100-500';
|
|
285
277
|
}
|
|
286
278
|
if (Number(price) > 500 && Number(price) <= 1000) {
|
|
287
|
-
priceRange = '501-1000
|
|
279
|
+
priceRange = '501-1000';
|
|
288
280
|
}
|
|
289
281
|
productObjClone.priceRange = priceRange;
|
|
290
282
|
}
|
|
@@ -29,12 +29,7 @@ class ShopifyHelpers {
|
|
|
29
29
|
status: 'status',
|
|
30
30
|
purchasePrice: 'purchasePrice',
|
|
31
31
|
yearPurchased: 'yearPurchased',
|
|
32
|
-
previousSellers: 'previousSeller',
|
|
33
32
|
rejectedReason: 'rejectedReason',
|
|
34
|
-
dateSold: 'dateSold',
|
|
35
|
-
dateInQualityControl: 'dateInQualityControl',
|
|
36
|
-
dateInPendingPublication: 'dateInPendingPublication',
|
|
37
|
-
dateListedOnline: 'dateListedOnline',
|
|
38
33
|
salesChannel: 'salesChannel',
|
|
39
34
|
sizeComment: 'sizeComment',
|
|
40
35
|
salePrice: 'salePrice',
|
package/lib/models/Merchant.js
CHANGED
package/lib/models/Product.js
CHANGED
|
@@ -28,11 +28,9 @@ class Product extends Base_1.default {
|
|
|
28
28
|
compareAtPrice: (props === null || props === void 0 ? void 0 : props.compareAtPrice) || '',
|
|
29
29
|
quantity: (props === null || props === void 0 ? void 0 : props.quantity) || 0,
|
|
30
30
|
merchants: (props === null || props === void 0 ? void 0 : props.merchants) || [],
|
|
31
|
+
merchantId: (props === null || props === void 0 ? void 0 : props.merchantId) || '',
|
|
31
32
|
editorAuthorizations: (props === null || props === void 0 ? void 0 : props.editorAuthorizations) || {},
|
|
32
33
|
rfidTag: (props === null || props === void 0 ? void 0 : props.rfidTag) || '',
|
|
33
|
-
// dateInQualityControlTimeStamp: props?.dateInQualityControlTimeStamp || 0,
|
|
34
|
-
// dateInPendingPublicationTimeStamp: props?.dateInPendingPublicationTimeStamp || 0,
|
|
35
|
-
// dateListedOnlineTimeStamp: props?.dateListedOnlineTimeStamp || 0,
|
|
36
34
|
};
|
|
37
35
|
this.filterAttributes = {
|
|
38
36
|
documentId: (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28),
|
|
@@ -51,11 +49,11 @@ class Product extends Base_1.default {
|
|
|
51
49
|
condition: (props === null || props === void 0 ? void 0 : props.condition) || '',
|
|
52
50
|
measurements: (props === null || props === void 0 ? void 0 : props.measurements) || {},
|
|
53
51
|
featuredCollections: (props === null || props === void 0 ? void 0 : props.featuredCollections) || [],
|
|
52
|
+
primaryAgeCategory: (props === null || props === void 0 ? void 0 : props.primaryAgeCategory) || '',
|
|
54
53
|
tags: (props === null || props === void 0 ? void 0 : props.tags) || [],
|
|
55
54
|
};
|
|
56
55
|
this.consignmentAttributes = {
|
|
57
56
|
sellRequestImageUrls: (props === null || props === void 0 ? void 0 : props.sellRequestImageUrls) || [],
|
|
58
|
-
previousSellers: (props === null || props === void 0 ? void 0 : props.previousSellers) || [],
|
|
59
57
|
sellRequestId: (props === null || props === void 0 ? void 0 : props.sellRequestId) || '',
|
|
60
58
|
publishType: (props === null || props === void 0 ? void 0 : props.publishType) || 'USER_PUBLISHED',
|
|
61
59
|
reRobeCommission: (props === null || props === void 0 ? void 0 : props.reRobeCommission) || '',
|
|
@@ -69,10 +67,6 @@ class Product extends Base_1.default {
|
|
|
69
67
|
status: (props === null || props === void 0 ? void 0 : props.status) || 'SELL_REQUEST_REVIEW',
|
|
70
68
|
purchasePrice: (props === null || props === void 0 ? void 0 : props.purchasePrice) || '',
|
|
71
69
|
yearPurchased: (props === null || props === void 0 ? void 0 : props.yearPurchased) || '',
|
|
72
|
-
dateSold: (props === null || props === void 0 ? void 0 : props.dateSold) || '',
|
|
73
|
-
dateInQualityControl: (props === null || props === void 0 ? void 0 : props.dateInQualityControl) || '',
|
|
74
|
-
dateInPendingPublication: (props === null || props === void 0 ? void 0 : props.dateInPendingPublication) || '',
|
|
75
|
-
dateListedOnline: (props === null || props === void 0 ? void 0 : props.dateListedOnline) || '',
|
|
76
70
|
salesChannel: (props === null || props === void 0 ? void 0 : props.salesChannel) || [],
|
|
77
71
|
sizeComment: (props === null || props === void 0 ? void 0 : props.sizeComment) || 'TRUE_TO_SIZE',
|
|
78
72
|
salePrice: (props === null || props === void 0 ? void 0 : props.salePrice) || '',
|
|
@@ -170,16 +164,6 @@ class Product extends Base_1.default {
|
|
|
170
164
|
this.consignmentAttributes.rejectedReason
|
|
171
165
|
? `rejectedReason:${this.consignmentAttributes.rejectedReason}`
|
|
172
166
|
: null,
|
|
173
|
-
this.consignmentAttributes.dateSold ? `dateSold:${this.consignmentAttributes.dateSold}` : null,
|
|
174
|
-
this.consignmentAttributes.dateInQualityControl
|
|
175
|
-
? `dateInQualityControl:${this.consignmentAttributes.dateInQualityControl}`
|
|
176
|
-
: null,
|
|
177
|
-
this.consignmentAttributes.dateInPendingPublication
|
|
178
|
-
? `dateInPendingPublication:${this.consignmentAttributes.dateInPendingPublication}`
|
|
179
|
-
: null,
|
|
180
|
-
this.consignmentAttributes.dateListedOnline
|
|
181
|
-
? `dateListedOnline:${this.consignmentAttributes.dateListedOnline}`
|
|
182
|
-
: null,
|
|
183
167
|
this.consignmentAttributes.sizeComment ? `sizeComment:${this.consignmentAttributes.sizeComment}` : null,
|
|
184
168
|
this.consignmentAttributes.salePrice ? `salePrice:${this.consignmentAttributes.salePrice}` : null,
|
|
185
169
|
this.consignmentAttributes.isOnSale ? `isOnSale:${this.consignmentAttributes.isOnSale}` : null,
|
|
@@ -192,7 +176,6 @@ class Product extends Base_1.default {
|
|
|
192
176
|
.concat(this.filterAttributes.clothingSize.map((s) => `clothingsize_attribute:${s}`))
|
|
193
177
|
.concat(this.filterAttributes.productStyle.map((s) => `productstyle_attribute:${s}`))
|
|
194
178
|
.concat(this.materialCompTagsArrayForShopify().map((mc) => `materialcomposition_attribute:${mc}`))
|
|
195
|
-
.concat(this.consignmentAttributes.previousSellers.map((prevSellerGid) => `previousSeller:${prevSellerGid}`))
|
|
196
179
|
.concat(this.consignmentAttributes.salesChannel.map((s) => `salesChannel:${s}`))
|
|
197
180
|
.filter((t) => t),
|
|
198
181
|
variants: [
|
|
@@ -286,8 +269,10 @@ class Product extends Base_1.default {
|
|
|
286
269
|
shoeSize: this.utilities.sanitizeString(this.filterAttributes.shoeSize),
|
|
287
270
|
condition: this.utilities.sanitizeString(this.filterAttributes.condition),
|
|
288
271
|
featuredCollections: this.utilities.sanitzeStringArr(this.filterAttributes.featuredCollections),
|
|
272
|
+
primaryAgeCategory: this.utilities.sanitizeString(this.filterAttributes.primaryAgeCategory),
|
|
289
273
|
isOnSale: this.utilities.sanitizeString(this.consignmentAttributes.isOnSale),
|
|
290
274
|
merchants: this.utilities.sanitzeStringArr(this.attributes.merchants),
|
|
275
|
+
merchantId: this.utilities.sanitizeString(this.attributes.merchantId),
|
|
291
276
|
price: this.utilities.sanitizeNumber(this.attributes.price),
|
|
292
277
|
suggestedResalePrice: this.utilities.sanitizeNumber(this.consignmentAttributes.suggestedResalePrice),
|
|
293
278
|
salePrice: this.utilities.sanitizeNumber(this.consignmentAttributes.salePrice),
|
|
@@ -505,6 +490,12 @@ class Product extends Base_1.default {
|
|
|
505
490
|
name: 'featuredCollections',
|
|
506
491
|
type: 'string[]',
|
|
507
492
|
},
|
|
493
|
+
{
|
|
494
|
+
facet: true,
|
|
495
|
+
optional: true,
|
|
496
|
+
name: 'primaryAgeCategory',
|
|
497
|
+
type: 'string',
|
|
498
|
+
},
|
|
508
499
|
{
|
|
509
500
|
facet: true,
|
|
510
501
|
optional: true,
|
|
@@ -517,6 +508,12 @@ class Product extends Base_1.default {
|
|
|
517
508
|
name: 'merchants',
|
|
518
509
|
type: 'string[]',
|
|
519
510
|
},
|
|
511
|
+
{
|
|
512
|
+
facet: false,
|
|
513
|
+
optional: false,
|
|
514
|
+
name: 'merchantId',
|
|
515
|
+
type: 'string',
|
|
516
|
+
},
|
|
520
517
|
{
|
|
521
518
|
facet: true,
|
|
522
519
|
name: 'price',
|
|
@@ -20,6 +20,7 @@ declare type ProductAttributes = {
|
|
|
20
20
|
compareAtPrice?: string;
|
|
21
21
|
quantity?: number | string;
|
|
22
22
|
merchants?: string[];
|
|
23
|
+
merchantId?: string;
|
|
23
24
|
editorAuthorizations?: EditorAuthorization;
|
|
24
25
|
rfidTag?: string;
|
|
25
26
|
};
|
|
@@ -40,11 +41,11 @@ declare type ProductFilterAttributes = {
|
|
|
40
41
|
productStyle: string[];
|
|
41
42
|
measurements: Measurements;
|
|
42
43
|
featuredCollections?: string[];
|
|
44
|
+
primaryAgeCategory: string;
|
|
43
45
|
tags?: string[];
|
|
44
46
|
};
|
|
45
47
|
declare type ProductConsignmentAttributes = {
|
|
46
48
|
sellRequestImageUrls: string[];
|
|
47
|
-
previousSellers: string[];
|
|
48
49
|
sellRequestId: string;
|
|
49
50
|
publishType: ProductPublishKeys | string;
|
|
50
51
|
conditionRemarks: string;
|
|
@@ -58,10 +59,6 @@ declare type ProductConsignmentAttributes = {
|
|
|
58
59
|
nextAvailableSeason: string;
|
|
59
60
|
notesForProductionTeam: string;
|
|
60
61
|
reviewedBy: string;
|
|
61
|
-
dateSold: string;
|
|
62
|
-
dateInQualityControl: string;
|
|
63
|
-
dateInPendingPublication: string;
|
|
64
|
-
dateListedOnline: string;
|
|
65
62
|
salesChannel: string[];
|
|
66
63
|
sizeComment: string;
|
|
67
64
|
salePrice: string;
|
|
@@ -170,10 +167,10 @@ declare type ProductFilterAttributesFormFields = {
|
|
|
170
167
|
productType: SingleSelectFormField<string>;
|
|
171
168
|
productStyle: MultiSelectFormField<string>;
|
|
172
169
|
featuredCollections: MultiSelectFormField<string>;
|
|
170
|
+
primaryAgeCategory: SingleSelectFormField<string>;
|
|
173
171
|
tags: MultiSelectFormField<string>;
|
|
174
172
|
};
|
|
175
173
|
declare type ProductConsignmentAttributesFormFields = {
|
|
176
|
-
previousSellers: MultiSelectFormField<string>;
|
|
177
174
|
publishType: SingleSelectFormField<string>;
|
|
178
175
|
conditionRemarks: TextInputFormField<string>;
|
|
179
176
|
productRemarks: TextInputFormField<string>;
|
|
@@ -187,10 +184,6 @@ declare type ProductConsignmentAttributesFormFields = {
|
|
|
187
184
|
notesForProductionTeam: TextInputFormField<string>;
|
|
188
185
|
reviewedBy: SingleSelectFormField<string>;
|
|
189
186
|
filesToUpload: MultiMediaSelectFormField;
|
|
190
|
-
dateSold: SingleSelectFormField<string>;
|
|
191
|
-
dateInQualityControl: SingleSelectFormField<string>;
|
|
192
|
-
dateInPendingPublication: SingleSelectFormField<string>;
|
|
193
|
-
dateListedOnline: SingleSelectFormField<string>;
|
|
194
187
|
salesChannel: MultiSelectFormField<string>;
|
|
195
188
|
sizeComment: SingleSelectFormField<string>;
|
|
196
189
|
isOnSale: SingleSelectFormField<string>;
|
|
@@ -247,8 +240,10 @@ declare type TypesenseProductObj = {
|
|
|
247
240
|
shoeSize: string;
|
|
248
241
|
condition: string;
|
|
249
242
|
featuredCollections: string[];
|
|
243
|
+
primaryAgeCategory: string;
|
|
250
244
|
isOnSale: string;
|
|
251
245
|
merchants: string[];
|
|
246
|
+
merchantId: string;
|
|
252
247
|
price: number;
|
|
253
248
|
suggestedResalePrice: number;
|
|
254
249
|
salePrice: number;
|