rerobe-js-orm 2.7.0 → 2.7.12

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.
@@ -1,3 +1,5 @@
1
1
  export default class AnalyticsHelpers {
2
- static createIdentifyPayloadForSegment(userProps: UserAttributes): IdentifyPayload;
2
+ static createIdentifyPayloadForSegment(userProps: UserAttributes & {
3
+ lastOrderDate?: string;
4
+ }): IdentifyPayload;
3
5
  }
@@ -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 } = userProps;
6
+ const { firstName, lastName, email, phone, documentId, createdAt, updatedAt, addresses, title, isSeller, ordersCount, amountSpent, lastOrderDate, } = userProps;
7
7
  // Step 1. Get all reserved traits (https://segment.com/docs/connections/spec/identify/#traits)
8
8
  const reservedTraitsObj = {
9
9
  firstName,
@@ -19,6 +19,9 @@ class AnalyticsHelpers {
19
19
  const traitsObj = {
20
20
  updatedAt: prepareCreatedOrUpdatedAt(updatedAt),
21
21
  isSeller,
22
+ ordersCount,
23
+ amountSpent,
24
+ lastOrderDate,
22
25
  };
23
26
  return {
24
27
  userId: documentId || '',
@@ -319,7 +319,7 @@ class Order extends Base_1.default {
319
319
  orderNumber: this.utilities.sanitizeNumber(this.orderNumber),
320
320
  customerName: this.utilities.sanitizeString(this.customerName),
321
321
  customerEmail: this.utilities.sanitizeString(this.email),
322
- totalPrice: this.utilities.sanitizeNumber(this.totalPrice.amount),
322
+ totalPrice: this.utilities.sanitizeNumber(Number(this.totalPrice.amount) - Number(this.totalRefunded.amount)),
323
323
  state: this.utilities.sanitizeString(this.state),
324
324
  financialStatus: this.utilities.sanitizeString(this.financialStatus),
325
325
  fulfillmentStatus: this.utilities.sanitizeString(this.fulfillmentStatus),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.7.0",
3
+ "version": "2.7.12",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",