rerobe-js-orm 3.4.7 → 3.4.8

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.
@@ -14,91 +14,143 @@ export namespace CUSTOMER_CREDIT_REASONS {
14
14
  const customerCompensation: string;
15
15
  const refund: string;
16
16
  }
17
- export const SellerProductLedgerStatusStatusDescriptionsActions: {
18
- Pending: {
19
- description: string;
20
- action: string;
21
- };
22
- "To Pay": {
23
- description: string;
24
- action: string;
25
- };
26
- Paid: {
27
- description: string;
28
- action: string;
29
- };
30
- Disputed: {
31
- description: string;
32
- action: string;
33
- };
34
- Resolved: {
35
- description: string;
36
- action: string;
37
- };
38
- Refunded: {
39
- description: string;
40
- action: string;
41
- };
42
- Cancelled: {
43
- description: string;
44
- action: string;
45
- };
46
- "In Progress": {
47
- description: string;
48
- action: string;
49
- };
50
- };
51
- export namespace SellerLedgerActivityLogActionsDescriptions {
52
- namespace ITEM_SOLD {
17
+ export namespace SellerProductLedgerStatusDescriptions {
18
+ namespace PENDING_RETURN_PERIOD_COMPLETION {
19
+ const label: string;
53
20
  const description: string;
54
- const action: string;
55
21
  }
56
- namespace ITEM_RETURNED {
22
+ namespace RETURNED_AND_RELISTED {
23
+ const label_1: string;
24
+ export { label_1 as label };
57
25
  const description_1: string;
58
26
  export { description_1 as description };
59
- const action_1: string;
60
- export { action_1 as action };
61
27
  }
62
- namespace PAYMENT_INITIATED {
28
+ namespace SELLER_LIQUIDATED {
29
+ const label_2: string;
30
+ export { label_2 as label };
63
31
  const description_2: string;
64
32
  export { description_2 as description };
65
- const action_2: string;
66
- export { action_2 as action };
67
33
  }
68
- namespace PAYMENT_COMPLETED {
34
+ namespace MERCHANT_DONATED {
35
+ const label_3: string;
36
+ export { label_3 as label };
69
37
  const description_3: string;
70
38
  export { description_3 as description };
71
- const action_3: string;
72
- export { action_3 as action };
73
39
  }
74
- namespace PAYMENT_FAILED {
40
+ namespace SELLER_TO_BE_PAID {
41
+ const label_4: string;
42
+ export { label_4 as label };
75
43
  const description_4: string;
76
44
  export { description_4 as description };
77
- const action_4: string;
78
- export { action_4 as action };
79
45
  }
80
- namespace DISPUTE_RAISED {
46
+ namespace PAYMENT_IN_PROGRESS {
47
+ const label_5: string;
48
+ export { label_5 as label };
81
49
  const description_5: string;
82
50
  export { description_5 as description };
83
- const action_5: string;
84
- export { action_5 as action };
85
51
  }
86
- namespace DISPUTE_RESOLVED {
52
+ namespace SELLER_PAID {
53
+ const label_6: string;
54
+ export { label_6 as label };
87
55
  const description_6: string;
88
56
  export { description_6 as description };
89
- const action_6: string;
90
- export { action_6 as action };
91
57
  }
92
- namespace REFUND_ISSUED {
58
+ namespace DISPUTED {
59
+ const label_7: string;
60
+ export { label_7 as label };
93
61
  const description_7: string;
94
62
  export { description_7 as description };
95
- const action_7: string;
96
- export { action_7 as action };
97
63
  }
98
- namespace TRANSACTION_CANCELLED {
64
+ namespace RESOLVED {
65
+ const label_8: string;
66
+ export { label_8 as label };
99
67
  const description_8: string;
100
68
  export { description_8 as description };
101
- const action_8: string;
102
- export { action_8 as action };
69
+ }
70
+ namespace DIRECT_SALE_PENDING {
71
+ const label_9: string;
72
+ export { label_9 as label };
73
+ const description_9: string;
74
+ export { description_9 as description };
75
+ }
76
+ namespace DIRECT_SALE_COMPLETED {
77
+ const label_10: string;
78
+ export { label_10 as label };
79
+ const description_10: string;
80
+ export { description_10 as description };
81
+ }
82
+ }
83
+ export namespace SellerProductLedgerActivityLogActionDescriptions {
84
+ namespace STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION {
85
+ const label_11: string;
86
+ export { label_11 as label };
87
+ const description_11: string;
88
+ export { description_11 as description };
89
+ }
90
+ namespace STATUS_CHANGED_TO_RETURNED_AND_RELISTED {
91
+ const label_12: string;
92
+ export { label_12 as label };
93
+ const description_12: string;
94
+ export { description_12 as description };
95
+ }
96
+ namespace STATUS_CHANGED_TO_SELLER_LIQUIDATED {
97
+ const label_13: string;
98
+ export { label_13 as label };
99
+ const description_13: string;
100
+ export { description_13 as description };
101
+ }
102
+ namespace STATUS_CHANGED_TO_MERCHANT_DONATED {
103
+ const label_14: string;
104
+ export { label_14 as label };
105
+ const description_14: string;
106
+ export { description_14 as description };
107
+ }
108
+ namespace STATUS_CHANGED_TO_SELLER_TO_BE_PAID {
109
+ const label_15: string;
110
+ export { label_15 as label };
111
+ const description_15: string;
112
+ export { description_15 as description };
113
+ }
114
+ namespace STATUS_CHANGED_TO_PAYMENT_IN_PROGRESS {
115
+ const label_16: string;
116
+ export { label_16 as label };
117
+ const description_16: string;
118
+ export { description_16 as description };
119
+ }
120
+ namespace STATUS_CHANGED_TO_SELLER_PAID {
121
+ const label_17: string;
122
+ export { label_17 as label };
123
+ const description_17: string;
124
+ export { description_17 as description };
125
+ }
126
+ namespace STATUS_CHANGED_TO_DISPUTED {
127
+ const label_18: string;
128
+ export { label_18 as label };
129
+ const description_18: string;
130
+ export { description_18 as description };
131
+ }
132
+ namespace STATUS_CHANGED_TO_RESOLVED {
133
+ const label_19: string;
134
+ export { label_19 as label };
135
+ const description_19: string;
136
+ export { description_19 as description };
137
+ }
138
+ namespace STATUS_CHANGED_TO_DIRECT_SALE_PENDING {
139
+ const label_20: string;
140
+ export { label_20 as label };
141
+ const description_20: string;
142
+ export { description_20 as description };
143
+ }
144
+ namespace STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED {
145
+ const label_21: string;
146
+ export { label_21 as label };
147
+ const description_21: string;
148
+ export { description_21 as description };
149
+ }
150
+ namespace MERCHANT_ADJUSTMENT_MADE {
151
+ const label_22: string;
152
+ export { label_22 as label };
153
+ const description_22: string;
154
+ export { description_22 as description };
103
155
  }
104
156
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SellerLedgerActivityLogActionsDescriptions = exports.SellerProductLedgerStatusStatusDescriptionsActions = exports.CUSTOMER_CREDIT_REASONS = exports.TRANSACTION_TYPES = void 0;
3
+ exports.SellerProductLedgerActivityLogActionDescriptions = exports.SellerProductLedgerStatusDescriptions = exports.CUSTOMER_CREDIT_REASONS = exports.TRANSACTION_TYPES = void 0;
4
4
  exports.TRANSACTION_TYPES = {
5
5
  merchantCredit: 'MERCHANT_CREDIT',
6
6
  merchantDebit: 'MERCHANT_DEBIT',
@@ -17,75 +17,99 @@ exports.CUSTOMER_CREDIT_REASONS = {
17
17
  customerCompensation: 'CUSTOMER_COMPENSATION',
18
18
  refund: 'REFUND',
19
19
  };
20
- exports.SellerProductLedgerStatusStatusDescriptionsActions = {
21
- [SellerProductLedgerStatus.PENDING]: {
22
- description: 'This status is assigned when an item is sold but is still within the return or refund period. The transaction is recorded but not finalized.',
23
- action: 'Monitor for returns or disputes.',
20
+ exports.SellerProductLedgerStatusDescriptions = {
21
+ [SellerProductLedgerStatus.PENDING_RETURN_PERIOD_COMPLETION]: {
22
+ label: 'The sold product is in a return period; payment to the seller is pending its completion',
23
+ description: 'This status is assigned when an item is sold but is still within the return or refund period. Payment to the seller is pending its completion.',
24
24
  },
25
- [SellerProductLedgerStatus.TO_PAY]: {
26
- description: 'Once the return period has expired without a return or dispute, the transaction status updates to indicate the merchant owes payment to the seller.',
27
- action: 'Prepare to disburse payment to the seller.',
25
+ [SellerProductLedgerStatus.RETURNED_AND_RELISTED]: {
26
+ label: 'Item has been returned and is now listed again for sale.',
27
+ description: 'Indicates the item was returned and has been relisted for sale. Customer was refunded and no payment will occur for seller.',
28
28
  },
29
- [SellerProductLedgerStatus.PAID]: {
29
+ [SellerProductLedgerStatus.SELLER_LIQUIDATED]: {
30
+ label: 'Item was returned and relisted but then seller decides to take item back.',
31
+ description: 'Indicates the item was returned and has been relisted for sale, but seller takes it back, meaning inventory is no longer held by merchant and seller is not owed any money.',
32
+ },
33
+ [SellerProductLedgerStatus.MERCHANT_DONATED]: {
34
+ label: 'Item was returned and relisted but merchant decides to donate item and seller does not want it back.',
35
+ description: 'Indicates the item was returned and has been relisted for sale, but merchant no longer wants to sell it and seller does not want it back, meaning inventory is no longer held by merchant and seller is not owed any money.',
36
+ },
37
+ [SellerProductLedgerStatus.SELLER_TO_BE_PAID]: {
38
+ label: 'Item has cleared the returned period and the seller is now ready to be paid their share of the sale.',
39
+ description: 'Once the return period has expired without a return or dispute, the merchant owes payment to the seller.',
40
+ },
41
+ [SellerProductLedgerStatus.PAYMENT_IN_PROGRESS]: {
42
+ label: 'Payment to the seller has been initiated and is currently being processed.',
43
+ description: 'The merchant has initiated the payment and it is now on its way to the seller.',
44
+ },
45
+ [SellerProductLedgerStatus.SELLER_PAID]: {
46
+ label: 'Payment to the seller is complete.',
30
47
  description: 'This status indicates that payment has been disbursed to the seller.',
31
- action: 'Archive the transaction for record-keeping and financial reconciliation.',
32
48
  },
33
49
  [SellerProductLedgerStatus.DISPUTED]: {
34
- description: 'If the buyer raises a dispute within the return period (or possibly slightly beyond, depending on policy), this status is used.',
35
- action: "Hold the transaction from proceeding to 'To Pay' until the dispute is resolved.",
50
+ label: 'Transaction is under dispute.',
51
+ description: 'A dispute has been raised concerning this transaction, possibly due to issues with the item, payment, or fulfillment. The dispute resolution process is in progress.',
36
52
  },
37
53
  [SellerProductLedgerStatus.RESOLVED]: {
38
- description: 'Post-dispute, whether the dispute is resolved in favor of the seller or the buyer, this status indicates a conclusion has been reached.',
39
- action: "If resolved in favor of the seller, move to 'To Pay' or 'Paid' as appropriate. If in favor of the buyer, adjust the ledger to reflect the return/refund.",
40
- },
41
- [SellerProductLedgerStatus.REFUNDED]: {
42
- description: 'Indicates that a return was processed, and the buyer was refunded, canceling the obligation to pay the seller.',
43
- action: 'Adjust the ledger to remove the obligation for payment to the seller.',
54
+ label: 'Dispute has been resolved.',
55
+ description: 'The dispute related to this transaction has been resolved. The outcome could result in a payment to the seller, a refund to the buyer, or another resolution.',
44
56
  },
45
- [SellerProductLedgerStatus.CANCELLED]: {
46
- description: 'The transaction was cancelled before completion due to various reasons (e.g., item out of stock, order error).',
47
- action: 'No payment obligation; adjust ledger to reflect cancellation.',
57
+ [SellerProductLedgerStatus.DIRECT_SALE_PENDING]: {
58
+ label: 'Direct sale transaction is pending.',
59
+ description: 'This status is used for items sold directly by the platform, pending completion of the sale process. Payment processing or shipment may still be in progress.',
48
60
  },
49
- [SellerProductLedgerStatus.IN_PROGRESS]: {
50
- description: "For use in cases where payment is being processed but hasn't been finalized yet (e.g., bank transfers).",
51
- action: "Monitor until payment is completed, then change to 'Paid'.",
61
+ [SellerProductLedgerStatus.DIRECT_SALE_COMPLETED]: {
62
+ label: 'Direct sale transaction is completed.',
63
+ description: 'Indicates that a direct sale transaction has been completed successfully. The item has been sold, shipped, and no return is expected. Payment has been processed accordingly.',
52
64
  },
53
65
  };
54
- exports.SellerLedgerActivityLogActionsDescriptions = {
55
- [SellerLedgerActivityLogAction.ITEM_SOLD]: {
56
- description: 'A product has been sold.',
57
- action: 'Record the sale and monitor the return period.',
58
- },
59
- [SellerLedgerActivityLogAction.ITEM_RETURNED]: {
60
- description: 'A sold product has been returned.',
61
- action: 'Process the return and update the ledger accordingly.',
62
- },
63
- [SellerLedgerActivityLogAction.PAYMENT_INITIATED]: {
64
- description: 'Payment to the seller has been initiated.',
65
- action: 'Monitor the payment process until completion.',
66
- },
67
- [SellerLedgerActivityLogAction.PAYMENT_COMPLETED]: {
68
- description: 'Payment to the seller has been successfully completed.',
69
- action: "Update the ledger to reflect the payment status as 'Paid'.",
70
- },
71
- [SellerLedgerActivityLogAction.PAYMENT_FAILED]: {
72
- description: 'Payment to the seller has failed.',
73
- action: 'Investigate the failure reason and attempt to reprocess the payment.',
74
- },
75
- [SellerLedgerActivityLogAction.DISPUTE_RAISED]: {
76
- description: 'A dispute has been raised regarding a transaction.',
77
- action: 'Hold the transaction and engage in dispute resolution processes.',
78
- },
79
- [SellerLedgerActivityLogAction.DISPUTE_RESOLVED]: {
80
- description: 'The dispute has been resolved.',
81
- action: 'Update the transaction status based on the resolution outcome.',
82
- },
83
- [SellerLedgerActivityLogAction.REFUND_ISSUED]: {
84
- description: 'A refund has been issued for a transaction.',
85
- action: 'Adjust the ledger to reflect the refunded transaction.',
86
- },
87
- [SellerLedgerActivityLogAction.TRANSACTION_CANCELLED]: {
88
- description: 'The transaction has been cancelled.',
89
- action: 'Update the ledger to cancel the transaction and adjust any related financial records.',
66
+ exports.SellerProductLedgerActivityLogActionDescriptions = {
67
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION]: {
68
+ label: 'Pending Return Period Completion',
69
+ description: 'The item has been sold, and the transaction is now in the return period. Payment to the seller is pending the completion of this period.',
70
+ },
71
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_RETURNED_AND_RELISTED]: {
72
+ label: 'Returned and Relisted',
73
+ description: 'The sold item has been returned and is now relisted for sale. The transaction has been reverted, and no payment is processed to the seller.',
74
+ },
75
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_SELLER_LIQUIDATED]: {
76
+ label: 'Seller liquidated',
77
+ description: 'The sold item was returned and relisted for sale, but seller decided to take it back',
78
+ },
79
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_MERCHANT_DONATED]: {
80
+ label: 'Merchant Donated',
81
+ description: "The sold item was returned and relisted for sale, but merchant decided to donate it and seller didn't want to take it back",
82
+ },
83
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_SELLER_TO_BE_PAID]: {
84
+ label: 'Seller to be Paid',
85
+ description: 'The return period has completed without a return, and the seller is now due to be paid for the sale.',
86
+ },
87
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_PAYMENT_IN_PROGRESS]: {
88
+ label: 'Payment in Progress',
89
+ description: 'Payment to the seller has been initiated and is currently being processed.',
90
+ },
91
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_SELLER_PAID]: {
92
+ label: 'Seller Paid',
93
+ description: 'The seller has been paid, completing the transaction for the sold item.',
94
+ },
95
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_DISPUTED]: {
96
+ label: 'Disputed',
97
+ description: 'A dispute has been raised concerning the transaction. The dispute process is underway to resolve the issue.',
98
+ },
99
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_RESOLVED]: {
100
+ label: 'Resolved',
101
+ description: 'The dispute or issue affecting the transaction has been resolved.',
102
+ },
103
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_DIRECT_SALE_PENDING]: {
104
+ label: 'Direct Sale Pending',
105
+ description: 'A direct sale transaction is pending completion. This status is used for items sold directly by the platform.',
106
+ },
107
+ [SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED]: {
108
+ label: 'Direct Sale Completed',
109
+ description: 'A direct sale transaction has been completed successfully.',
110
+ },
111
+ [SellerProductLedgerActivityLogAction.MERCHANT_ADJUSTMENT_MADE]: {
112
+ label: 'Merchant Adjustment Made',
113
+ description: 'An adjustment (e.g., payment adjustment) has been made by the merchant.',
90
114
  },
91
115
  };
@@ -0,0 +1,3 @@
1
+ export default class SellerProductLedgerHelpers {
2
+ static buildActivityLog(payload: any): ActivityLog;
3
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // @ts-ignore
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const Utilities_1 = require("./Utilities");
5
+ const utilities = new Utilities_1.default();
6
+ class SellerProductLedgerHelpers {
7
+ static buildActivityLog(payload) {
8
+ return {
9
+ documentId: utilities.makeRandId(28),
10
+ timestamp: Date.now(),
11
+ sellerProductLedgerId: payload.sellerProductLedgerId || '',
12
+ action: (payload === null || payload === void 0 ? void 0 : payload.action) || SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION,
13
+ details: (payload === null || payload === void 0 ? void 0 : payload.details) || '',
14
+ actorId: (payload === null || payload === void 0 ? void 0 : payload.actorId) || 'system',
15
+ actorType: (payload === null || payload === void 0 ? void 0 : payload.actorType) || AcivityLogActorTypes.SYSTEM,
16
+ data: (payload === null || payload === void 0 ? void 0 : payload.data) || {},
17
+ };
18
+ }
19
+ }
20
+ exports.default = SellerProductLedgerHelpers;
@@ -3,12 +3,14 @@ export default class SellerProductLedger extends Base {
3
3
  documentId: string;
4
4
  createdAtTimestamp: number;
5
5
  updatedAtTimestamp: number;
6
+ pendingReturnPeriodStartTimestamp: number;
6
7
  merchantId: string;
7
8
  merchantCurrency: string;
8
9
  sellerId: string;
9
10
  sellerFirstName: string;
10
11
  sellerLastName: string;
11
12
  sellerEmail: string;
13
+ saleType: SaleType;
12
14
  productId: string;
13
15
  orderId: string;
14
16
  productTitle: string;
@@ -18,7 +20,7 @@ export default class SellerProductLedger extends Base {
18
20
  amountOwedToSeller: string | number;
19
21
  status: SellerProductLedgerStatus;
20
22
  feesForSeller: Fee[];
21
- activityLog: ActivityLog[];
23
+ tags: string[];
22
24
  constructor(props?: any);
23
25
  toObj(): SellerProductLedgerType;
24
26
  generateSchemaForTypesense(name?: string): {
@@ -31,6 +33,5 @@ export default class SellerProductLedger extends Base {
31
33
  name: string;
32
34
  };
33
35
  toObjForTypesense(): TypesenseSellerProductLedgerObj;
34
- addActivityLogEntry(logEntry: ActivityLog): void;
35
36
  addFeeEntry(feeEntry: Fee): void;
36
37
  }
@@ -7,6 +7,7 @@ class SellerProductLedger extends Base_1.default {
7
7
  this.documentId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
8
8
  this.createdAtTimestamp = this.utilities.sanitizeMillisTimeStamp(props === null || props === void 0 ? void 0 : props.createdAtTimestamp);
9
9
  this.updatedAtTimestamp = this.utilities.sanitizeMillisTimeStamp(props === null || props === void 0 ? void 0 : props.createdAtTimestamp);
10
+ this.pendingReturnPeriodStartTimestamp = this.utilities.sanitizeMillisTimeStamp(props === null || props === void 0 ? void 0 : props.pendingReturnPeriodStartTimestamp);
10
11
  this.merchantId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.merchantId);
11
12
  this.merchantCurrency = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.merchantCurrency);
12
13
  this.sellerId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerId);
@@ -14,21 +15,23 @@ class SellerProductLedger extends Base_1.default {
14
15
  this.sellerFirstName = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerFirstName);
15
16
  this.sellerLastName = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerLastName);
16
17
  this.sellerEmail = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerEmail);
18
+ this.saleType = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.saleType) || SaleType.CONSIGNMENT);
17
19
  this.productId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.productId);
18
20
  this.productTitle = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.productTitle);
19
21
  this.productImgUrl = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.productImgUrl);
20
22
  this.merchantCommission = this.utilities.sanitizeNumber(props === null || props === void 0 ? void 0 : props.merchantCommission);
21
23
  this.priceSold = this.utilities.sanitizeNumber(props === null || props === void 0 ? void 0 : props.priceSold);
22
24
  this.amountOwedToSeller = this.utilities.sanitizeNumber(props === null || props === void 0 ? void 0 : props.amountOwedToSeller);
23
- this.status = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.status) || SellerProductLedgerStatus.PENDING);
25
+ this.status = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.status) || SellerProductLedgerStatus.PENDING_RETURN_PERIOD_COMPLETION);
24
26
  this.feesForSeller = Array.isArray(props === null || props === void 0 ? void 0 : props.feesForSeller) ? props === null || props === void 0 ? void 0 : props.feesForSeller : [];
