rerobe-js-orm 3.0.22 → 3.0.24
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/merchant-constants.d.ts +37 -0
- package/lib/constants/merchant-constants.js +41 -0
- package/lib/form-states/Product/ProductFormState.d.ts +1 -1
- package/lib/form-states/Product/ProductFormState.js +6 -6
- package/lib/form-states/Product/options.d.ts +1 -1
- package/lib/form-states/Product/options.js +42 -5
- package/lib/models/Merchant.d.ts +1 -0
- package/lib/models/Merchant.js +8 -37
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export namespace MERCHANT_TYPES {
|
|
2
|
+
const individual: string;
|
|
3
|
+
const business: string;
|
|
4
|
+
const enterprise: string;
|
|
5
|
+
}
|
|
6
|
+
export namespace PAYMENT_TIERS {
|
|
7
|
+
const free: string;
|
|
8
|
+
const one: string;
|
|
9
|
+
}
|
|
10
|
+
export namespace INDUSTRY_TYPES {
|
|
11
|
+
const beauty: string;
|
|
12
|
+
const clothing: string;
|
|
13
|
+
const electronics: string;
|
|
14
|
+
const furniture: string;
|
|
15
|
+
const handcrafts: string;
|
|
16
|
+
const jewelry: string;
|
|
17
|
+
const sports: string;
|
|
18
|
+
const toys: string;
|
|
19
|
+
const other: string;
|
|
20
|
+
}
|
|
21
|
+
export namespace UNIT_SYSTEM_TYPES {
|
|
22
|
+
const metric: string;
|
|
23
|
+
const imperial: string;
|
|
24
|
+
}
|
|
25
|
+
export namespace METRIC_WEIGHT_TYPES {
|
|
26
|
+
const kilogram: string;
|
|
27
|
+
const gram: string;
|
|
28
|
+
}
|
|
29
|
+
export namespace IMPERIAL_WEIGHT_TYPES {
|
|
30
|
+
const pound: string;
|
|
31
|
+
const once: string;
|
|
32
|
+
}
|
|
33
|
+
export namespace RIBBN_WEBHOOK_EVENT_DICT {
|
|
34
|
+
const productCreate: string;
|
|
35
|
+
const productUpdate: string;
|
|
36
|
+
const productDelete: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RIBBN_WEBHOOK_EVENT_DICT = exports.IMPERIAL_WEIGHT_TYPES = exports.METRIC_WEIGHT_TYPES = exports.UNIT_SYSTEM_TYPES = exports.INDUSTRY_TYPES = exports.PAYMENT_TIERS = exports.MERCHANT_TYPES = void 0;
|
|
4
|
+
exports.MERCHANT_TYPES = {
|
|
5
|
+
individual: 'INDIVIDUAL',
|
|
6
|
+
business: 'BUSINESS',
|
|
7
|
+
enterprise: 'ENTERPRISE',
|
|
8
|
+
};
|
|
9
|
+
exports.PAYMENT_TIERS = {
|
|
10
|
+
free: 'FREE',
|
|
11
|
+
one: 'TIER_ONE',
|
|
12
|
+
};
|
|
13
|
+
exports.INDUSTRY_TYPES = {
|
|
14
|
+
beauty: 'BEAUTY',
|
|
15
|
+
clothing: 'CLOTHING',
|
|
16
|
+
electronics: 'ELECTRONICS',
|
|
17
|
+
furniture: 'FURNITURE',
|
|
18
|
+
handcrafts: 'HANDCRAFTS',
|
|
19
|
+
jewelry: 'JEWELRY',
|
|
20
|
+
sports: 'SPORTS',
|
|
21
|
+
toys: 'TOYS',
|
|
22
|
+
other: 'OTHER',
|
|
23
|
+
};
|
|
24
|
+
exports.UNIT_SYSTEM_TYPES = {
|
|
25
|
+
metric: 'METRIC',
|
|
26
|
+
imperial: 'IMPERIAL',
|
|
27
|
+
};
|
|
28
|
+
exports.METRIC_WEIGHT_TYPES = {
|
|
29
|
+
kilogram: 'KILOGRAM',
|
|
30
|
+
gram: 'GRAM',
|
|
31
|
+
};
|
|
32
|
+
exports.IMPERIAL_WEIGHT_TYPES = {
|
|
33
|
+
pound: 'POUND',
|
|
34
|
+
once: 'ONCE',
|
|
35
|
+
};
|
|
36
|
+
exports.RIBBN_WEBHOOK_EVENT_DICT = {
|
|
37
|
+
productCreate: 'PRODUCT_CREATE',
|
|
38
|
+
productUpdate: 'PRODUCT_UPDATE',
|
|
39
|
+
productDelete: 'PRODUCT_DELETE',
|
|
40
|
+
// TODO: Add webhook events for other models (Orders, User, etc)
|
|
41
|
+
};
|
|
@@ -32,7 +32,6 @@ export default class ProductFormState extends FormState {
|
|
|
32
32
|
autoCreateDescription(): string;
|
|
33
33
|
createProduct(): Product;
|
|
34
34
|
private priceInputChangeHandler;
|
|
35
|
-
private setGenderFromPassedOptions;
|
|
36
35
|
private genderSelectHandler;
|
|
37
36
|
private geWeightArray;
|
|
38
37
|
private findWeightRange;
|
|
@@ -42,6 +41,7 @@ export default class ProductFormState extends FormState {
|
|
|
42
41
|
private productCategorySelectHandler;
|
|
43
42
|
private productTypeSelectHandler;
|
|
44
43
|
private setPriceRangeFromPrice;
|
|
44
|
+
private setGenderFromPassedOptions;
|
|
45
45
|
private setProductCategoreisFromGender;
|
|
46
46
|
private setProductTypesFromCategory;
|
|
47
47
|
private setProductTypesFromPassedOptions;
|
|
@@ -100,12 +100,6 @@ class ProductFormState extends FormState_1.default {
|
|
|
100
100
|
// Recalculates salePrice
|
|
101
101
|
this.props.salePrice = this.calculateSalePrice();
|
|
102
102
|
}
|
|
103
|
-
setGenderFromPassedOptions() {
|
|
104
|
-
if (this.opts && this.opts.taxonomy && Object.keys(this.opts.taxonomy).length > 0) {
|
|
105
|
-
return Object.keys(this.opts.taxonomy).map((t) => ({ label: t, value: t }));
|
|
106
|
-
}
|
|
107
|
-
return options_1.gender;
|
|
108
|
-
}
|
|
109
103
|
genderSelectHandler(value) {
|
|
110
104
|
// Mutate gender selectedValue and valid prop
|
|
111
105
|
this.fields.gender.selectedValue = value;
|
|
@@ -261,6 +255,12 @@ class ProductFormState extends FormState_1.default {
|
|
|
261
255
|
}
|
|
262
256
|
return '1000+';
|
|
263
257
|
}
|
|
258
|
+
setGenderFromPassedOptions() {
|
|
259
|
+
if (this.opts && this.opts.taxonomy && Object.keys(this.opts.taxonomy).length > 0) {
|
|
260
|
+
return Object.keys(this.opts.taxonomy).map((t) => ({ label: t, value: t }));
|
|
261
|
+
}
|
|
262
|
+
return options_1.gender;
|
|
263
|
+
}
|
|
264
264
|
setProductCategoreisFromGender(genderSelected) {
|
|
265
265
|
let productCategoryOptions = [];
|
|
266
266
|
if (this.opts && this.opts.taxonomy && Object.keys(this.opts.taxonomy).length > 0 && genderSelected) {
|
|
@@ -38,27 +38,64 @@ const sizeCategoryOptions = [
|
|
|
38
38
|
{
|
|
39
39
|
label: 'Suits & Blazers',
|
|
40
40
|
value: 'Suits & Blazers',
|
|
41
|
-
|
|
41
|
+
measurementFields: ['chestCircumference', 'waistCircumference', 'length', 'shoulderWidth', 'sleeveLength'],
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
label: 'Bottoms',
|
|
45
45
|
value: 'Bottoms',
|
|
46
|
-
|
|
46
|
+
measurementFields: ['waistCircumference', 'innerLeg', 'outerLeg', 'footCircumference'],
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
label: 'Shirts',
|
|
50
50
|
value: 'Shirts',
|
|
51
|
-
|
|
51
|
+
measurementFields: ['neckCircumference', 'collarLength', 'sleeveLength', 'chestCircumference'],
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
label: 'Coats',
|
|
55
55
|
value: 'Coats',
|
|
56
|
-
|
|
56
|
+
measurementFields: ['chestCircumference', 'waistCircumference', 'length', 'shoulderWidth', 'sleeveLength'],
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
label: 'Shoes',
|
|
60
60
|
value: 'Shoes',
|
|
61
|
-
|
|
61
|
+
measurementFields: ['footLength', 'footWidth', 'heelHeight', 'shaftHeight', 'calfCircumference'],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'Dresses',
|
|
65
|
+
value: 'Dresses',
|
|
66
|
+
measurementFields: [
|
|
67
|
+
'bustCircumference',
|
|
68
|
+
'waistCircumference',
|
|
69
|
+
'hipCircumference',
|
|
70
|
+
'length',
|
|
71
|
+
'shoulderWidth',
|
|
72
|
+
'sleeveLength',
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: 'Hats',
|
|
77
|
+
value: 'Hats',
|
|
78
|
+
measurementFields: ['headCircumference', 'brimWidth', 'crownHeight'],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: 'Gloves',
|
|
82
|
+
value: 'Gloves',
|
|
83
|
+
measurementFields: ['handLength', 'handCircumference', 'fingerLength'],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
label: 'Accessories',
|
|
87
|
+
value: 'Accessories',
|
|
88
|
+
measurementFields: ['width', 'height', 'depth'],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'Eyewear',
|
|
92
|
+
value: 'Eyewear',
|
|
93
|
+
measurementFields: ['lensWidth', 'bridgeWidth', 'templeLength'],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: 'General Items',
|
|
97
|
+
value: 'General Items',
|
|
98
|
+
measurementFields: ['width', 'height', 'depth'],
|
|
62
99
|
},
|
|
63
100
|
];
|
|
64
101
|
exports.sizeCategoryOptions = sizeCategoryOptions;
|
package/lib/models/Merchant.d.ts
CHANGED
package/lib/models/Merchant.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const Base_1 = require("../Base");
|
|
4
|
+
const merchant_constants_1 = require("../constants/merchant-constants");
|
|
4
5
|
class Merchant extends Base_1.default {
|
|
5
6
|
constructor(props) {
|
|
6
7
|
super();
|
|
@@ -98,40 +99,10 @@ class Merchant extends Base_1.default {
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
exports.default = Merchant;
|
|
101
|
-
Merchant.MERCHANT_TYPES =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Merchant.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
};
|
|
109
|
-
Merchant.INDUSTRY_TYPES = {
|
|
110
|
-
beauty: 'BEAUTY',
|
|
111
|
-
clothing: 'CLOTHING',
|
|
112
|
-
electronics: 'ELECTRONICS',
|
|
113
|
-
furniture: 'FURNITURE',
|
|
114
|
-
handcrafts: 'HANDCRAFTS',
|
|
115
|
-
jewelry: 'JEWELRY',
|
|
116
|
-
sports: 'SPORTS',
|
|
117
|
-
toys: 'TOYS',
|
|
118
|
-
other: 'OTHER',
|
|
119
|
-
};
|
|
120
|
-
Merchant.UNIT_SYSTEM_TYPES = {
|
|
121
|
-
metric: 'METRIC',
|
|
122
|
-
imperial: 'IMPERIAL',
|
|
123
|
-
};
|
|
124
|
-
Merchant.METRIC_WEIGHT_TYPES = {
|
|
125
|
-
kilogram: 'KILOGRAM',
|
|
126
|
-
gram: 'GRAM',
|
|
127
|
-
};
|
|
128
|
-
Merchant.IMPERIAL_WEIGHT_TYPES = {
|
|
129
|
-
pound: 'POUND',
|
|
130
|
-
once: 'ONCE',
|
|
131
|
-
};
|
|
132
|
-
Merchant.RIBBN_WEBHOOK_EVENT_DICT = {
|
|
133
|
-
productCreate: 'PRODUCT_CREATE',
|
|
134
|
-
productUpdate: 'PRODUCT_UPDATE',
|
|
135
|
-
productDelete: 'PRODUCT_DELETE',
|
|
136
|
-
// TODO: Add webhook events for other models (Orders, User, etc)
|
|
137
|
-
};
|
|
102
|
+
Merchant.MERCHANT_TYPES = merchant_constants_1.MERCHANT_TYPES;
|
|
103
|
+
Merchant.PAYMENT_TIERS = merchant_constants_1.PAYMENT_TIERS;
|
|
104
|
+
Merchant.INDUSTRY_TYPES = merchant_constants_1.INDUSTRY_TYPES;
|
|
105
|
+
Merchant.UNIT_SYSTEM_TYPES = merchant_constants_1.UNIT_SYSTEM_TYPES;
|
|
106
|
+
Merchant.METRIC_WEIGHT_TYPES = merchant_constants_1.METRIC_WEIGHT_TYPES;
|
|
107
|
+
Merchant.IMPERIAL_WEIGHT_TYPES = merchant_constants_1.IMPERIAL_WEIGHT_TYPES;
|
|
108
|
+
Merchant.RIBBN_WEBHOOK_EVENT_DICT = merchant_constants_1.RIBBN_WEBHOOK_EVENT_DICT;
|