rerobe-js-orm 2.7.32 → 2.7.34

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.
@@ -3,4 +3,6 @@ export namespace TRANSACTION_TYPES {
3
3
  const merchantDebit: string;
4
4
  const sellerCredit: string;
5
5
  const sellerDebit: string;
6
+ const customerCredit: string;
7
+ const customerDebit: string;
6
8
  }
@@ -6,4 +6,6 @@ exports.TRANSACTION_TYPES = {
6
6
  merchantDebit: 'MERCHANT_DEBIT',
7
7
  sellerCredit: 'SELLER_CREDIT',
8
8
  sellerDebit: 'SELLER_DEBIT',
9
+ customerCredit: 'CUSTOMER_CREDIT',
10
+ customerDebit: 'CUSTOMER_DEBIT',
9
11
  };
@@ -91,7 +91,7 @@ class ReRobeProductHelpers {
91
91
  const products = Array.isArray(arrayLike) ? arrayLike : [arrayLike];
92
92
  return products.reduce((acc, cur) => {
93
93
  const commission = cur.reRobeCommission ? Number(this.commissionFixer(cur.reRobeCommission)) : 0.5;
94
- const priceToUse = cur.isOnSale === 'yes' && cur.salePrice ? cur.salePrice : cur.price;
94
+ const priceToUse = cur.isOnSale === 'yes' && Boolean(cur.clearanceTimestamp) && cur.salePrice ? cur.salePrice : cur.price;
95
95
  const listingPrice = Number.isNaN(priceToUse) ? 0 : Number(priceToUse);
96
96
  const priceSold = acc[0] + listingPrice;
97
97
  const commissionFee = acc[1] + priceSold * commission;
@@ -1,4 +1,4 @@
1
- declare type SellerLedgerTransactionTypeOptions = 'MERCHANT_CREDIT' | 'MERCHANT_DEBIT' | 'SELLER_CREDIT' | 'SELLER_DEBIT';
1
+ declare type SellerLedgerTransactionTypeOptions = 'MERCHANT_CREDIT' | 'MERCHANT_DEBIT' | 'SELLER_CREDIT' | 'SELLER_DEBIT' | 'CUSTOMER_CREDIT' | 'CUSTOMER_DEBIT';
2
2
  declare type SellerLedgerTransactionType = {
3
3
  documentId: string;
4
4
  createdAtTimestamp: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.7.32",
3
+ "version": "2.7.34",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",