rerobe-js-orm 4.3.8 → 4.4.0
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/constants/product-constants.d.ts +21 -0
- package/lib/constants/product-constants.js +14 -2
- package/lib/factories/Product/ProductFromFormState.js +8 -4
- package/lib/form-states/Order/RefundFormState.js +15 -7
- package/lib/form-states/Product/ProductFormState.js +7 -0
- package/lib/form-states/Product/options.d.ts +4 -0
- package/lib/form-states/Product/options.js +16 -1
- package/lib/helpers/ReRobeProductHelpers.js +10 -1
- package/lib/models/Product.d.ts +1 -0
- package/lib/models/Product.js +15 -0
- package/lib/models/ProductStateManager.d.ts +3 -0
- package/lib/types/rerobe-product-state-types.d.ts +9 -0
- package/lib/types/rerobe-product-types.d.ts +10 -1
- package/package.json +1 -1
|
@@ -37,6 +37,9 @@ export namespace SYSTEM_DRIVEN_STATES {
|
|
|
37
37
|
const shoppingBag: string;
|
|
38
38
|
const reservationQueue: string;
|
|
39
39
|
const reserved: string;
|
|
40
|
+
const booked: string;
|
|
41
|
+
const open: string;
|
|
42
|
+
const hidden: string;
|
|
40
43
|
}
|
|
41
44
|
export namespace PRODUCT_STATES {
|
|
42
45
|
const archived_1: string;
|
|
@@ -103,6 +106,12 @@ export namespace PRODUCT_STATES {
|
|
|
103
106
|
export { soldSellerPayoutProcessing_1 as soldSellerPayoutProcessing };
|
|
104
107
|
const soldSellerPayoutFailed_1: string;
|
|
105
108
|
export { soldSellerPayoutFailed_1 as soldSellerPayoutFailed };
|
|
109
|
+
const hidden_1: string;
|
|
110
|
+
export { hidden_1 as hidden };
|
|
111
|
+
const booked_1: string;
|
|
112
|
+
export { booked_1 as booked };
|
|
113
|
+
const open_1: string;
|
|
114
|
+
export { open_1 as open };
|
|
106
115
|
}
|
|
107
116
|
export namespace ADMIN_SIMPLIFIED_STATES {
|
|
108
117
|
const draft_2: string;
|
|
@@ -177,6 +186,12 @@ export namespace PRODUCT_STATE_LABELS {
|
|
|
177
186
|
export { soldSellerPayoutProcessing_2 as soldSellerPayoutProcessing };
|
|
178
187
|
const soldSellerPayoutFailed_2: string;
|
|
179
188
|
export { soldSellerPayoutFailed_2 as soldSellerPayoutFailed };
|
|
189
|
+
const hidden_2: string;
|
|
190
|
+
export { hidden_2 as hidden };
|
|
191
|
+
const booked_2: string;
|
|
192
|
+
export { booked_2 as booked };
|
|
193
|
+
const open_2: string;
|
|
194
|
+
export { open_2 as open };
|
|
180
195
|
}
|
|
181
196
|
export namespace PRODUCT_STATE_LABELS_ADMIN_VIEW {
|
|
182
197
|
const archived_3: string;
|
|
@@ -243,6 +258,12 @@ export namespace PRODUCT_STATE_LABELS_ADMIN_VIEW {
|
|
|
243
258
|
export { soldSellerPayoutProcessing_3 as soldSellerPayoutProcessing };
|
|
244
259
|
const soldSellerPayoutFailed_3: string;
|
|
245
260
|
export { soldSellerPayoutFailed_3 as soldSellerPayoutFailed };
|
|
261
|
+
const hidden_3: string;
|
|
262
|
+
export { hidden_3 as hidden };
|
|
263
|
+
const booked_3: string;
|
|
264
|
+
export { booked_3 as booked };
|
|
265
|
+
const open_3: string;
|
|
266
|
+
export { open_3 as open };
|
|
246
267
|
}
|
|
247
268
|
export namespace MEASUREMENT_CATEGORY {
|
|
248
269
|
const SuitsNBlazers: string;
|
|
@@ -40,7 +40,10 @@ exports.SYSTEM_DRIVEN_STATES = {
|
|
|
40
40
|
shoppingBag: 'IN_SHOPPING_BAG',
|
|
41
41
|
reservationQueue: 'IN_RESERVATION_QUEUE',
|
|
42
42
|
reserved: 'RESERVED',
|
|
43
|
-
|
|
43
|
+
booked: 'BOOKED',
|
|
44
|
+
open: 'OPEN',
|
|
45
|
+
hidden: 'HIDDEN',
|
|
46
|
+
}; // 12
|
|
44
47
|
exports.PRODUCT_STATES = {
|
|
45
48
|
archived: 'ARCHIVED',
|
|
46
49
|
sellerDonated: 'SELLER_DONATED',
|
|
@@ -74,7 +77,10 @@ exports.PRODUCT_STATES = {
|
|
|
74
77
|
soldSellerSelfPay: 'SOLD_SELLER_SELF_PAY',
|
|
75
78
|
soldSellerPayoutProcessing: 'SOLD_SELLER_PAYOUT_PROCESSING',
|
|
76
79
|
soldSellerPayoutFailed: 'SOLD_SELLER_PAYOUT_FAILED',
|
|
77
|
-
|
|
80
|
+
hidden: 'HIDDEN',
|
|
81
|
+
booked: 'BOOKED',
|
|
82
|
+
open: 'OPEN',
|
|
83
|
+
}; // 35
|
|
78
84
|
exports.ADMIN_SIMPLIFIED_STATES = {
|
|
79
85
|
draft: 'DRAFT',
|
|
80
86
|
pendingPublication: 'PENDING_PUBLICATION',
|
|
@@ -113,6 +119,9 @@ exports.PRODUCT_STATE_LABELS = {
|
|
|
113
119
|
soldSellerSelfPay: 'Sold-awaiting self payout',
|
|
114
120
|
soldSellerPayoutProcessing: 'Sold-payout processing',
|
|
115
121
|
soldSellerPayoutFailed: 'Sold-payout failed',
|
|
122
|
+
hidden: 'Hidden',
|
|
123
|
+
booked: 'Booked',
|
|
124
|
+
open: 'Open',
|
|
116
125
|
};
|
|
117
126
|
exports.PRODUCT_STATE_LABELS_ADMIN_VIEW = {
|
|
118
127
|
archived: 'Archived',
|
|
@@ -147,6 +156,9 @@ exports.PRODUCT_STATE_LABELS_ADMIN_VIEW = {
|
|
|
147
156
|
soldSellerSelfPay: 'Sold—awaiting seller self payout',
|
|
148
157
|
soldSellerPayoutProcessing: 'Sold—seller payout processing',
|
|
149
158
|
soldSellerPayoutFailed: 'Sold—seller payout failed',
|
|
159
|
+
hidden: 'Hidden',
|
|
160
|
+
booked: 'Booked',
|
|
161
|
+
open: 'Open',
|
|
150
162
|
};
|
|
151
163
|
exports.MEASUREMENT_CATEGORY = {
|
|
152
164
|
SuitsNBlazers: 'Suits & Blazers',
|
|
@@ -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, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28;
|
|
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, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31;
|
|
8
8
|
const productAttributes = {
|
|
9
9
|
availableForSale: props.fields.availableForSale.selectedValue,
|
|
10
10
|
description: props.fields.description.inputValue,
|
|
@@ -16,6 +16,7 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
16
16
|
imageUrlsForAI: ((_d = props.props) === null || _d === void 0 ? void 0 : _d.imageUrlsForAI) || [],
|
|
17
17
|
price: props.fields.price.inputValue,
|
|
18
18
|
isTaxable: props.fields.isTaxable.selectedValue,
|
|
19
|
+
productClass: props.fields.productClass.selectedValue,
|
|
19
20
|
createdAt: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.createdAt) || new Date().toUTCString(),
|
|
20
21
|
updatedAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.updatedAt) || new Date().toUTCString(),
|
|
21
22
|
publishedAt: ((_g = props.props) === null || _g === void 0 ? void 0 : _g.publishedAt) || new Date().toUTCString(),
|
|
@@ -121,11 +122,14 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
121
122
|
sellerDonatedTimestamp: (_23 = props.props) === null || _23 === void 0 ? void 0 : _23.sellerDonatedTimestamp,
|
|
122
123
|
merchantDonatedTimestamp: (_24 = props.props) === null || _24 === void 0 ? void 0 : _24.merchantDonatedTimestamp,
|
|
123
124
|
draftTimestamp: (_25 = props.props) === null || _25 === void 0 ? void 0 : _25.draftTimestamp,
|
|
125
|
+
hiddenTimestamp: (_26 = props.props) === null || _26 === void 0 ? void 0 : _26.hiddenTimestamp,
|
|
126
|
+
bookedTimestamp: (_27 = props.props) === null || _27 === void 0 ? void 0 : _27.bookedTimestamp,
|
|
127
|
+
openTimestamp: (_28 = props.props) === null || _28 === void 0 ? void 0 : _28.openTimestamp,
|
|
124
128
|
};
|
|
125
129
|
const payoutAttributes = {
|
|
126
|
-
payoutMethod: (
|
|
127
|
-
payoutSystem: (
|
|
128
|
-
payoutReference: (
|
|
130
|
+
payoutMethod: (_29 = props.props) === null || _29 === void 0 ? void 0 : _29.payoutMethod,
|
|
131
|
+
payoutSystem: (_30 = props.props) === null || _30 === void 0 ? void 0 : _30.payoutSystem,
|
|
132
|
+
payoutReference: (_31 = props.props) === null || _31 === void 0 ? void 0 : _31.payoutReference,
|
|
129
133
|
};
|
|
130
134
|
return new Product_1.default(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, productAttributes), productFilterAttributes), consignmentAttributes), timestampAttributes), payoutAttributes));
|
|
131
135
|
}
|
|
@@ -45,20 +45,28 @@ class RefundFormState extends FormState_1.default {
|
|
|
45
45
|
}
|
|
46
46
|
updateDiscountsAndSubtotals() {
|
|
47
47
|
const calculated = this.fields.refundLineItems.selectedValues.reduce((total, item) => {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
49
49
|
const lineItemPriceAmount = Number(item.lineItem.isOnSale === 'yes' ? item.lineItem.salePrice || 0 : (_a = item.lineItem.originalUnitPrice) === null || _a === void 0 ? void 0 : _a.amount);
|
|
50
50
|
const lineItemPricePresentmentAmount = Number(item.lineItem.isOnSale === 'yes'
|
|
51
51
|
? ((_b = item.lineItem.presentmentSalePrice) === null || _b === void 0 ? void 0 : _b.amount) || 0
|
|
52
52
|
: ((_c = item.lineItem.presentmentUnitPrice) === null || _c === void 0 ? void 0 : _c.amount) || 0);
|
|
53
|
+
// Calculate tax-adjusted prices if item is taxable
|
|
54
|
+
const taxAdjustedPriceAmount = item.lineItem.isTaxable && item.lineItem.taxRate
|
|
55
|
+
? Number((lineItemPriceAmount * (1 + Number(item.lineItem.taxRate))).toFixed(2))
|
|
56
|
+
: lineItemPriceAmount;
|
|
57
|
+
const taxAdjustedPresentmentPriceAmount = item.lineItem.isTaxable && ((_d = item.lineItem.presentmentTaxPrice) === null || _d === void 0 ? void 0 : _d.amount)
|
|
58
|
+
? Number((lineItemPricePresentmentAmount +
|
|
59
|
+
Number(item.lineItem.presentmentTaxPrice.amount) / Number(item.lineItem.quantity)).toFixed(2))
|
|
60
|
+
: lineItemPricePresentmentAmount;
|
|
53
61
|
return {
|
|
54
|
-
refundDiscount: total.refundDiscount + Number((
|
|
55
|
-
refundCreditDiscount: total.refundCreditDiscount + Number((
|
|
56
|
-
subtotalRefunded: total.subtotalRefunded + Number(
|
|
62
|
+
refundDiscount: total.refundDiscount + Number((_e = item.discountRefund) === null || _e === void 0 ? void 0 : _e.amount),
|
|
63
|
+
refundCreditDiscount: total.refundCreditDiscount + Number((_f = item.creditDiscountRefund) === null || _f === void 0 ? void 0 : _f.amount),
|
|
64
|
+
subtotalRefunded: total.subtotalRefunded + Number(taxAdjustedPriceAmount * (item.quantityRefund + item.quantityCancel)),
|
|
57
65
|
// Presentment:
|
|
58
|
-
refundDiscountPresentment: total.refundDiscountPresentment + Number((
|
|
59
|
-
refundCreditDiscountPresentment: total.refundCreditDiscountPresentment + Number((
|
|
66
|
+
refundDiscountPresentment: total.refundDiscountPresentment + Number((_g = item.discountRefundPresentment) === null || _g === void 0 ? void 0 : _g.amount),
|
|
67
|
+
refundCreditDiscountPresentment: total.refundCreditDiscountPresentment + Number((_h = item.creditDiscountRefundPresentment) === null || _h === void 0 ? void 0 : _h.amount),
|
|
60
68
|
subtotalRefundedPresentment: total.subtotalRefundedPresentment +
|
|
61
|
-
Number(
|
|
69
|
+
Number(taxAdjustedPresentmentPriceAmount * (item.quantityRefund + item.quantityCancel)),
|
|
62
70
|
};
|
|
63
71
|
}, {
|
|
64
72
|
refundDiscount: 0,
|
|
@@ -85,6 +85,8 @@ class ProductFormState extends FormState_1.default {
|
|
|
85
85
|
this.fields.metaDataTitle = this.fieldFactory('textInput', 'metaDataTitle');
|
|
86
86
|
this.fields.metaDataDescription = this.fieldFactory('textInput', 'metaDataDescription');
|
|
87
87
|
this.fields.handle = this.fieldFactory('textInput', 'handle');
|
|
88
|
+
// Product Classification (UNIQUE, MULTI, TEMPLATE)
|
|
89
|
+
this.fields.productClass = this.fieldFactory('singleSelect', 'productClass', options_1.productClassOptions);
|
|
88
90
|
}
|
|
89
91
|
autoCreateTitle() {
|
|
90
92
|
return this.createProduct().autoCreateTitle();
|
|
@@ -590,6 +592,11 @@ class ProductFormState extends FormState_1.default {
|
|
|
590
592
|
valid = true;
|
|
591
593
|
onChangeHandler = (val) => this.singleSelectChangeHandler(fieldKey, val);
|
|
592
594
|
}
|
|
595
|
+
if (fieldKey === 'productClass') {
|
|
596
|
+
selectedValue = this.props[fieldKey] || '';
|
|
597
|
+
valid = true;
|
|
598
|
+
onChangeHandler = (val) => this.singleSelectChangeHandler(fieldKey, val);
|
|
599
|
+
}
|
|
593
600
|
if (fieldKey === 'discountType') {
|
|
594
601
|
valid = true;
|
|
595
602
|
onChangeHandler = (val) => this.discountTypeChangeHandler(val);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.primaryAgeCategoryOptions = exports.adminStatusOptionsSimplified = exports.adminStatusOptions = exports.measurementCategoryOptions = exports.minorDefectOptions = exports.majorDefectOptions = exports.productOptions = exports.productYesNoOptions = exports.discountTypeOptions = exports.salesChannelOptions = exports.unisexJewelry = exports.mensJewelry = exports.jewelry = exports.unisexAccessories = exports.mensAccessories = exports.accessories = exports.unisexBags = exports.mensBags = exports.bags = exports.weightUnits = exports.productWeightRanges = exports.unisexShoes = exports.mensShoes = exports.shoes = exports.unisexClothing = exports.mensClothing = exports.clothing = exports.productCategories = exports.clothingMaterials = exports.shoeSizes = exports.jeanSizes = exports.genderOptions = exports.conditions = exports.colors = exports.brands = exports.sizeCommentOptions = exports.manClothingSizeOptions = exports.womanClothingSizeOptions = exports.clothingSizeOptions = exports.sizeOptions = exports.statusOptions = exports.publishTypeOptions = exports.availableForSaleOptions = void 0;
|
|
3
|
+
exports.primaryAgeCategoryOptions = exports.adminStatusOptionsSimplified = exports.adminStatusOptions = exports.measurementCategoryOptions = exports.minorDefectOptions = exports.majorDefectOptions = exports.productOptions = exports.productClassOptions = exports.productYesNoOptions = exports.discountTypeOptions = exports.salesChannelOptions = exports.unisexJewelry = exports.mensJewelry = exports.jewelry = exports.unisexAccessories = exports.mensAccessories = exports.accessories = exports.unisexBags = exports.mensBags = exports.bags = exports.weightUnits = exports.productWeightRanges = exports.unisexShoes = exports.mensShoes = exports.shoes = exports.unisexClothing = exports.mensClothing = exports.clothing = exports.productCategories = exports.clothingMaterials = exports.shoeSizes = exports.jeanSizes = exports.genderOptions = exports.conditions = exports.colors = exports.brands = exports.sizeCommentOptions = exports.manClothingSizeOptions = exports.womanClothingSizeOptions = exports.clothingSizeOptions = exports.sizeOptions = 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 = [
|
|
@@ -1058,6 +1058,21 @@ const productYesNoOptions = [
|
|
|
1058
1058
|
},
|
|
1059
1059
|
];
|
|
1060
1060
|
exports.productYesNoOptions = productYesNoOptions;
|
|
1061
|
+
const productClassOptions = [
|
|
1062
|
+
{
|
|
1063
|
+
label: 'Unique (One-of-a-kind, no variants)',
|
|
1064
|
+
value: 'UNIQUE',
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
label: 'Multi (Parent with multiple variants)',
|
|
1068
|
+
value: 'MULTI',
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
label: 'Template (Blueprint for cloning)',
|
|
1072
|
+
value: 'TEMPLATE',
|
|
1073
|
+
},
|
|
1074
|
+
];
|
|
1075
|
+
exports.productClassOptions = productClassOptions;
|
|
1061
1076
|
const productOptions = [
|
|
1062
1077
|
{ value: 'size', label: 'Size' },
|
|
1063
1078
|
{ value: 'color', label: 'Color' },
|
|
@@ -371,7 +371,7 @@ class ReRobeProductHelpers {
|
|
|
371
371
|
static createTimestampsForStates(productObj) {
|
|
372
372
|
const docFieldsToUpdate = {};
|
|
373
373
|
if (productObj) {
|
|
374
|
-
const { status, sellRequestReviewDraftTimestamp, sellRequestReviewTimestamp, rejectedTimestamp, holdTimestamp, acceptedTimestamp, sellerToDropOffTimestamp, sellerToShipTimestamp, sellerToGetPickUpTimestamp, qualityControlTimestamp, pendingPublicationTimestamp, listedTimestamp, clearanceTimestamp, reservedTimestamp, soldTimestamp, soldSellerToBePaidTimestamp, soldSellerPaidTimestamp, returnedTimestamp, sellerSelfRejectTimestamp, liquidationRequestedTimestamp, sellerLiquidatedTimestamp, archivedTimestamp, liquidationReadyTimestamp, sellerDonatedTimestamp, merchantDonatedTimestamp, draftTimestamp, soldSellerSelfPayTimestamp, soldSellerPayoutProcessingTimestamp, soldSellerPayoutFailedTimestamp, } = productObj;
|
|
374
|
+
const { status, sellRequestReviewDraftTimestamp, sellRequestReviewTimestamp, rejectedTimestamp, holdTimestamp, acceptedTimestamp, sellerToDropOffTimestamp, sellerToShipTimestamp, sellerToGetPickUpTimestamp, qualityControlTimestamp, pendingPublicationTimestamp, listedTimestamp, clearanceTimestamp, reservedTimestamp, soldTimestamp, soldSellerToBePaidTimestamp, soldSellerPaidTimestamp, returnedTimestamp, sellerSelfRejectTimestamp, liquidationRequestedTimestamp, sellerLiquidatedTimestamp, archivedTimestamp, liquidationReadyTimestamp, sellerDonatedTimestamp, merchantDonatedTimestamp, draftTimestamp, soldSellerSelfPayTimestamp, soldSellerPayoutProcessingTimestamp, soldSellerPayoutFailedTimestamp, hiddenTimestamp, bookedTimestamp, openTimestamp, } = productObj;
|
|
375
375
|
if (status === product_constants_1.PRODUCT_STATES.sellRequestReviewDraft && !sellRequestReviewDraftTimestamp) {
|
|
376
376
|
docFieldsToUpdate.sellRequestReviewDraftTimestamp = new Date().getTime();
|
|
377
377
|
}
|
|
@@ -488,6 +488,15 @@ class ReRobeProductHelpers {
|
|
|
488
488
|
if (status === product_constants_1.PRODUCT_STATES.draft && !draftTimestamp) {
|
|
489
489
|
docFieldsToUpdate.draftTimestamp = new Date().getTime();
|
|
490
490
|
}
|
|
491
|
+
if (status === product_constants_1.PRODUCT_STATES.hidden && !hiddenTimestamp) {
|
|
492
|
+
docFieldsToUpdate.hiddenTimestamp = new Date().getTime();
|
|
493
|
+
}
|
|
494
|
+
if (status === product_constants_1.PRODUCT_STATES.booked && !bookedTimestamp) {
|
|
495
|
+
docFieldsToUpdate.bookedTimestamp = new Date().getTime();
|
|
496
|
+
}
|
|
497
|
+
if (status === product_constants_1.PRODUCT_STATES.open && !openTimestamp) {
|
|
498
|
+
docFieldsToUpdate.openTimestamp = new Date().getTime();
|
|
499
|
+
}
|
|
491
500
|
}
|
|
492
501
|
return docFieldsToUpdate;
|
|
493
502
|
}
|
package/lib/models/Product.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export default class Product extends Base {
|
|
|
43
43
|
soldSellerPaidTimestamp: number | null;
|
|
44
44
|
soldSellerToBePaidTimestamp: number | null;
|
|
45
45
|
isTaxable: string | undefined;
|
|
46
|
+
productClass: string | undefined;
|
|
46
47
|
};
|
|
47
48
|
updateSelfFromTranslatedTextArray(translatedTextArray?: string[]): void;
|
|
48
49
|
autoCreateTitle(): string;
|
package/lib/models/Product.js
CHANGED
|
@@ -40,6 +40,7 @@ class Product extends Base_1.default {
|
|
|
40
40
|
metaDataTitle: (props === null || props === void 0 ? void 0 : props.metaDataTitle) || '',
|
|
41
41
|
metaDataDescription: (props === null || props === void 0 ? void 0 : props.metaDataDescription) || '',
|
|
42
42
|
isTaxable: (props === null || props === void 0 ? void 0 : props.isTaxable) || '',
|
|
43
|
+
productClass: (props === null || props === void 0 ? void 0 : props.productClass) || 'UNIQUE',
|
|
43
44
|
};
|
|
44
45
|
this.filterAttributes = {
|
|
45
46
|
documentId: (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28),
|
|
@@ -128,6 +129,9 @@ class Product extends Base_1.default {
|
|
|
128
129
|
liquidationReadyTimestamp: (props === null || props === void 0 ? void 0 : props.liquidationReadyTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.liquidationReadyTimestamp) : null,
|
|
129
130
|
sellerDonatedTimestamp: (props === null || props === void 0 ? void 0 : props.sellerDonatedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.sellerDonatedTimestamp) : null,
|
|
130
131
|
merchantDonatedTimestamp: (props === null || props === void 0 ? void 0 : props.merchantDonatedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.merchantDonatedTimestamp) : null,
|
|
132
|
+
hiddenTimestamp: (props === null || props === void 0 ? void 0 : props.hiddenTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.hiddenTimestamp) : null,
|
|
133
|
+
bookedTimestamp: (props === null || props === void 0 ? void 0 : props.bookedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.bookedTimestamp) : null,
|
|
134
|
+
openTimestamp: (props === null || props === void 0 ? void 0 : props.openTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.openTimestamp) : null,
|
|
131
135
|
draftTimestamp: (props === null || props === void 0 ? void 0 : props.draftTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.draftTimestamp) : null,
|
|
132
136
|
soldSellerSelfPayTimestamp: (props === null || props === void 0 ? void 0 : props.soldSellerSelfPayTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.soldSellerSelfPayTimestamp) : null,
|
|
133
137
|
soldSellerPayoutProcessingTimestamp: (props === null || props === void 0 ? void 0 : props.soldSellerPayoutProcessingTimestamp)
|
|
@@ -377,6 +381,9 @@ class Product extends Base_1.default {
|
|
|
377
381
|
liquidationReadyTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.liquidationReadyTimestamp),
|
|
378
382
|
sellerDonatedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.sellerDonatedTimestamp),
|
|
379
383
|
merchantDonatedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.merchantDonatedTimestamp),
|
|
384
|
+
hiddenTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.hiddenTimestamp),
|
|
385
|
+
bookedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.bookedTimestamp),
|
|
386
|
+
openTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.openTimestamp),
|
|
380
387
|
draftTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.draftTimestamp),
|
|
381
388
|
selectedForClearance: this.utilities.sanitizeString(this.consignmentAttributes.selectedForClearance),
|
|
382
389
|
availableForSale: !!this.attributes.availableForSale,
|
|
@@ -396,6 +403,7 @@ class Product extends Base_1.default {
|
|
|
396
403
|
'inventoryLocations.ids': this.consignmentAttributes.inventoryLocations && Array.isArray(this.consignmentAttributes.inventoryLocations)
|
|
397
404
|
? this.consignmentAttributes.inventoryLocations.map((c) => String(c.id))
|
|
398
405
|
: [],
|
|
406
|
+
productClass: this.utilities.sanitizeString(this.attributes.productClass),
|
|
399
407
|
};
|
|
400
408
|
if (((_a = this.consignmentAttributes) === null || _a === void 0 ? void 0 : _a.inventoryLocations) &&
|
|
401
409
|
Array.isArray((_b = this.consignmentAttributes) === null || _b === void 0 ? void 0 : _b.inventoryLocations)) {
|
|
@@ -444,6 +452,7 @@ class Product extends Base_1.default {
|
|
|
444
452
|
soldSellerPaidTimestamp: this.timestampAttributes.soldSellerPaidTimestamp,
|
|
445
453
|
soldSellerToBePaidTimestamp: this.timestampAttributes.soldSellerToBePaidTimestamp,
|
|
446
454
|
isTaxable: this.attributes.isTaxable,
|
|
455
|
+
productClass: this.attributes.productClass,
|
|
447
456
|
};
|
|
448
457
|
}
|
|
449
458
|
updateSelfFromTranslatedTextArray(translatedTextArray = []) {
|
|
@@ -1024,6 +1033,12 @@ class Product extends Base_1.default {
|
|
|
1024
1033
|
type: 'string',
|
|
1025
1034
|
optional: true,
|
|
1026
1035
|
},
|
|
1036
|
+
{
|
|
1037
|
+
facet: true,
|
|
1038
|
+
name: 'productClass',
|
|
1039
|
+
type: 'string',
|
|
1040
|
+
optional: true,
|
|
1041
|
+
},
|
|
1027
1042
|
],
|
|
1028
1043
|
name,
|
|
1029
1044
|
};
|
|
@@ -42,6 +42,9 @@ export default class ProductStateManager extends Base {
|
|
|
42
42
|
soldSellerSelfPay: string;
|
|
43
43
|
soldSellerPayoutProcessing: string;
|
|
44
44
|
soldSellerPayoutFailed: string;
|
|
45
|
+
hidden: string;
|
|
46
|
+
booked: string;
|
|
47
|
+
open: string;
|
|
45
48
|
};
|
|
46
49
|
state: ProductState;
|
|
47
50
|
states: Record<ProductStateKey, ProductState>;
|
|
@@ -7,6 +7,9 @@ type ProductStateDictionary = {
|
|
|
7
7
|
reservationQueue: string;
|
|
8
8
|
sold: string;
|
|
9
9
|
availableInStore: string;
|
|
10
|
+
hidden: string;
|
|
11
|
+
booked: string;
|
|
12
|
+
open: string;
|
|
10
13
|
};
|
|
11
14
|
interface ProductStateChangeHandlers {
|
|
12
15
|
toLoading: () => void;
|
|
@@ -17,6 +20,9 @@ interface ProductStateChangeHandlers {
|
|
|
17
20
|
toReservationQueue: () => void;
|
|
18
21
|
toSold: () => void;
|
|
19
22
|
toAvailableInStore: () => void;
|
|
23
|
+
toHidden: () => void;
|
|
24
|
+
toBooked: () => void;
|
|
25
|
+
toOpen: () => void;
|
|
20
26
|
getVal: () => string;
|
|
21
27
|
}
|
|
22
28
|
interface ProductState extends ProductStateChangeHandlers {
|
|
@@ -32,6 +38,9 @@ type ProductStates = {
|
|
|
32
38
|
reservationQueue: ProductState;
|
|
33
39
|
sold: ProductState;
|
|
34
40
|
availableInStore: ProductState;
|
|
41
|
+
hidden: ProductState;
|
|
42
|
+
booked: ProductState;
|
|
43
|
+
open: ProductState;
|
|
35
44
|
};
|
|
36
45
|
interface ProductStateManagerClassProtocol extends ProductStateChangeHandlers {
|
|
37
46
|
state: ProductState;
|
|
@@ -30,6 +30,7 @@ type ProductAttributes = {
|
|
|
30
30
|
metaDataTitle?: string;
|
|
31
31
|
metaDataDescription?: string;
|
|
32
32
|
isTaxable?: string;
|
|
33
|
+
productClass?: 'UNIQUE' | 'MULTI' | 'TEMPLATE' | string;
|
|
33
34
|
};
|
|
34
35
|
type ProductFilterAttributes = {
|
|
35
36
|
documentId: string;
|
|
@@ -114,6 +115,9 @@ type ProductTimestampAttributes = {
|
|
|
114
115
|
liquidationReadyTimestamp: number | null;
|
|
115
116
|
sellerDonatedTimestamp: number | null;
|
|
116
117
|
merchantDonatedTimestamp: number | null;
|
|
118
|
+
hiddenTimestamp: number | null;
|
|
119
|
+
bookedTimestamp: number | null;
|
|
120
|
+
openTimestamp: number | null;
|
|
117
121
|
};
|
|
118
122
|
type TranslatableAttributes = {
|
|
119
123
|
description: string;
|
|
@@ -147,7 +151,7 @@ type MaterialComposition = {
|
|
|
147
151
|
type EditorAuthorization = {
|
|
148
152
|
[key: string]: string[];
|
|
149
153
|
};
|
|
150
|
-
type ProductSellStatusKeys = 'SELL_REQUEST_REVIEW' | 'REJECTED' | 'HOLD' | 'ACCEPTED' | 'DROP_OFF_AT_REROBE' | 'SHIP_TO_REROBE' | 'AT_HOME_PICK_UP' | 'QUALITY_CONTROL' | 'LISTED' | 'SOLD' | 'RETURNED' | 'SOLD_SELLER_TO_BE_PAID' | 'SOLD_SELLER_PAID';
|
|
154
|
+
type ProductSellStatusKeys = 'SELL_REQUEST_REVIEW' | 'REJECTED' | 'HOLD' | 'ACCEPTED' | 'DROP_OFF_AT_REROBE' | 'SHIP_TO_REROBE' | 'AT_HOME_PICK_UP' | 'QUALITY_CONTROL' | 'LISTED' | 'SOLD' | 'RETURNED' | 'SOLD_SELLER_TO_BE_PAID' | 'SOLD_SELLER_PAID' | 'HIDDEN' | 'BOOKED' | 'OPEN';
|
|
151
155
|
type ProductPublishKeys = 'USER_PUBLISHED' | 'MERCHANT_PUBLISHED';
|
|
152
156
|
type ShopifyProduct = ProductAttributes & ProductFilterAttributes;
|
|
153
157
|
type PayoutAttributes = {
|
|
@@ -181,6 +185,7 @@ type ProductAttributesFormFields = {
|
|
|
181
185
|
metaDataDescription: TextInputFormField<string>;
|
|
182
186
|
handle: TextInputFormField<string>;
|
|
183
187
|
isTaxable: SingleSelectFormField<string>;
|
|
188
|
+
productClass: SingleSelectFormField<string>;
|
|
184
189
|
};
|
|
185
190
|
type ProductFilterAttributesFormFields = {
|
|
186
191
|
brand: SingleSelectFormField<string>;
|
|
@@ -335,6 +340,9 @@ type TypesenseProductObj = {
|
|
|
335
340
|
liquidationReadyTimestamp: number;
|
|
336
341
|
sellerDonatedTimestamp: number | null;
|
|
337
342
|
merchantDonatedTimestamp: number | null;
|
|
343
|
+
hiddenTimestamp: number | null;
|
|
344
|
+
bookedTimestamp: number | null;
|
|
345
|
+
openTimestamp: number | null;
|
|
338
346
|
availableForSale: boolean;
|
|
339
347
|
color: string;
|
|
340
348
|
description: string;
|
|
@@ -358,6 +366,7 @@ type TypesenseProductObj = {
|
|
|
358
366
|
payoutMethod: 'CASH' | 'STORE_CREDIT' | null;
|
|
359
367
|
payoutSystem: 'STRIPE' | 'MANUAL_TRANSFER' | 'RIBBN_CREDITS' | null;
|
|
360
368
|
payoutReference: string;
|
|
369
|
+
productClass: string;
|
|
361
370
|
[key: string]: any;
|
|
362
371
|
};
|
|
363
372
|
type GoogleMerchantCenterProductObj = {
|