rerobe-js-orm 2.7.13 → 2.7.14
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;
|
|
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,12 @@ 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,
|
|
67
73
|
};
|
|
68
74
|
return new User_1.default(Object.assign({}, userAttributes));
|
|
69
75
|
}
|
|
@@ -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,
|
|
@@ -22,6 +22,12 @@ class AnalyticsHelpers {
|
|
|
22
22
|
ordersCount,
|
|
23
23
|
amountSpent,
|
|
24
24
|
lastOrderDate,
|
|
25
|
+
itemsUploadedCount,
|
|
26
|
+
inventoryValue,
|
|
27
|
+
inventoryCount,
|
|
28
|
+
itemsSoldCount,
|
|
29
|
+
itemsSoldValue,
|
|
30
|
+
itemRejectionPct,
|
|
25
31
|
};
|
|
26
32
|
return {
|
|
27
33
|
userId: documentId || '',
|
package/lib/models/User.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ 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;
|
|
39
45
|
constructor(props?: any);
|
|
40
46
|
toObj(): UserAttributes;
|
|
41
47
|
toCustomerUpdateInputObjForShopify(): any;
|
package/lib/models/User.js
CHANGED
|
@@ -56,6 +56,12 @@ 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;
|
|
59
65
|
}
|
|
60
66
|
toObj() {
|
|
61
67
|
return {
|
|
@@ -92,6 +98,12 @@ class User extends Base_1.default {
|
|
|
92
98
|
emailVerified: this.emailVerified,
|
|
93
99
|
ordersCount: this.ordersCount,
|
|
94
100
|
amountSpent: this.amountSpent,
|
|
101
|
+
itemsUploadedCount: this.itemsUploadedCount,
|
|
102
|
+
inventoryValue: this.inventoryValue,
|
|
103
|
+
inventoryCount: this.inventoryCount,
|
|
104
|
+
itemsSoldCount: this.itemsSoldCount,
|
|
105
|
+
itemsSoldValue: this.itemsSoldValue,
|
|
106
|
+
itemRejectionPct: this.itemRejectionPct,
|
|
95
107
|
};
|
|
96
108
|
}
|
|
97
109
|
toCustomerUpdateInputObjForShopify() {
|
|
@@ -161,6 +173,12 @@ class User extends Base_1.default {
|
|
|
161
173
|
devicePlatform: this.devicePlatform,
|
|
162
174
|
lastLogin: this.lastLogin,
|
|
163
175
|
referralCode: this.referralCode,
|
|
176
|
+
itemsUploadedCount: this.itemsUploadedCount,
|
|
177
|
+
inventoryValue: this.inventoryValue,
|
|
178
|
+
inventoryCount: this.inventoryCount,
|
|
179
|
+
itemsSoldCount: this.itemsSoldCount,
|
|
180
|
+
itemsSoldValue: this.itemsSoldValue,
|
|
181
|
+
itemRejectionPct: this.itemRejectionPct,
|
|
164
182
|
};
|
|
165
183
|
return customerInput;
|
|
166
184
|
}
|
|
@@ -228,8 +246,38 @@ class User extends Base_1.default {
|
|
|
228
246
|
name: 'merchantId',
|
|
229
247
|
type: 'string',
|
|
230
248
|
},
|
|
249
|
+
{
|
|
250
|
+
facet: true,
|
|
251
|
+
name: 'itemsUploadedCount',
|
|
252
|
+
type: 'int32',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
facet: true,
|
|
256
|
+
name: 'inventoryValue',
|
|
257
|
+
type: 'float',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
facet: true,
|
|
261
|
+
name: 'inventoryCount',
|
|
262
|
+
type: 'int32',
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
facet: true,
|
|
266
|
+
name: 'itemsSoldCount',
|
|
267
|
+
type: 'int32',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
facet: true,
|
|
271
|
+
name: 'itemsSoldValue',
|
|
272
|
+
type: 'float',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
facet: true,
|
|
276
|
+
name: 'itemRejectionPct',
|
|
277
|
+
type: 'float',
|
|
278
|
+
},
|
|
231
279
|
],
|
|
232
|
-
name: '
|
|
280
|
+
name: 'prod_customers_20220907',
|
|
233
281
|
};
|
|
234
282
|
}
|
|
235
283
|
toObjForTypesense(merchantId) {
|
|
@@ -246,6 +294,12 @@ class User extends Base_1.default {
|
|
|
246
294
|
isSeller: this.isSeller,
|
|
247
295
|
amountSpent: this.utilities.sanitizeNumber(this.amountSpent),
|
|
248
296
|
ordersCount: this.utilities.sanitizeNumber(this.ordersCount),
|
|
297
|
+
itemsUploadedCount: this.utilities.sanitizeNumber(this.itemsUploadedCount),
|
|
298
|
+
inventoryValue: this.utilities.sanitizeNumber(this.inventoryValue),
|
|
299
|
+
inventoryCount: this.utilities.sanitizeNumber(this.inventoryCount),
|
|
300
|
+
itemsSoldCount: this.utilities.sanitizeNumber(this.itemsSoldCount),
|
|
301
|
+
itemsSoldValue: this.utilities.sanitizeNumber(this.itemsSoldValue),
|
|
302
|
+
itemRejectionPct: this.utilities.sanitizeNumber(this.itemRejectionPct),
|
|
249
303
|
};
|
|
250
304
|
return stagedObj;
|
|
251
305
|
}
|
|
@@ -32,6 +32,12 @@ 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;
|
|
35
41
|
}
|
|
36
42
|
declare type RibbnCustomerObj = {
|
|
37
43
|
uid?: string;
|
|
@@ -58,6 +64,12 @@ declare type RibbnCustomerObj = {
|
|
|
58
64
|
devicePlatform?: string;
|
|
59
65
|
lastLogin?: string;
|
|
60
66
|
referralCode?: string;
|
|
67
|
+
itemsUploadedCount?: number;
|
|
68
|
+
inventoryValue?: number;
|
|
69
|
+
inventoryCount?: number;
|
|
70
|
+
itemsSoldCount?: number;
|
|
71
|
+
itemsSoldValue?: number;
|
|
72
|
+
itemRejectionPct?: number;
|
|
61
73
|
};
|
|
62
74
|
declare type UserObjForAuthTemplateMethod = {
|
|
63
75
|
authUserProfile: UserFromShopifyGraphQLResp;
|
|
@@ -142,4 +154,10 @@ declare type TypesenseUserObj = {
|
|
|
142
154
|
amountSpent: number;
|
|
143
155
|
ordersCount: number;
|
|
144
156
|
merchantId: string;
|
|
157
|
+
itemsUploadedCount: number;
|
|
158
|
+
inventoryValue: number;
|
|
159
|
+
inventoryCount: number;
|
|
160
|
+
itemsSoldCount: number;
|
|
161
|
+
itemsSoldValue: number;
|
|
162
|
+
itemRejectionPct: number;
|
|
145
163
|
};
|