rerobe-js-orm 3.4.7 → 3.4.9
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.
- package/lib/constants/ledger-constants.d.ts +95 -87
- package/lib/constants/ledger-constants.js +84 -60
- package/lib/helpers/SellerProductLedgerHelpers.d.ts +3 -0
- package/lib/helpers/SellerProductLedgerHelpers.js +20 -0
- package/lib/models/SellerProductLedger.d.ts +3 -2
- package/lib/models/SellerProductLedger.js +10 -16
- package/lib/types/ledger-transaction-types.d.ts +42 -24
- package/lib/types/ledger-transaction-types.js +36 -20
- package/package.json +1 -1
|
@@ -1,104 +1,112 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
export const
|
|
18
|
-
|
|
1
|
+
export declare const TRANSACTION_TYPES: {
|
|
2
|
+
merchantCredit: string;
|
|
3
|
+
merchantDebit: string;
|
|
4
|
+
sellerCredit: string;
|
|
5
|
+
sellerDebit: string;
|
|
6
|
+
customerCredit: string;
|
|
7
|
+
customerDebit: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const CUSTOMER_CREDIT_REASONS: {
|
|
10
|
+
giftCard: string;
|
|
11
|
+
marketingPromotion: string;
|
|
12
|
+
partnershipCompensation: string;
|
|
13
|
+
employeeCompensation: string;
|
|
14
|
+
customerCompensation: string;
|
|
15
|
+
refund: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const SellerProductLedgerStatusDescriptions: {
|
|
18
|
+
PENDING_RETURN_PERIOD_COMPLETION: {
|
|
19
|
+
label: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
RETURNED_AND_RELISTED: {
|
|
23
|
+
label: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
SELLER_LIQUIDATED: {
|
|
27
|
+
label: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
MERCHANT_DONATED: {
|
|
31
|
+
label: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
SELLER_TO_BE_PAID: {
|
|
35
|
+
label: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
PAYMENT_IN_PROGRESS: {
|
|
39
|
+
label: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
SELLER_PAID: {
|
|
43
|
+
label: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
DISPUTED: {
|
|
47
|
+
label: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
RESOLVED: {
|
|
51
|
+
label: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
DIRECT_SALE_PENDING: {
|
|
55
|
+
label: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
DIRECT_SALE_COMPLETED: {
|
|
59
|
+
label: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const SellerProductLedgerActivityLogActionDescriptions: {
|
|
64
|
+
STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION: {
|
|
65
|
+
label: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
STATUS_CHANGED_TO_RETURNED_AND_RELISTED: {
|
|
69
|
+
label: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
STATUS_CHANGED_TO_SELLER_LIQUIDATED: {
|
|
73
|
+
label: string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
STATUS_CHANGED_TO_MERCHANT_DONATED: {
|
|
77
|
+
label: string;
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
80
|
+
STATUS_CHANGED_TO_SELLER_TO_BE_PAID: {
|
|
81
|
+
label: string;
|
|
19
82
|
description: string;
|
|
20
|
-
action: string;
|
|
21
83
|
};
|
|
22
|
-
|
|
84
|
+
STATUS_CHANGED_TO_PAYMENT_IN_PROGRESS: {
|
|
85
|
+
label: string;
|
|
23
86
|
description: string;
|
|
24
|
-
action: string;
|
|
25
87
|
};
|
|
26
|
-
|
|
88
|
+
STATUS_CHANGED_TO_SELLER_PAID: {
|
|
89
|
+
label: string;
|
|
27
90
|
description: string;
|
|
28
|
-
action: string;
|
|
29
91
|
};
|
|
30
|
-
|
|
92
|
+
STATUS_CHANGED_TO_DISPUTED: {
|
|
93
|
+
label: string;
|
|
31
94
|
description: string;
|
|
32
|
-
action: string;
|
|
33
95
|
};
|
|
34
|
-
|
|
96
|
+
STATUS_CHANGED_TO_RESOLVED: {
|
|
97
|
+
label: string;
|
|
35
98
|
description: string;
|
|
36
|
-
action: string;
|
|
37
99
|
};
|
|
38
|
-
|
|
100
|
+
STATUS_CHANGED_TO_DIRECT_SALE_PENDING: {
|
|
101
|
+
label: string;
|
|
39
102
|
description: string;
|
|
40
|
-
action: string;
|
|
41
103
|
};
|
|
42
|
-
|
|
104
|
+
STATUS_CHANGED_TO_DIRECT_SALE_COMPLETED: {
|
|
105
|
+
label: string;
|
|
43
106
|
description: string;
|
|
44
|
-
action: string;
|
|
45
107
|
};
|
|
46
|
-
|
|
108
|
+
MERCHANT_ADJUSTMENT_MADE: {
|
|
109
|
+
label: string;
|
|
47
110
|
description: string;
|
|
48
|
-
action: string;
|
|
49
111
|
};
|
|
50
112
|
};
|
|
51
|
-
export namespace SellerLedgerActivityLogActionsDescriptions {
|
|
52
|
-
namespace ITEM_SOLD {
|
|
53
|
-
const description: string;
|
|
54
|
-
const action: string;
|
|
55
|
-
}
|
|
56
|
-
namespace ITEM_RETURNED {
|
|
57
|
-
const description_1: string;
|
|
58
|
-
export { description_1 as description };
|
|
59
|
-
const action_1: string;
|
|
60
|
-
export { action_1 as action };
|
|
61
|
-
}
|
|
62
|
-
namespace PAYMENT_INITIATED {
|
|
63
|
-
const description_2: string;
|
|
64
|
-
export { description_2 as description };
|
|
65
|
-
const action_2: string;
|
|
66
|
-
export { action_2 as action };
|
|
67
|
-
}
|
|
68
|
-
namespace PAYMENT_COMPLETED {
|
|
69
|
-
const description_3: string;
|
|
70
|
-
export { description_3 as description };
|
|
71
|
-
const action_3: string;
|
|
72
|
-
export { action_3 as action };
|
|
73
|
-
}
|
|
74
|
-
namespace PAYMENT_FAILED {
|
|
75
|
-
const description_4: string;
|
|
76
|
-
export { description_4 as description };
|
|
77
|
-
const action_4: string;
|
|
78
|
-
export { action_4 as action };
|
|
79
|
-
}
|
|
80
|
-
namespace DISPUTE_RAISED {
|
|
81
|
-
const description_5: string;
|
|
82
|
-
export { description_5 as description };
|
|
83
|
-
const action_5: string;
|
|
84
|
-
export { action_5 as action };
|
|
85
|
-
}
|
|
86
|
-
namespace DISPUTE_RESOLVED {
|
|
87
|
-
const description_6: string;
|
|
88
|
-
export { description_6 as description };
|
|
89
|
-
const action_6: string;
|
|
90
|
-
export { action_6 as action };
|
|
91
|
-
}
|
|
92
|
-
namespace REFUND_ISSUED {
|
|
93
|
-
const description_7: string;
|
|
94
|
-
export { description_7 as description };
|
|
95
|
-
const action_7: string;
|
|
96
|
-
export { action_7 as action };
|
|
97
|
-
}
|
|
98
|
-
namespace TRANSACTION_CANCELLED {
|
|
99
|
-
const description_8: string;
|
|
100
|
-
export { description_8 as description };
|
|
101
|
-
const action_8: string;
|
|
102
|
-
export { action_8 as action };
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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.
|
|
21
|
-
[SellerProductLedgerStatus.
|
|
22
|
-
|
|
23
|
-
|
|
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.
|
|
26
|
-
|
|
27
|
-
|
|
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.
|
|
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
|
-
|
|
35
|
-
|
|
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
|
-
|
|
39
|
-
|
|
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.
|
|
46
|
-
|
|
47
|
-
|
|
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.
|
|
50
|
-
|
|
51
|
-
|
|
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.
|
|
55
|
-
[
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
[
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
[
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
[
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
[
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
[
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
[
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
[
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
[
|
|
88
|
-
|
|
89
|
-
|
|
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,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
|
-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
173
|
+
documentId: string;
|
|
174
|
+
sellerProductLedgerId: string;
|
|
157
175
|
timestamp: number;
|
|
158
|
-
action:
|
|
176
|
+
action: SellerProductLedgerActivityLogAction;
|
|
159
177
|
details: string;
|
|
160
178
|
actorId: string;
|
|
161
|
-
actorType:
|
|
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["
|
|
5
|
-
SellerProductLedgerStatus["
|
|
6
|
-
SellerProductLedgerStatus["
|
|
7
|
-
SellerProductLedgerStatus["
|
|
8
|
-
SellerProductLedgerStatus["
|
|
9
|
-
SellerProductLedgerStatus["
|
|
10
|
-
SellerProductLedgerStatus["
|
|
11
|
-
SellerProductLedgerStatus["
|
|
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
|
|
14
|
-
(function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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 = {}));
|