rerobe-js-orm 3.5.8 → 3.6.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/notification-constants.d.ts +1 -0
- package/lib/constants/notification-constants.js +1 -0
- package/lib/factories/Product/ProductFromFormState.js +1 -0
- package/lib/form-states/Product/ProductFormState.js +7 -1
- package/lib/form-states/Product/options.d.ts +1 -1
- package/lib/form-states/Product/options.js +3 -3
- package/lib/helpers/OrderHelpers.d.ts +2 -0
- package/lib/models/Product.js +8 -0
- package/lib/types/rerobe-order-types.d.ts +2 -0
- package/lib/types/rerobe-product-types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
14
14
|
coverPhotoUrl: ((_b = props.props) === null || _b === void 0 ? void 0 : _b.coverPhotoUrl) || '',
|
|
15
15
|
imageUrls: ((_c = props.props) === null || _c === void 0 ? void 0 : _c.imageUrls) || [],
|
|
16
16
|
price: props.fields.price.inputValue,
|
|
17
|
+
isTaxable: props.fields.isTaxable.selectedValue,
|
|
17
18
|
createdAt: ((_d = props.props) === null || _d === void 0 ? void 0 : _d.createdAt) || new Date().toUTCString(),
|
|
18
19
|
updatedAt: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.updatedAt) || new Date().toUTCString(),
|
|
19
20
|
publishedAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.publishedAt) || new Date().toUTCString(),
|
|
@@ -14,6 +14,7 @@ class ProductFormState extends FormState_1.default {
|
|
|
14
14
|
this.fields.description = this.fieldFactory('textInput', 'description');
|
|
15
15
|
this.fields.title = this.fieldFactory('textInput', 'title');
|
|
16
16
|
this.fields.price = this.fieldFactory('textInput', 'price');
|
|
17
|
+
this.fields.isTaxable = this.fieldFactory('singleSelect', 'isTaxable', options_1.productYesNoOptions);
|
|
17
18
|
this.fields.weight = this.fieldFactory('textInput', 'weight');
|
|
18
19
|
this.fields.weightRange = this.fieldFactory('singleSelect', 'weightRange', options_1.productWeightRanges);
|
|
19
20
|
this.fields.weightUnit = this.fieldFactory('singleSelect', 'weightUnit', options_1.weightUnits);
|
|
@@ -65,7 +66,7 @@ class ProductFormState extends FormState_1.default {
|
|
|
65
66
|
valid: false,
|
|
66
67
|
onChangeHandler: (fileArr) => this.multiSelectMediaChangeHandler('filesToUpload', fileArr),
|
|
67
68
|
};
|
|
68
|
-
this.fields.isOnSale = this.fieldFactory('singleSelect', 'isOnSale', options_1.
|
|
69
|
+
this.fields.isOnSale = this.fieldFactory('singleSelect', 'isOnSale', options_1.productYesNoOptions);
|
|
69
70
|
this.fields.discountType = this.fieldFactory('singleSelect', 'discountType', options_1.discountTypeOptions);
|
|
70
71
|
this.fields.discountValue = this.fieldFactory('textInput', 'discountValue');
|
|
71
72
|
this.fields.editorAuthorizations = this.fieldFactory('singleSelect', 'editorAuthorizations', Object.keys(new Product_1.default().toObj()).map((v) => ({ label: this.utilities.startCase(v), value: v })));
|
|
@@ -509,6 +510,11 @@ class ProductFormState extends FormState_1.default {
|
|
|
509
510
|
valid = true;
|
|
510
511
|
onChangeHandler = (val) => this.singleSelectChangeHandler(fieldKey, val);
|
|
511
512
|
}
|
|
513
|
+
if (fieldKey === 'isTaxable') {
|
|
514
|
+
selectedValue = this.props[fieldKey] || '';
|
|
515
|
+
valid = true;
|
|
516
|
+
onChangeHandler = (val) => this.singleSelectChangeHandler(fieldKey, val);
|
|
517
|
+
}
|
|
512
518
|
if (fieldKey === 'discountType') {
|
|
513
519
|
valid = true;
|
|
514
520
|
onChangeHandler = (val) => this.discountTypeChangeHandler(val);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.measurementCategoryOptions = exports.minorDefectOptions = exports.majorDefectOptions = exports.productOptions = exports.
|
|
3
|
+
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;
|
|
4
4
|
const product_constants_1 = require("../../constants/product-constants");
|
|
5
5
|
const lodash_1 = require("lodash");
|
|
6
6
|
const availableForSaleOptions = [
|
|
@@ -2378,7 +2378,7 @@ const discountTypeOptions = [
|
|
|
2378
2378
|
},
|
|
2379
2379
|
];
|
|
2380
2380
|
exports.discountTypeOptions = discountTypeOptions;
|
|
2381
|
-
const
|
|
2381
|
+
const productYesNoOptions = [
|
|
2382
2382
|
{
|
|
2383
2383
|
label: 'Yes',
|
|
2384
2384
|
value: 'yes',
|
|
@@ -2388,7 +2388,7 @@ const productIsOnSaleOptions = [
|
|
|
2388
2388
|
value: 'no',
|
|
2389
2389
|
},
|
|
2390
2390
|
];
|
|
2391
|
-
exports.
|
|
2391
|
+
exports.productYesNoOptions = productYesNoOptions;
|
|
2392
2392
|
const productOptions = [
|
|
2393
2393
|
{ value: 'size', label: 'Size' },
|
|
2394
2394
|
{ value: 'color', label: 'Color' },
|
|
@@ -88,7 +88,9 @@ export default class OrderHelpers {
|
|
|
88
88
|
unfulfilledQuantity?: string | number | undefined;
|
|
89
89
|
status?: string | undefined;
|
|
90
90
|
isOnSale?: string | undefined;
|
|
91
|
+
isTaxable?: string | undefined;
|
|
91
92
|
salePrice?: string | undefined;
|
|
93
|
+
presentmentTaxPrice?: Money | undefined;
|
|
92
94
|
title: string;
|
|
93
95
|
quantity: string | number;
|
|
94
96
|
variant: ProductVariant | null;
|
package/lib/models/Product.js
CHANGED
|
@@ -37,6 +37,7 @@ class Product extends Base_1.default {
|
|
|
37
37
|
sku: (props === null || props === void 0 ? void 0 : props.sku) || '',
|
|
38
38
|
metaDataTitle: (props === null || props === void 0 ? void 0 : props.metaDataTitle) || '',
|
|
39
39
|
metaDataDescription: (props === null || props === void 0 ? void 0 : props.metaDataDescription) || '',
|
|
40
|
+
isTaxable: (props === null || props === void 0 ? void 0 : props.isTaxable) || '',
|
|
40
41
|
};
|
|
41
42
|
this.filterAttributes = {
|
|
42
43
|
documentId: (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28),
|
|
@@ -287,6 +288,7 @@ class Product extends Base_1.default {
|
|
|
287
288
|
featuredCollections: this.utilities.sanitzeStringArr(this.filterAttributes.featuredCollections),
|
|
288
289
|
primaryAgeCategory: this.utilities.sanitizeString(this.filterAttributes.primaryAgeCategory),
|
|
289
290
|
isOnSale: this.utilities.sanitizeString(this.consignmentAttributes.isOnSale),
|
|
291
|
+
isTaxable: this.utilities.sanitizeString(this.attributes.isTaxable),
|
|
290
292
|
merchants: this.utilities.sanitzeStringArr(this.attributes.merchants),
|
|
291
293
|
merchantId: this.utilities.sanitizeString(this.attributes.merchantId),
|
|
292
294
|
price: this.utilities.sanitizeNumber(this.attributes.price),
|
|
@@ -629,6 +631,12 @@ class Product extends Base_1.default {
|
|
|
629
631
|
name: 'isOnSale',
|
|
630
632
|
type: 'string',
|
|
631
633
|
},
|
|
634
|
+
{
|
|
635
|
+
facet: true,
|
|
636
|
+
optional: true,
|
|
637
|
+
name: 'isTaxable',
|
|
638
|
+
type: 'string',
|
|
639
|
+
},
|
|
632
640
|
{
|
|
633
641
|
facet: false,
|
|
634
642
|
optional: false,
|
|
@@ -247,10 +247,12 @@ interface ReRobeOrderLineItem extends OrderLineItem {
|
|
|
247
247
|
unfulfilledQuantity?: number | string;
|
|
248
248
|
status?: ProductSellStatusKeys | string;
|
|
249
249
|
isOnSale?: string;
|
|
250
|
+
isTaxable?: string;
|
|
250
251
|
salePrice?: string;
|
|
251
252
|
presentmentTotalPrice?: Money;
|
|
252
253
|
presentmentUnitPrice?: Money;
|
|
253
254
|
presentmentSalePrice?: Money;
|
|
255
|
+
presentmentTaxPrice?: Money;
|
|
254
256
|
}
|
|
255
257
|
type OrderLineItemConnection = {
|
|
256
258
|
edges: OrderLineItemEdge[];
|
|
@@ -28,6 +28,7 @@ type ProductAttributes = {
|
|
|
28
28
|
sku?: string;
|
|
29
29
|
metaDataTitle?: string;
|
|
30
30
|
metaDataDescription?: string;
|
|
31
|
+
isTaxable?: string;
|
|
31
32
|
};
|
|
32
33
|
type ProductFilterAttributes = {
|
|
33
34
|
documentId: string;
|
|
@@ -166,6 +167,7 @@ type ProductAttributesFormFields = {
|
|
|
166
167
|
metaDataTitle: TextInputFormField<string>;
|
|
167
168
|
metaDataDescription: TextInputFormField<string>;
|
|
168
169
|
handle: TextInputFormField<string>;
|
|
170
|
+
isTaxable: SingleSelectFormField<string>;
|
|
169
171
|
};
|
|
170
172
|
type ProductFilterAttributesFormFields = {
|
|
171
173
|
brand: SingleSelectFormField<string>;
|
|
@@ -259,6 +261,7 @@ type TypesenseProductObj = {
|
|
|
259
261
|
featuredCollections: string[];
|
|
260
262
|
primaryAgeCategory: string;
|
|
261
263
|
isOnSale: string;
|
|
264
|
+
isTaxable: string;
|
|
262
265
|
merchants: string[];
|
|
263
266
|
merchantId: string;
|
|
264
267
|
price: number;
|