25
- this.activityLog = Array.isArray(props === null || props === void 0 ? void 0 : props.activityLog) ? props === null || props === void 0 ? void 0 : props.activityLog : [];
27
+ this.tags = this.utilities.sanitzeStringArr(props === null || props === void 0 ? void 0 : props.tags);
26
28
  }
27
29
  toObj() {
28
30
  const ledgerObj = {
29
31
  documentId: this.documentId,
30
32
  createdAtTimestamp: this.createdAtTimestamp,
31
33
  updatedAtTimestamp: this.updatedAtTimestamp,
34
+ pendingReturnPeriodStartTimestamp: this.pendingReturnPeriodStartTimestamp,
32
35
  merchantId: this.merchantId,
33
36
  merchantCurrency: this.merchantCurrency,
34
37
  sellerId: this.sellerId,
@@ -44,7 +47,7 @@ class SellerProductLedger extends Base_1.default {
44
47
  amountOwedToSeller: this.amountOwedToSeller,
45
48
  status: this.status,
46
49
  feesForSeller: this.feesForSeller,
47
- activityLog: this.activityLog,
50
+ tags: this.tags,
48
51
  };
49
52
  return ledgerObj;
50
53
  }
@@ -61,6 +64,7 @@ class SellerProductLedger extends Base_1.default {
61
64
  { name: 'sellerFirstName', type: 'string', facet: false },
62
65
  { name: 'sellerLastName', type: 'string', facet: false },
63
66
  { name: 'sellerEmail', type: 'string', facet: true },
67
+ { name: 'saleType', type: 'string', facet: true },
64
68
  { name: 'productId', type: 'string', facet: true },
65
69
  { name: 'orderId', type: 'string', facet: true },
66
70
  { name: 'productTitle', type: 'string', facet: true },
@@ -70,7 +74,6 @@ class SellerProductLedger extends Base_1.default {
70
74
  { name: 'amountOwedToSeller', type: 'float', facet: true },
71
75
  { name: 'status', type: 'string', facet: true },
72
76
  { name: 'feesForSeller', type: 'object[]', facet: false },
73
- { name: 'activityLog', type: 'object[]', facet: false },
74
77
  ],
75
78
  name,
76
79
  };
@@ -80,12 +83,14 @@ class SellerProductLedger extends Base_1.default {
80
83
  documentId: this.utilities.sanitizeString(this.documentId),
81
84
  createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
82
85
  updatedAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.updatedAtTimestamp),
86
+ pendingReturnPeriodStartTimestamp: this.utilities.sanitizeMillisTimeStamp(this.pendingReturnPeriodStartTimestamp),
83
87
  merchantId: this.utilities.sanitizeString(this.merchantId),
84
88
  merchantCurrency: this.utilities.sanitizeString(this.merchantCurrency),
85
89
  sellerId: this.utilities.sanitizeString(this.sellerId),
86
90
  sellerFirstName: this.utilities.sanitizeString(this.sellerFirstName),
87
91
  sellerLastName: this.utilities.sanitizeString(this.sellerLastName),
88
92
  sellerEmail: this.utilities.sanitizeString(this.sellerEmail),
93
+ saleType: this.utilities.sanitizeString(this.saleType),
89
94
  productId: this.utilities.sanitizeString(this.productId),
90
95
  orderId: this.utilities.sanitizeString(this.orderId),
91
96
  productTitle: this.utilities.sanitizeString(this.productTitle),
@@ -98,21 +103,10 @@ class SellerProductLedger extends Base_1.default {
98
103
  name: this.utilities.sanitizeString(fee.name),
99
104
  amount: this.utilities.sanitizeNumber(fee.amount),
100
105
  })),
