rerobe-js-orm 3.4.6 → 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,3 +14,143 @@ export namespace CUSTOMER_CREDIT_REASONS {
14
14
  const customerCompensation: string;
15
15
  const refund: string;
16
16
  }
17
+ export namespace SellerProductLedgerStatusDescriptions {
18
+ namespace PENDING_RETURN_PERIOD_COMPLETION {
19
+ const label: string;
20
+ const description: string;
21
+ }
22
+ namespace RETURNED_AND_RELISTED {
23
+ const label_1: string;
24
+ export { label_1 as label };
25
+ const description_1: string;
26
+ export { description_1 as description };
27
+ }
28
+ namespace SELLER_LIQUIDATED {
29
+ const label_2: string;
30
+ export { label_2 as label };
31
+ const description_2: string;
32
+ export { description_2 as description };
33
+ }
34
+ namespace MERCHANT_DONATED {
35
+ const label_3: string;
36
+ export { label_3 as label };
37
+ const description_3: string;
38
+ export { description_3 as description };
39
+ }
40
+ namespace SELLER_TO_BE_PAID {
41
+ const label_4: string;
42
+ export { label_4 as label };
43
+ const description_4: string;
44
+ export { description_4 as description };
45
+ }
46
+ namespace PAYMENT_IN_PROGRESS {
47
+ const label_5: string;
48
+ export { label_5 as label };
49
+ const description_5: string;
50
+ export { description_5 as description };
51
+ }
52
+ namespace SELLER_PAID {
53
+ const label_6: string;
54
+ export { label_6 as label };
55
+ const description_6: string;
56
+ export { description_6 as description };
57
+ }
58
+ namespace DISPUTED {
59
+ const label_7: string;
60
+ export { label_7 as label };
61
+ const description_7: string;
62
+ export { description_7 as description };
63
+ }
64
+ namespace RESOLVED {
65
+ const label_8: string;
66
+ export { label_8 as label };
67
+ const description_8: string;
68
+ export { description_8 as description };
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 };
155
+ }
156
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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,3 +17,99 @@ exports.CUSTOMER_CREDIT_REASONS = {
17
17
  customerCompensation: 'CUSTOMER_COMPENSATION',
18
18
  refund: 'REFUND',
19
19
  };
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
+ },
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
+ },
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.',
47
+ description: 'This status indicates that payment has been disbursed to the seller.',
48
+ },
49
+ [SellerProductLedgerStatus.DISPUTED]: {
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.',
52
+ },
53
+ [SellerProductLedgerStatus.RESOLVED]: {
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.',
56
+ },
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.',
60
+ },
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.',
64
+ },
65
+ };
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.',
114
+ },
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;
@@ -0,0 +1,37 @@
1
+ import Base from '../Base';
2
+ export default class SellerProductLedger extends Base {
3
+ documentId: string;
4
+ createdAtTimestamp: number;
5
+ updatedAtTimestamp: number;
6
+ pendingReturnPeriodStartTimestamp: number;
7
+ merchantId: string;
8
+ merchantCurrency: string;
9
+ sellerId: string;
10
+ sellerFirstName: string;
11
+ sellerLastName: string;
12
+ sellerEmail: string;
13
+ saleType: SaleType;
14
+ productId: string;
15
+ orderId: string;
16
+ productTitle: string;
17
+ productImgUrl: string;
18
+ merchantCommission: string | number;
19
+ priceSold: string | number;
20
+ amountOwedToSeller: string | number;
21
+ status: SellerProductLedgerStatus;
22
+ feesForSeller: Fee[];
23
+ tags: string[];
24
+ constructor(props?: any);
25
+ toObj(): SellerProductLedgerType;
26
+ generateSchemaForTypesense(name?: string): {
27
+ default_sorting_field: string;
28
+ fields: {
29
+ name: string;
30
+ type: string;
31
+ facet: boolean;
32
+ }[];
33
+ name: string;
34
+ };
35
+ toObjForTypesense(): TypesenseSellerProductLedgerObj;
36
+ addFeeEntry(feeEntry: Fee): void;
37
+ }
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Base_1 = require("../Base");
4
+ class SellerProductLedger extends Base_1.default {
5
+ constructor(props) {
6
+ super();
7
+ this.documentId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
8
+ this.createdAtTimestamp = this.utilities.sanitizeMillisTimeStamp(props === null || props === void 0 ? void 0 : props.createdAtTimestamp);
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);
11
+ this.merchantId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.merchantId);
12
+ this.merchantCurrency = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.merchantCurrency);
13
+ this.sellerId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerId);
14
+ this.orderId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.orderId);
15
+ this.sellerFirstName = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerFirstName);
16
+ this.sellerLastName = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.sellerLastName);
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);
19
+ this.productId = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.productId);
20
+ this.productTitle = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.productTitle);
21
+ this.productImgUrl = this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.productImgUrl);
22
+ this.merchantCommission = this.utilities.sanitizeNumber(props === null || props === void 0 ? void 0 : props.merchantCommission);
23
+ this.priceSold = this.utilities.sanitizeNumber(props === null || props === void 0 ? void 0 : props.priceSold);
24
+ this.amountOwedToSeller = this.utilities.sanitizeNumber(props === null || props === void 0 ? void 0 : props.amountOwedToSeller);
25
+ this.status = this.utilities.sanitizeString((props === null || props === void 0 ? void 0 : props.status) || SellerProductLedgerStatus.PENDING_RETURN_PERIOD_COMPLETION);
26
+ this.feesForSeller = Array.isArray(props === null || props === void 0 ? void 0 : props.feesForSeller) ? props === null || props === void 0 ? void 0 : props.feesForSeller : [];
27
+ this.tags = this.utilities.sanitzeStringArr(props === null || props === void 0 ? void 0 : props.tags);
28
+ }
29
+ toObj() {
30
+ const ledgerObj = {
31
+ documentId: this.documentId,
32
+ createdAtTimestamp: this.createdAtTimestamp,
33
+ updatedAtTimestamp: this.updatedAtTimestamp,
34
+ pendingReturnPeriodStartTimestamp: this.pendingReturnPeriodStartTimestamp,
35
+ merchantId: this.merchantId,
36
+ merchantCurrency: this.merchantCurrency,
37
+ sellerId: this.sellerId,
38
+ sellerFirstName: this.sellerFirstName,
39
+ sellerLastName: this.sellerLastName,
40
+ sellerEmail: this.sellerEmail,
41
+ orderId: this.orderId,
42
+ productId: this.productId,
43
+ productTitle: this.productTitle,
44
+ productImgUrl: this.productImgUrl,
45
+ merchantCommission: this.merchantCommission,
46
+ priceSold: this.priceSold,
47
+ amountOwedToSeller: this.amountOwedToSeller,
48
+ status: this.status,
49
+ feesForSeller: this.feesForSeller,
50
+ tags: this.tags,
51
+ };
52
+ return ledgerObj;
53
+ }
54
+ generateSchemaForTypesense(name = 'prod_sellerProductLedger_20240223') {
55
+ return {
56
+ default_sorting_field: 'createdAtTimestamp',
57
+ fields: [
58
+ { name: 'documentId', type: 'string', facet: false },
59
+ { name: 'createdAtTimestamp', type: 'int64', facet: true },
60
+ { name: 'updatedAtTimestamp', type: 'int64', facet: true },
61
+ { name: 'merchantId', type: 'string', facet: true },
62
+ { name: 'merchantCurrency', type: 'string', facet: true },
63
+ { name: 'sellerId', type: 'string', facet: true },
64
+ { name: 'sellerFirstName', type: 'string', facet: false },
65
+ { name: 'sellerLastName', type: 'string', facet: false },
66
+ { name: 'sellerEmail', type: 'string', facet: true },
67
+ { name: 'saleType', type: 'string', facet: true },
68
+ { name: 'productId', type: 'string', facet: true },
69
+ { name: 'orderId', type: 'string', facet: true },
70
+ { name: 'productTitle', type: 'string', facet: true },
71
+ { name: 'productImgUrl', type: 'string', facet: false },
72
+ { name: 'merchantCommission', type: 'float', facet: true },
73
+ { name: 'priceSold', type: 'float', facet: true },
74
+ { name: 'amountOwedToSeller', type: 'float', facet: true },
75
+ { name: 'status', type: 'string', facet: true },
76
+ { name: 'feesForSeller', type: 'object[]', facet: false },
77
+ ],
78
+ name,
79
+ };
80
+ }
81
+ toObjForTypesense() {
82
+ const stagedObj = {
83
+ documentId: this.utilities.sanitizeString(this.documentId),
84
+ createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
85
+ updatedAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.updatedAtTimestamp),
86
+ pendingReturnPeriodStartTimestamp: this.utilities.sanitizeMillisTimeStamp(this.pendingReturnPeriodStartTimestamp),
87
+ merchantId: this.utilities.sanitizeString(this.merchantId),
88
+ merchantCurrency: this.utilities.sanitizeString(this.merchantCurrency),
89
+ sellerId: this.utilities.sanitizeString(this.sellerId),
90
+ sellerFirstName: this.utilities.sanitizeString(this.sellerFirstName),
91
+ sellerLastName: this.utilities.sanitizeString(this.sellerLastName),
92
+ sellerEmail: this.utilities.sanitizeString(this.sellerEmail),
93
+ saleType: this.utilities.sanitizeString(this.saleType),
94
+ productId: this.utilities.sanitizeString(this.productId),
95
+ orderId: this.utilities.sanitizeString(this.orderId),
96
+ productTitle: this.utilities.sanitizeString(this.productTitle),
97
+ productImgUrl: this.utilities.sanitizeString(this.productImgUrl),
98
+ merchantCommission: this.utilities.sanitizeNumber(this.merchantCommission),
99
+ priceSold: this.utilities.sanitizeNumber(this.priceSold),
100
+ amountOwedToSeller: this.utilities.sanitizeNumber(this.amountOwedToSeller),
101
+ status: this.utilities.sanitizeString(this.status),
102
+ feesForSeller: this.feesForSeller.map((fee) => ({
103
+ name: this.utilities.sanitizeString(fee.name),
104
+ amount: this.utilities.sanitizeNumber(fee.amount),
105
+ })),
106
+ tags: this.utilities.sanitzeStringArr(this.tags),
107
+ };
108
+ return stagedObj;
109
+ }
110
+ addFeeEntry(feeEntry) {
111
+ this.feesForSeller.push(feeEntry);
112
+ }
113
+ }
114
+ exports.default = SellerProductLedger;
@@ -85,3 +85,97 @@ declare type TypesenseCustomerLedgerTransactionObj = {
85
85
  description: string;
86
86
  reason: string;
87
87
  };
