rerobe-js-orm 2.7.14 → 2.7.17

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, _y, _z, _0, _1, _2, _3;
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;
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) || '',
@@ -70,6 +70,9 @@ class UserFromFormState extends UserFactory_1.default {
70
70
  itemsSoldCount: ((_1 = props.props) === null || _1 === void 0 ? void 0 : _1.itemsSoldCount) || 0,
71
71
  itemsSoldValue: ((_2 = props.props) === null || _2 === void 0 ? void 0 : _2.itemsSoldValue) || 0,
72
72
  itemRejectionPct: ((_3 = props.props) === null || _3 === void 0 ? void 0 : _3.itemRejectionPct) || 0,
73
+ itemSoldPct: ((_4 = props.props) === null || _4 === void 0 ? void 0 : _4.itemSoldPct) || 0,
74
+ lastOrderDate: ((_5 = props.props) === null || _5 === void 0 ? void 0 : _5.lastOrderDate) || '',
75
+ lastUploadDate: ((_6 = props.props) === null || _6 === void 0 ? void 0 : _6.lastUploadDate) || '',
73
76
  };
74
77
  return new User_1.default(Object.assign({}, userAttributes));
75
78
  }
@@ -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, itemsUploadedCount, lastOrderDate, inventoryValue, inventoryCount, itemsSoldCount, itemsSoldValue, itemRejectionPct, } = userProps;
6
+ const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount, amountSpent, itemsUploadedCount, lastOrderDate, inventoryValue, inventoryCount, itemsSoldCount, itemsSoldValue, itemRejectionPct, itemSoldPct, lastUploadDate, } = 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,13 +21,15 @@ class AnalyticsHelpers {
21
21
  isSeller,
22
22
  ordersCount,
23
23
  amountSpent,
24
- lastOrderDate,
25
24
  itemsUploadedCount,
26
25
  inventoryValue,
27
26
  inventoryCount,
28
27
  itemsSoldCount,
29
28
  itemsSoldValue,
30
29
  itemRejectionPct,
30
+ itemSoldPct,
31
+ lastOrderDate,
32
+ lastUploadDate,
31
33
  };
32
34
  return {
33
35
  userId: documentId || '',
@@ -42,6 +42,9 @@ export default class User extends Base {
42
42
  itemsSoldCount: number;
43
43
  itemsSoldValue: number;
44
44
  itemRejectionPct: number;
45
+ itemSoldPct: number;
46
+ lastOrderDate: string;
47
+ lastUploadDate: string;
45
48
  constructor(props?: any);
46
49
  toObj(): UserAttributes;
47
50
  toCustomerUpdateInputObjForShopify(): any;
@@ -62,6 +62,9 @@ class User extends Base_1.default {
62
62
  this.itemsSoldCount = (props === null || props === void 0 ? void 0 : props.itemsSoldCount) || 0;
63
63
  this.itemsSoldValue = (props === null || props === void 0 ? void 0 : props.itemsSoldValue) || 0;
64
64
  this.itemRejectionPct = (props === null || props === void 0 ? void 0 : props.itemRejectionPct) || 0;
65
+ this.itemSoldPct = (props === null || props === void 0 ? void 0 : props.itemSoldPct) || 0;
66
+ this.lastOrderDate = (props === null || props === void 0 ? void 0 : props.lastOrderDate) || '';
67
+ this.lastUploadDate = (props === null || props === void 0 ? void 0 : props.lastUploadDate) || '';
65
68
  }
66
69
  toObj() {
67
70
  return {
@@ -104,6 +107,9 @@ class User extends Base_1.default {
104
107
  itemsSoldCount: this.itemsSoldCount,
105
108
  itemsSoldValue: this.itemsSoldValue,
106
109
  itemRejectionPct: this.itemRejectionPct,
110
+ itemSoldPct: this.itemSoldPct,
111
+ lastOrderDate: this.lastOrderDate,
112
+ lastUploadDate: this.lastUploadDate,
107
113
  };
108
114
  }
109
115
  toCustomerUpdateInputObjForShopify() {
@@ -179,6 +185,9 @@ class User extends Base_1.default {
179
185
  itemsSoldCount: this.itemsSoldCount,
180
186
  itemsSoldValue: this.itemsSoldValue,
181
187
  itemRejectionPct: this.itemRejectionPct,
188
+ itemSoldPct: this.itemSoldPct,
189
+ lastOrderDate: this.lastOrderDate,
190
+ lastUploadDate: this.lastUploadDate,
182
191
  };
183
192
  return customerInput;
184
193
  }
@@ -276,6 +285,21 @@ class User extends Base_1.default {
276
285
  name: 'itemRejectionPct',
277
286
  type: 'float',
278
287
  },
288
+ {
289
+ facet: true,
290
+ name: 'itemSoldPct',
291
+ type: 'float',
292
+ },
293
+ {
294
+ facet: true,
295
+ name: 'lastOrderTimestamp',
296
+ type: 'int64',
297
+ },
298
+ {
299
+ facet: true,
300
+ name: 'lastUploadTimestamp',
301
+ type: 'int64',
302
+ },
279
303
  ],
280
304
  name: 'prod_customers_20220907',
281
305
  };
@@ -300,6 +324,9 @@ class User extends Base_1.default {
300
324
  itemsSoldCount: this.utilities.sanitizeNumber(this.itemsSoldCount),
301
325
  itemsSoldValue: this.utilities.sanitizeNumber(this.itemsSoldValue),
302
326
  itemRejectionPct: this.utilities.sanitizeNumber(this.itemRejectionPct),
327
+ itemSoldPct: this.utilities.sanitizeNumber(this.itemSoldPct),
328
+ lastOrderTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastOrderDate).getTime()),
329
+ lastUploadTimestamp: this.utilities.sanitizeMillisTimeStamp(new Date(this.lastUploadDate).getTime()),
303
330
  };
304
331
  return stagedObj;
305
332
  }
@@ -38,6 +38,9 @@ interface UserAttributes extends ReRobeDocument {
38
38
  itemsSoldCount?: number;
39
39
  itemsSoldValue?: number;
40
40
  itemRejectionPct?: number;
41
+ itemSoldPct?: number;
42
+ lastOrderDate?: string;
43
+ lastUploadDate?: string;
41
44
  }
42
45
  declare type RibbnCustomerObj = {
43
46
  uid?: string;
@@ -70,6 +73,9 @@ declare type RibbnCustomerObj = {
70
73
  itemsSoldCount?: number;
71
74
  itemsSoldValue?: number;
72
75
  itemRejectionPct?: number;
76
+ itemSoldPct?: number;
77
+ lastOrderDate?: string;
78
+ lastUploadDate?: string;
73
79
  };
74
80
  declare type UserObjForAuthTemplateMethod = {
75
81
  authUserProfile: UserFromShopifyGraphQLResp;
@@ -160,4 +166,7 @@ declare type TypesenseUserObj = {
160
166
  itemsSoldCount: number;
161
167
  itemsSoldValue: number;
162
168
  itemRejectionPct: number;
169
+ itemSoldPct: number;
170
+ lastOrderTimestamp: number;
171
+ lastUploadTimestamp: number;
163
172
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.7.14",
3
+ "version": "2.7.17",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",