rerobe-js-orm 2.7.12 → 2.7.15
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.
|
@@ -4,7 +4,7 @@ const UserFactory_1 = require("./UserFactory");
|
|
|
4
4
|
const User_1 = require("../../models/User");
|
|
5
5
|
class UserFromFormState extends UserFactory_1.default {
|
|
6
6
|
createUser(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;
|
|
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;
|
|
8
8
|
const userAttributes = {
|
|
9
9
|
documentId: ((_a = props.props) === null || _a === void 0 ? void 0 : _a.documentId) || '',
|
|
10
10
|
uid: ((_b = props.props) === null || _b === void 0 ? void 0 : _b.uid) || '',
|
|
@@ -64,6 +64,13 @@ class UserFromFormState extends UserFactory_1.default {
|
|
|
64
64
|
emailVerified: ((_v = props.props) === null || _v === void 0 ? void 0 : _v.emailVerified) || false,
|
|
65
65
|
createdAtTimestamp: ((_w = props.props) === null || _w === void 0 ? void 0 : _w.createdAtTimestamp) || 0,
|
|
66
66
|
updatedAtTimestamp: ((_x = props.props) === null || _x === void 0 ? void 0 : _x.updatedAtTimestamp) || 0,
|
|
67
|
+
itemsUploadedCount: ((_y = props.props) === null || _y === void 0 ? void 0 : _y.itemsUploadedCount) || 0,
|
|
68
|
+
inventoryValue: ((_z = props.props) === null || _z === void 0 ? void 0 : _z.inventoryValue) || 0,
|
|
69
|
+
inventoryCount: ((_0 = props.props) === null || _0 === void 0 ? void 0 : _0.inventoryCount) || 0,
|
|
70
|
+
itemsSoldCount: ((_1 = props.props) === null || _1 === void 0 ? void 0 : _1.itemsSoldCount) || 0,
|
|
71
|
+
itemsSoldValue: ((_2 = props.props) === null || _2 === void 0 ? void 0 : _2.itemsSoldValue) || 0,
|
|
72
|
+
itemRejectionPct: ((_3 = props.props) === null || _3 === void 0 ? void 0 : _3.itemRejectionPct) || 0,
|
|
73
|
+
lastOrderDate: ((_4 = props.props) === null || _4 === void 0 ? void 0 : _4.lastOrderDate) || '',
|
|
67
74
|
};
|
|
68
75
|
return new User_1.default(Object.assign({}, userAttributes));
|
|
69
76
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
class AnalyticsHelpers {
|
|
4
4
|
// Trait object for analytics.identify (https://segment.com/docs/connections/spec/identify/)
|
|
5
5
|
static createIdentifyPayloadForSegment(userProps) {
|
|
6
|
-
const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount, amountSpent, lastOrderDate, } = userProps;
|
|
6
|
+
const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount, amountSpent, itemsUploadedCount, lastOrderDate, inventoryValue, inventoryCount, itemsSoldCount, itemsSoldValue, itemRejectionPct, } = userProps;
|
|
7
7
|
// Step 1. Get all reserved traits (https://segment.com/docs/connections/spec/identify/#traits)
|
|
8
8
|
const reservedTraitsObj = {
|
|
9
9
|
firstName,
|
|
@@ -21,6 +21,12 @@ class AnalyticsHelpers {
|
|
|
21
21
|
isSeller,
|
|
22
22
|
ordersCount,
|
|
23
23
|
amountSpent,
|
|
24
|
+
itemsUploadedCount,
|
|
25
|
+
inventoryValue,
|
|
26
|
+
inventoryCount,
|
|
27
|
+
itemsSoldCount,
|
|
28
|
+
itemsSoldValue,
|
|
29
|
+
itemRejectionPct,
|
|
24
30
|
lastOrderDate,
|
|
25
31
|
};
|
|
26
32
|
return {
|
package/lib/models/User.d.ts
CHANGED
|
@@ -36,6 +36,13 @@ export default class User extends Base {
|
|
|
36
36
|
ordersCount: number;
|
|
37
37
|
amountSpent: number;
|
|
38
38
|
emailVerified: boolean;
|
|
39
|
+
itemsUploadedCount: number;
|
|
40
|
+
inventoryValue: number;
|
|
41
|
+
inventoryCount: number;
|
|
42
|
+
itemsSoldCount: number;
|
|
43
|
+
itemsSoldValue: number;
|
|
44
|
+
itemRejectionPct: number;
|
|
45
|
+
lastOrderDate: string;
|
|
39
46
|
constructor(props?: any);
|
|
40
47
|
toObj(): UserAttributes;
|
|
41
48
|
toCustomerUpdateInputObjForShopify(): any;
|
package/lib/models/User.js
CHANGED
|
@@ -56,6 +56,13 @@ class User extends Base_1.default {
|
|
|
56
56
|
this.amountSpent = (props === null || props === void 0 ? void 0 : props.amountSpent) || 0;
|
|
57
57
|
this.lastLogin = (props === null || props === void 0 ? void 0 : props.lastLogin) || '';
|
|
58
58
|
this.emailVerified = (props === null || props === void 0 ? void 0 : props.emailVerified) || false;
|
|
59
|
+
this.itemsUploadedCount = (props === null || props === void 0 ? void 0 : props.itemsUploadedCount) || 0;
|
|
60
|
+
this.inventoryValue = (props === null || props === void 0 ? void 0 : props.inventoryValue) || 0;
|
|
61
|
+
this.inventoryCount = (props === null || props === void 0 ? void 0 : props.inventoryCount) || 0;
|
|
62
|
+
this.itemsSoldCount = (props === null || props === void 0 ? void 0 : props.itemsSoldCount) || 0;
|
|
63
|
+
this.itemsSoldValue = (props === null || props === void 0 ? void 0 : props.itemsSoldValue) || 0;
|
|
64
|
+
this.itemRejectionPct = (props === null || props === void 0 ? void 0 : props.itemRejectionPct) || 0;
|
|
65
|
+
this.lastOrderDate = (props === null || props === void 0 ? void 0 : props.lastOrderDate) || '';
|
|
59
66
|
}
|
|
60
67
|
toObj() {
|
|
61
68
|
return {
|
|
@@ -92,6 +99,13 @@ class User extends Base_1.default {
|
|
|
92
99
|
emailVerified: this.emailVerified,
|
|
93
100
|
ordersCount: this.ordersCount,
|
|
94
101
|
amountSpent: this.amountSpent,
|
|
102
|
+
itemsUploadedCount: this.itemsUploadedCount,
|
|
103
|
+
inventoryValue: this.inventoryValue,
|
|
104
|
+
inventoryCount: this.inventoryCount,
|
|
105
|
+
itemsSoldCount: this.itemsSoldCount,
|
|
106
|
+
itemsSoldValue: this.itemsSoldValue,
|
|
107
|
+
itemRejectionPct: this.itemRejectionPct,
|
|
108
|
+
lastOrderDate: this.lastOrderDate,
|
|
95
109
|
};
|
|
96
110
|
}
|
|
97
111
|
toCustomerUpdateInputObjForShopify() {
|
|
@@ -161,6 +175,13 @@ class User extends Base_1.default {
|
|
|
161
175
|
devicePlatform: this.devicePlatform,
|
|
162
176
|
lastLogin: this.lastLogin,
|
|
163
177
|
referralCode: this.referralCode,
|
|
178
|
+
itemsUploadedCount: this.itemsUploadedCount,
|
|
179
|
+
inventoryValue: this.inventoryValue,
|
|
180
|
+
inventoryCount: this.inventoryCount,
|
|
181
|
+
itemsSoldCount: this.itemsSoldCount,
|
|
182
|
+
itemsSoldValue: this.itemsSoldValue,
|
|
183
|
+
itemRejectionPct: this.itemRejectionPct,
|
|
184
|
+
lastOrderDate: this.lastOrderDate,
|
|
164
185
|
};
|
|
165
186
|
return customerInput;
|
|
166
187
|
}
|
|
@@ -228,8 +249,43 @@ class User extends Base_1.default {
|
|
|
228
249
|
name: 'merchantId',
|
|
229
250
|
type: 'string',
|
|
230
251
|
},
|
|
252
|
+
{
|
|
253
|
+
facet: true,
|
|
254
|
+
name: 'itemsUploadedCount',
|
|
255
|
+
type: 'int32',
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
facet: true,
|
|
259
|
+
name: 'inventoryValue',
|
|
260
|
+
type: 'float',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
facet: true,
|
|
264
|
+
name: 'inventoryCount',
|
|
265
|
+
type: 'int32',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
facet: true,
|
|
269
|
+
name: 'itemsSoldCount',
|
|
270
|
+
type: 'int32',
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
facet: true,
|
|
274
|
+
name: 'itemsSoldValue',
|
|
275
|
+
type: 'float',
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
facet: true,
|
|
279
|
+
name: 'itemRejectionPct',
|
|
280
|
+
type: 'float',
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
facet: true,
|
|
284
|
+
name: 'lastOrderDate',
|
|
285
|
+
type: 'string',
|
|
286
|
+
},
|
|
231
287
|
],
|
|
232
|
-
name: '
|
|
288
|
+
name: 'prod_customers_20220907',
|
|
233
289
|
};
|
|
234
290
|
}
|
|
235
291
|
toObjForTypesense(merchantId) {
|
|
@@ -246,6 +302,13 @@ class User extends Base_1.default {
|
|
|
246
302
|
isSeller: this.isSeller,
|
|
247
303
|
amountSpent: this.utilities.sanitizeNumber(this.amountSpent),
|
|
248
304
|
ordersCount: this.utilities.sanitizeNumber(this.ordersCount),
|
|
305
|
+
itemsUploadedCount: this.utilities.sanitizeNumber(this.itemsUploadedCount),
|
|
306
|
+
inventoryValue: this.utilities.sanitizeNumber(this.inventoryValue),
|
|
307
|
+
inventoryCount: this.utilities.sanitizeNumber(this.inventoryCount),
|
|
308
|
+
itemsSoldCount: this.utilities.sanitizeNumber(this.itemsSoldCount),
|
|
309
|
+
itemsSoldValue: this.utilities.sanitizeNumber(this.itemsSoldValue),
|
|
310
|
+
itemRejectionPct: this.utilities.sanitizeNumber(this.itemRejectionPct),
|
|
311
|
+
lastOrderDate: this.utilities.sanitizeString(this.lastOrderDate),
|
|
249
312
|
};
|
|
250
313
|
return stagedObj;
|
|
251
314
|
}
|
|
@@ -32,6 +32,13 @@ interface UserAttributes extends ReRobeDocument {
|
|
|
32
32
|
emailVerified: boolean;
|
|
33
33
|
createdAtTimestamp: number;
|
|
34
34
|
updatedAtTimestamp: number;
|
|
35
|
+
itemsUploadedCount?: number;
|
|
36
|
+
inventoryValue?: number;
|
|
37
|
+
inventoryCount?: number;
|
|
38
|
+
itemsSoldCount?: number;
|
|
39
|
+
itemsSoldValue?: number;
|
|
40
|
+
itemRejectionPct?: number;
|
|
41
|
+
lastOrderDate?: string;
|
|
35
42
|
}
|
|
36
43
|
declare type RibbnCustomerObj = {
|
|
37
44
|
uid?: string;
|
|
@@ -58,6 +65,13 @@ declare type RibbnCustomerObj = {
|
|
|
58
65
|
devicePlatform?: string;
|
|
59
66
|
lastLogin?: string;
|
|
60
67
|
referralCode?: string;
|
|
68
|
+
itemsUploadedCount?: number;
|
|
69
|
+
inventoryValue?: number;
|
|
70
|
+
inventoryCount?: number;
|
|
71
|
+
itemsSoldCount?: number;
|
|
72
|
+
itemsSoldValue?: number;
|
|
73
|
+
itemRejectionPct?: number;
|
|
74
|
+
lastOrderDate?: string;
|
|
61
75
|
};
|
|
62
76
|
declare type UserObjForAuthTemplateMethod = {
|
|
63
77
|
authUserProfile: UserFromShopifyGraphQLResp;
|
|
@@ -142,4 +156,11 @@ declare type TypesenseUserObj = {
|
|
|
142
156
|
amountSpent: number;
|
|
143
157
|
ordersCount: number;
|
|
144
158
|
merchantId: string;
|
|
159
|
+
itemsUploadedCount: number;
|
|
160
|
+
inventoryValue: number;
|
|
161
|
+
inventoryCount: number;
|
|
162
|
+
itemsSoldCount: number;
|
|
163
|
+
itemsSoldValue: number;
|
|
164
|
+
itemRejectionPct: number;
|
|
165
|
+
lastOrderDate: string;
|
|
145
166
|
};
|