101
- activityLog: this.activityLog.map((log) => ({
102
- logId: this.utilities.sanitizeString(log.logId),
103
- timestamp: this.utilities.sanitizeMillisTimeStamp(log.timestamp),
104
- action: this.utilities.sanitizeString(log.action),
105
- details: this.utilities.sanitizeString(log.details),
106
- actorId: this.utilities.sanitizeString(log.actorId),
107
- actorType: this.utilities.sanitizeString(log.actorType),
108
- data: (log === null || log === void 0 ? void 0 : log.data) && Object.keys(log === null || log === void 0 ? void 0 : log.data).length ? log === null || log === void 0 ? void 0 : log.data : {},
109
- })),
106
+ tags: this.utilities.sanitzeStringArr(this.tags),
110
107
  };
111
108
  return stagedObj;
112
109
  }
113
- addActivityLogEntry(logEntry) {
114
- this.activityLog.push(logEntry);
115
- }
116
110
  addFeeEntry(feeEntry) {
117
111
  this.feesForSeller.push(feeEntry);
118
112
  }
@@ -89,13 +89,14 @@ declare type SellerProductLedgerType = {
89
89
  documentId: string;
90
90
  createdAtTimestamp: number;
91
91
  updatedAtTimestamp: number;
92
+ pendingReturnPeriodStartTimestamp: number;
92
93
  merchantId: string;
93
94
  merchantCurrency: string;
94
95
  sellerId: string;
95
96
  sellerFirstName: string;
96
97
  sellerLastName: string;
97
98
  sellerEmail: string;
98
- orderId: string;
99
+ orderId?: string;
99
100
  productId: string;
100
101
  productTitle: string;
101
102
  productImgUrl: string;
@@ -104,18 +105,20 @@ declare type SellerProductLedgerType = {
104
105
  amountOwedToSeller: string | number;
105
106
  status: SellerProductLedgerStatus;
106
107
  feesForSeller: Fee[];
107
- activityLog: ActivityLog[];
108
+ tags?: string[];
108
109
  };
109
110
  declare type TypesenseSellerProductLedgerObj = {
110
111
  documentId: string;
111
112
  createdAtTimestamp: number;
112
113
  updatedAtTimestamp: number;
114
+ pendingReturnPeriodStartTimestamp: number;
113
115
  merchantId: string;
114
116
  merchantCurrency: string;
115
117
  sellerId: string;
116
118
  sellerFirstName: string;
117
119
  sellerLastName: string;
118
120
  sellerEmail: string;
121
+ saleType: string;
119
122
  productId: string;
120
123
  orderId: string;
121
124
  productTitle: string;
@@ -125,39 +128,54 @@ declare type TypesenseSellerProductLedgerObj = {
125
128
  amountOwedToSeller: string | number;
126
129
  status: string;
127
130
  feesForSeller: Fee[];
128
- activityLog: ActivityLog[];
131
+ tags: string[];
129
132
  };
130
133
  interface Fee {
131
134
  name: string;
132
135
  amount: number;
133
136
  }
137
+ declare enum SaleType {
138
+ CONSIGNMENT = "CONSIGNMENT",
139
+ DIRECT_SALE = "DIRECT_SALE"
140
+ }
134
141
  declare enum SellerProductLedgerStatus {
135
- PENDING = "Pending",
136
- TO_PAY = "To Pay",
137
- PAID = "Paid",
138
- DISPUTED = "Disputed",
139
- RESOLVED = "Resolved",
140
- REFUNDED = "Refunded",
141
- CANCELLED = "Cancelled",
142
- IN_PROGRESS = "In Progress"
142
+ PENDING_RETURN_PERIOD_COMPLETION = "PENDING_RETURN_PERIOD_COMPLETION",
143
+ RETURNED_AND_RELISTED = "RETURNED_AND_RELISTED",
144
+ SELLER_LIQUIDATED = "SELLER_LIQUIDATED",
145
+ MERCHANT_DONATED = "MERCHANT_DONATED",
146
+ SELLER_TO_BE_PAID = "SELLER_TO_BE_PAID",
147
+ PAYMENT_IN_PROGRESS = "PAYMENT_IN_PROGRESS",
148
+ SELLER_PAID = "SELLER_PAID",
149
+ DISPUTED = "DISPUTED",
150
+ RESOLVED = "RESOLVED",
151
+ DIRECT_SALE_PENDING = "DIRECT_SALE_PENDING",
152
+ DIRECT_SALE_COMPLETED = "DIRECT_SALE_COMPLETED"
143
153
  }
144
- declare enum SellerLedgerActivityLogAction {
145
- ITEM_SOLD = "ITEM_SOLD",
146
- ITEM_RETURNED = "ITEM_RETURNED",
147
- PAYMENT_INITIATED = "PAYMENT_INITIATED",
148
- PAYMENT_COMPLETED = "PAYMENT_COMPLETED",
149
- PAYMENT_FAILED = "PAYMENT_FAILED",
150
- DISPUTE_RAISED = "DISPUTE_RAISED",
151
- DISPUTE_RESOLVED = "DISPUTE_RESOLVED",
152
- REFUND_ISSUED = "REFUND_ISSUED",
153
- TRANSACTION_CANCELLED = "TRANSACTION_CANCELLED"
154
+ declare enum SellerProductLedgerActivityLogAction {
155
+ STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION = "STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION",
156
+ STATUS_CHANGED_TO_RETURNED_AND_RELISTED = "STATUS_CHANGED_TO_RETURNED_AND_RELISTED",
157
+ STATUS_CHANGED_TO_SELLER_LIQUIDATED = "STATUS_CHANGED_TO_SELLER_LIQUIDATED",
158
+ STATUS_CHANGED_TO_MERCHANT_DONATED = "STATUS_CHANGED_TO_MERCHANT_DONATED",
159
+ STATUS_CHANGED_TO_SELLER_TO_BE_PAID = "STATUS_CHANGED_TO_SELLER_TO_BE_PAID",
160
+ STATUS_CHANGED_TO_PAYMENT_IN_PROGRESS = "STATUS_CHANGED_TO_PAYMENT_IN_PROGRESS",
161
+ STATUS_CHANGED_TO_SELLER_PAID = "STATUS_CHANGED_TO_SELLER_PAID",
162
+ STATUS_CHANGED_TO_DISPUTED = "STATUS_CHANGED_TO_DISPUTED",
163
+ STATUS_CHANGED_TO_RESOLVED = "STATUS_CHANGED_TO_RESOLVED",
164
+ STATUS_CHANGED_TO_DIRECT_SALE_PENDING = "STATUS_CHANGED_TO_DIRECT_SALE_PENDING",
165
+ STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED = "STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED",
166
+ MERCHANT_ADJUSTMENT_MADE = "MERCHANT_ADJUSTMENT_MADE"
167
+ }
168
+ declare enum AcivityLogActorTypes {
169
+ SYSTEM = "SYSTEM",
170
+ MERCHANT = "MERCHANT"
154
171
  }
155
172
  interface ActivityLog {
156
- logId: string;
173
+ documentId: string;
174
+ sellerProductLedgerId: string;
157
175
  timestamp: number;
158
- action: SellerLedgerActivityLogAction;
176
+ action: SellerProductLedgerActivityLogAction;
159
177
  details: string;
160
178
  actorId: string;
161
- actorType: string;
179
+ actorType: AcivityLogActorTypes;
162
180
  data?: any;
163
181
  }
@@ -1,24 +1,40 @@
1
1
  "use strict";
2
+ var SaleType;
3
+ (function (SaleType) {
4
+ SaleType["CONSIGNMENT"] = "CONSIGNMENT";
5
+ SaleType["DIRECT_SALE"] = "DIRECT_SALE";
6
+ })(SaleType || (SaleType = {}));
2
7
  var SellerProductLedgerStatus;
3
8
  (function (SellerProductLedgerStatus) {
4
- SellerProductLedgerStatus["PENDING"] = "Pending";
5
- SellerProductLedgerStatus["TO_PAY"] = "To Pay";
6
- SellerProductLedgerStatus["PAID"] = "Paid";
7
- SellerProductLedgerStatus["DISPUTED"] = "Disputed";
8
- SellerProductLedgerStatus["RESOLVED"] = "Resolved";
9
- SellerProductLedgerStatus["REFUNDED"] = "Refunded";
10
- SellerProductLedgerStatus["CANCELLED"] = "Cancelled";
11
- SellerProductLedgerStatus["IN_PROGRESS"] = "In Progress";
9
+ SellerProductLedgerStatus["PENDING_RETURN_PERIOD_COMPLETION"] = "PENDING_RETURN_PERIOD_COMPLETION";
10
+ SellerProductLedgerStatus["RETURNED_AND_RELISTED"] = "RETURNED_AND_RELISTED";
11
+ SellerProductLedgerStatus["SELLER_LIQUIDATED"] = "SELLER_LIQUIDATED";
12
+ SellerProductLedgerStatus["MERCHANT_DONATED"] = "MERCHANT_DONATED";
13
+ SellerProductLedgerStatus["SELLER_TO_BE_PAID"] = "SELLER_TO_BE_PAID";
14
+ SellerProductLedgerStatus["PAYMENT_IN_PROGRESS"] = "PAYMENT_IN_PROGRESS";
15
+ SellerProductLedgerStatus["SELLER_PAID"] = "SELLER_PAID";
16
+ SellerProductLedgerStatus["DISPUTED"] = "DISPUTED";
17
+ SellerProductLedgerStatus["RESOLVED"] = "RESOLVED";
18
+ SellerProductLedgerStatus["DIRECT_SALE_PENDING"] = "DIRECT_SALE_PENDING";
19
+ SellerProductLedgerStatus["DIRECT_SALE_COMPLETED"] = "DIRECT_SALE_COMPLETED";
12
20
  })(SellerProductLedgerStatus || (SellerProductLedgerStatus = {}));
13
- var SellerLedgerActivityLogAction;
14
- (function (SellerLedgerActivityLogAction) {
15
- SellerLedgerActivityLogAction["ITEM_SOLD"] = "ITEM_SOLD";
16
- SellerLedgerActivityLogAction["ITEM_RETURNED"] = "ITEM_RETURNED";
17
- SellerLedgerActivityLogAction["PAYMENT_INITIATED"] = "PAYMENT_INITIATED";
18
- SellerLedgerActivityLogAction["PAYMENT_COMPLETED"] = "PAYMENT_COMPLETED";
19
- SellerLedgerActivityLogAction["PAYMENT_FAILED"] = "PAYMENT_FAILED";
20
- SellerLedgerActivityLogAction["DISPUTE_RAISED"] = "DISPUTE_RAISED";
21
- SellerLedgerActivityLogAction["DISPUTE_RESOLVED"] = "DISPUTE_RESOLVED";
22
- SellerLedgerActivityLogAction["REFUND_ISSUED"] = "REFUND_ISSUED";
23
- SellerLedgerActivityLogAction["TRANSACTION_CANCELLED"] = "TRANSACTION_CANCELLED";
24
- })(SellerLedgerActivityLogAction || (SellerLedgerActivityLogAction = {}));
21
+ var SellerProductLedgerActivityLogAction;
22
+ (function (SellerProductLedgerActivityLogAction) {
23
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION"] = "STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION";
24
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_RETURNED_AND_RELISTED"] = "STATUS_CHANGED_TO_RETURNED_AND_RELISTED";
25
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_SELLER_LIQUIDATED"] = "STATUS_CHANGED_TO_SELLER_LIQUIDATED";
26
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_MERCHANT_DONATED"] = "STATUS_CHANGED_TO_MERCHANT_DONATED";
27
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_SELLER_TO_BE_PAID"] = "STATUS_CHANGED_TO_SELLER_TO_BE_PAID";
28
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_PAYMENT_IN_PROGRESS"] = "STATUS_CHANGED_TO_PAYMENT_IN_PROGRESS";
29
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_SELLER_PAID"] = "STATUS_CHANGED_TO_SELLER_PAID";
30
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_DISPUTED"] = "STATUS_CHANGED_TO_DISPUTED";
31
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_RESOLVED"] = "STATUS_CHANGED_TO_RESOLVED";
32
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_DIRECT_SALE_PENDING"] = "STATUS_CHANGED_TO_DIRECT_SALE_PENDING";
33
+ SellerProductLedgerActivityLogAction["STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED"] = "STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED";
34
+ SellerProductLedgerActivityLogAction["MERCHANT_ADJUSTMENT_MADE"] = "MERCHANT_ADJUSTMENT_MADE";
35
+ })(SellerProductLedgerActivityLogAction || (SellerProductLedgerActivityLogAction = {}));
36
+ var AcivityLogActorTypes;
37
+ (function (AcivityLogActorTypes) {
38
+ AcivityLogActorTypes["SYSTEM"] = "SYSTEM";
39
+ AcivityLogActorTypes["MERCHANT"] = "MERCHANT";
40
+ })(AcivityLogActorTypes || (AcivityLogActorTypes = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.4.7",
3
+ "version": "3.4.8",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",