88
+ declare type SellerProductLedgerType = {
89
+ documentId: string;
90
+ createdAtTimestamp: number;
91
+ updatedAtTimestamp: number;
92
+ pendingReturnPeriodStartTimestamp: number;
93
+ merchantId: string;
94
+ merchantCurrency: string;
95
+ sellerId: string;
96
+ sellerFirstName: string;
97
+ sellerLastName: string;
98
+ sellerEmail: string;
99
+ orderId?: string;
100
+ productId: string;
101
+ productTitle: string;
102
+ productImgUrl: string;
103
+ merchantCommission: string | number;
104
+ priceSold: string | number;
105
+ amountOwedToSeller: string | number;
106
+ status: SellerProductLedgerStatus;
107
+ feesForSeller: Fee[];
108
+ tags?: string[];
109
+ };
110
+ declare type TypesenseSellerProductLedgerObj = {
111
+ documentId: string;
112
+ createdAtTimestamp: number;
113
+ updatedAtTimestamp: number;
114
+ pendingReturnPeriodStartTimestamp: number;
115
+ merchantId: string;
116
+ merchantCurrency: string;
117
+ sellerId: string;
118
+ sellerFirstName: string;
119
+ sellerLastName: string;
120
+ sellerEmail: string;
121
+ saleType: string;
122
+ productId: string;
123
+ orderId: string;
124
+ productTitle: string;
125
+ productImgUrl: string;
126
+ merchantCommission: string | number;
127
+ priceSold: string | number;
128
+ amountOwedToSeller: string | number;
129
+ status: string;
130
+ feesForSeller: Fee[];
131
+ tags: string[];
132
+ };
133
+ interface Fee {
134
+ name: string;
135
+ amount: number;
136
+ }
137
+ declare enum SaleType {
138
+ CONSIGNMENT = "CONSIGNMENT",
139
+ DIRECT_SALE = "DIRECT_SALE"
140
+ }
141
+ declare enum SellerProductLedgerStatus {
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"
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"
171
+ }
172
+ interface ActivityLog {
173
+ documentId: string;
174
+ sellerProductLedgerId: string;
175
+ timestamp: number;
176
+ action: SellerProductLedgerActivityLogAction;
177
+ details: string;
178
+ actorId: string;
179
+ actorType: AcivityLogActorTypes;
180
+ data?: any;
181
+ }
@@ -1 +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 = {}));
7
+ var SellerProductLedgerStatus;
8
+ (function (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";
20
+ })(SellerProductLedgerStatus || (SellerProductLedgerStatus = {}));
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.6",
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",