rerobe-js-orm 4.4.6 → 4.4.7
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/file-constants.d.ts +4 -4
- package/lib/constants/ledger-constants.js +6 -6
- package/lib/constants/merchant-constants.d.ts +43 -43
- package/lib/constants/notification-constants.d.ts +9 -9
- package/lib/constants/order-constants.d.ts +44 -35
- package/lib/constants/product-constants.d.ts +193 -193
- package/lib/constants/product-constants.js +3 -3
- package/lib/factories/Product/ProductFromFormState.js +4 -4
- package/lib/helpers/CryptoPolyfill.js +1 -2
- package/lib/helpers/OrderHelpers.js +2 -2
- package/lib/helpers/SellerProductLedgerHelpers.js +1 -1
- package/lib/helpers/Utilities.js +6 -7
- package/lib/models/Merchant.js +1 -1
- package/lib/models/Order.js +1 -1
- package/lib/models/PayoutAccount.js +1 -1
- package/lib/models/Product.js +15 -11
- package/lib/models/ProductCollection.js +2 -2
- package/lib/models/ProductStateManager.js +1 -1
- package/lib/types/ledger-transaction-types.d.ts +6 -6
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export namespace RIBBN_FILE_CATEGORY {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
let product: string;
|
|
3
|
+
let generalAsset: string;
|
|
4
|
+
let collection: string;
|
|
5
|
+
let mobileAppOnboarding: string;
|
|
6
6
|
}
|
|
@@ -27,12 +27,12 @@ exports.SaleType = {
|
|
|
27
27
|
DIRECT_SALE: 'DIRECT_SALE',
|
|
28
28
|
};
|
|
29
29
|
exports.SellerProductLedgerStatus = {
|
|
30
|
-
PENDING_RETURN_PERIOD_COMPLETION: 'PENDING_RETURN_PERIOD_COMPLETION',
|
|
31
|
-
RETURNED_AND_RELISTED: 'RETURNED_AND_RELISTED',
|
|
32
|
-
SELLER_LIQUIDATED: 'SELLER_LIQUIDATED',
|
|
33
|
-
MERCHANT_DONATED: 'MERCHANT_DONATED',
|
|
34
|
-
SELLER_TO_BE_PAID: 'SELLER_TO_BE_PAID',
|
|
35
|
-
PAYMENT_IN_PROGRESS: 'PAYMENT_IN_PROGRESS',
|
|
30
|
+
PENDING_RETURN_PERIOD_COMPLETION: 'PENDING_RETURN_PERIOD_COMPLETION', // Order is created => each item in order should get created (or logged if already created); Admin can also add to ledger from Products Table Action
|
|
31
|
+
RETURNED_AND_RELISTED: 'RETURNED_AND_RELISTED', // Merchant will be the actor to move ledgerEntity to this state once item has cleared the return period. We can set up scheduledFunctionToTagSellerProductLedgerEntities to tag ledger entities on how long ago the item sold and how long it's been in return period
|
|
32
|
+
SELLER_LIQUIDATED: 'SELLER_LIQUIDATED', // Item was returned and relisted but then seller decides to take item back. In this case, item amount owed to seller goes to zero
|
|
33
|
+
MERCHANT_DONATED: 'MERCHANT_DONATED', // Item was returned and relisted but merchant decides to donate item and seller does not want it back. In this case, item amount owed to seller goes to zero
|
|
34
|
+
SELLER_TO_BE_PAID: 'SELLER_TO_BE_PAID', // From here
|
|
35
|
+
PAYMENT_IN_PROGRESS: 'PAYMENT_IN_PROGRESS', // to here is when fees would be added in Admin UI
|
|
36
36
|
SELLER_PAID: 'SELLER_PAID',
|
|
37
37
|
DISPUTED: 'DISPUTED',
|
|
38
38
|
RESOLVED: 'RESOLVED',
|
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
export namespace MERCHANT_TYPES {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
let individual: string;
|
|
3
|
+
let business: string;
|
|
4
|
+
let enterprise: string;
|
|
5
5
|
}
|
|
6
6
|
export namespace PAYMENT_TIERS {
|
|
7
7
|
export namespace starter {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
let id: string;
|
|
9
|
+
let monthlyFee: number;
|
|
10
|
+
let transactionFee: number;
|
|
11
|
+
let currency: string;
|
|
12
12
|
}
|
|
13
13
|
export namespace business_1 {
|
|
14
|
-
|
|
14
|
+
let id_1: string;
|
|
15
15
|
export { id_1 as id };
|
|
16
|
-
|
|
16
|
+
let monthlyFee_1: number;
|
|
17
17
|
export { monthlyFee_1 as monthlyFee };
|
|
18
|
-
|
|
18
|
+
let transactionFee_1: number;
|
|
19
19
|
export { transactionFee_1 as transactionFee };
|
|
20
|
-
|
|
20
|
+
let currency_1: string;
|
|
21
21
|
export { currency_1 as currency };
|
|
22
22
|
}
|
|
23
23
|
export { business_1 as business };
|
|
24
24
|
export namespace enterprise_1 {
|
|
25
|
-
|
|
25
|
+
let id_2: string;
|
|
26
26
|
export { id_2 as id };
|
|
27
|
-
|
|
27
|
+
let monthlyFee_2: number;
|
|
28
28
|
export { monthlyFee_2 as monthlyFee };
|
|
29
|
-
|
|
29
|
+
let transactionFee_2: number;
|
|
30
30
|
export { transactionFee_2 as transactionFee };
|
|
31
|
-
|
|
31
|
+
let currency_2: string;
|
|
32
32
|
export { currency_2 as currency };
|
|
33
33
|
}
|
|
34
34
|
export { enterprise_1 as enterprise };
|
|
35
35
|
}
|
|
36
36
|
export namespace INDUSTRY_TYPES {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
let beauty: string;
|
|
38
|
+
let clothing: string;
|
|
39
|
+
let electronics: string;
|
|
40
|
+
let furniture: string;
|
|
41
|
+
let handcrafts: string;
|
|
42
|
+
let jewelry: string;
|
|
43
|
+
let sports: string;
|
|
44
|
+
let toys: string;
|
|
45
|
+
let other: string;
|
|
46
46
|
}
|
|
47
47
|
export namespace UNIT_SYSTEM_TYPES {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
let metric: string;
|
|
49
|
+
let imperial: string;
|
|
50
50
|
}
|
|
51
51
|
export namespace METRIC_WEIGHT_TYPES {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
let kilogram: string;
|
|
53
|
+
let gram: string;
|
|
54
54
|
}
|
|
55
55
|
export namespace IMPERIAL_WEIGHT_TYPES {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
let pound: string;
|
|
57
|
+
let once: string;
|
|
58
58
|
}
|
|
59
59
|
export namespace RIBBN_WEBHOOK_EVENT_DICT {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
let productCreate: string;
|
|
61
|
+
let productUpdate: string;
|
|
62
|
+
let productDelete: string;
|
|
63
63
|
}
|
|
64
64
|
export namespace SUBSCRIPTION_STATUSES {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
let active: string;
|
|
66
|
+
let activeNoSellRequests: string;
|
|
67
|
+
let past_due: string;
|
|
68
|
+
let canceled: string;
|
|
69
|
+
let unpaid: string;
|
|
70
|
+
let trialing: string;
|
|
71
|
+
let incomplete: string;
|
|
72
|
+
let incomplete_expired: string;
|
|
73
|
+
let paused: string;
|
|
74
|
+
let special: string;
|
|
75
75
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export namespace CUSTOMER_NOTIFICATION_TYPES {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
let orderConfirmation: string;
|
|
3
|
+
let orderCancellation: string;
|
|
4
|
+
let orderRefund: string;
|
|
5
|
+
let orderReadyForPickUp: string;
|
|
6
|
+
let orderComplete: string;
|
|
7
|
+
let shippingConfirmation: string;
|
|
8
|
+
let generalMessage: string;
|
|
9
|
+
let abandonedCart: string;
|
|
10
|
+
let orderReceiptStore: string;
|
|
11
11
|
}
|
|
@@ -1,51 +1,60 @@
|
|
|
1
1
|
export namespace SHIPPING_TYPES {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
let localPickUp: string;
|
|
3
|
+
let localDelivery: string;
|
|
4
|
+
let shipping: string;
|
|
5
5
|
}
|
|
6
6
|
export namespace PAYMENT_TYPES {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
let creditCard: string;
|
|
8
|
+
let klarna: string;
|
|
9
|
+
let swish: string;
|
|
10
|
+
let shoppingCredit: string;
|
|
11
|
+
let cash: string;
|
|
12
|
+
let mobilePayment: string;
|
|
13
13
|
}
|
|
14
14
|
export namespace ORDER_STATES {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
let draft: string;
|
|
16
|
+
let completed: string;
|
|
17
17
|
}
|
|
18
18
|
export namespace SALES_CHANNELS {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
let mobileApp: string;
|
|
20
|
+
let webApp: string;
|
|
21
|
+
let store: string;
|
|
22
|
+
let onlineStore: string;
|
|
23
|
+
let thirdParty: string;
|
|
24
|
+
let ahlens: string;
|
|
25
|
+
let ribbnMobilePOS: string;
|
|
26
|
+
let ribbnWebPOS: string;
|
|
27
|
+
let ribbnSellThroughChannelPartner: string;
|
|
28
|
+
let ribbnSellOnChannelPartner: string;
|
|
29
29
|
}
|
|
30
30
|
export namespace FULFILLMENT_TYPES {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
let fulfilled: string;
|
|
32
|
+
let partiallyFulfilled: string;
|
|
33
|
+
let unfulfilled: string;
|
|
34
|
+
let inProgress: string;
|
|
35
|
+
let canceled: string;
|
|
36
|
+
let restocked: string;
|
|
37
37
|
}
|
|
38
38
|
export namespace FINANCIAL_TYPES {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
let paid: string;
|
|
40
|
+
let pending: string;
|
|
41
|
+
let refunded: string;
|
|
42
|
+
let partiallyRefunded: string;
|
|
43
|
+
let authorized: string;
|
|
44
44
|
}
|
|
45
45
|
export namespace RETURN_POLICY_TYPES {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
let inStore: string;
|
|
47
|
+
let online: string;
|
|
48
48
|
}
|
|
49
49
|
export const SALES_CHANNEL_TO_RETURN_POLICY_MAPPING: {
|
|
50
|
-
[
|
|
50
|
+
[SALES_CHANNELS.mobileApp]: string;
|
|
51
|
+
[SALES_CHANNELS.webApp]: string;
|
|
52
|
+
[SALES_CHANNELS.store]: string;
|
|
53
|
+
[SALES_CHANNELS.onlineStore]: string;
|
|
54
|
+
[SALES_CHANNELS.thirdParty]: string;
|
|
55
|
+
[SALES_CHANNELS.ahlens]: string;
|
|
56
|
+
[SALES_CHANNELS.ribbnMobilePOS]: string;
|
|
57
|
+
[SALES_CHANNELS.ribbnWebPOS]: string;
|
|
58
|
+
[SALES_CHANNELS.ribbnSellThroughChannelPartner]: string;
|
|
59
|
+
[SALES_CHANNELS.ribbnSellOnChannelPartner]: string;
|
|
51
60
|
};
|
|
@@ -1,329 +1,329 @@
|
|
|
1
1
|
export namespace SELLER_DRIVEN_STATES {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
let sellerDonated: string;
|
|
3
|
+
let sellRequestReview: string;
|
|
4
|
+
let sellRequestReviewDraft: string;
|
|
5
|
+
let sellerToDropOff: string;
|
|
6
|
+
let sellerToShip: string;
|
|
7
|
+
let sellerToGetPickUp: string;
|
|
8
|
+
let sellerSelfReject: string;
|
|
9
|
+
let liquidationRequested: string;
|
|
10
10
|
}
|
|
11
11
|
export namespace ADMIN_DRIVEN_STATES {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
let draft: string;
|
|
13
|
+
let archived: string;
|
|
14
|
+
let hold: string;
|
|
15
|
+
let qualityControl: string;
|
|
16
|
+
let pendingPublication: string;
|
|
17
|
+
let listed: string;
|
|
18
|
+
let availableInStore: string;
|
|
19
19
|
}
|
|
20
20
|
export namespace ADMIN_ACTION_DRIVEN_STATES {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
let accepted: string;
|
|
22
|
+
let rejected: string;
|
|
23
|
+
let clearance: string;
|
|
24
|
+
let soldSellerToBePaid: string;
|
|
25
|
+
let soldSellerPaid: string;
|
|
26
|
+
let liquidationReady: string;
|
|
27
|
+
let sellerLiquidated: string;
|
|
28
|
+
let merchantDonated: string;
|
|
29
29
|
}
|
|
30
30
|
export namespace SYSTEM_DRIVEN_STATES {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
let sold: string;
|
|
32
|
+
let soldSellerSelfPay: string;
|
|
33
|
+
let soldSellerPayoutProcessing: string;
|
|
34
|
+
let soldSellerPayoutFailed: string;
|
|
35
|
+
let returned: string;
|
|
36
|
+
let loading: string;
|
|
37
|
+
let shoppingBag: string;
|
|
38
|
+
let reservationQueue: string;
|
|
39
|
+
let reserved: string;
|
|
40
|
+
let booked: string;
|
|
41
|
+
let open: string;
|
|
42
|
+
let hidden: string;
|
|
43
43
|
}
|
|
44
44
|
export namespace PRODUCT_STATES {
|
|
45
|
-
|
|
45
|
+
let archived_1: string;
|
|
46
46
|
export { archived_1 as archived };
|
|
47
|
-
|
|
47
|
+
let sellerDonated_1: string;
|
|
48
48
|
export { sellerDonated_1 as sellerDonated };
|
|
49
|
-
|
|
49
|
+
let sellRequestReview_1: string;
|
|
50
50
|
export { sellRequestReview_1 as sellRequestReview };
|
|
51
|
-
|
|
51
|
+
let sellRequestReviewDraft_1: string;
|
|
52
52
|
export { sellRequestReviewDraft_1 as sellRequestReviewDraft };
|
|
53
|
-
|
|
53
|
+
let sellerToDropOff_1: string;
|
|
54
54
|
export { sellerToDropOff_1 as sellerToDropOff };
|
|
55
|
-
|
|
55
|
+
let sellerToShip_1: string;
|
|
56
56
|
export { sellerToShip_1 as sellerToShip };
|
|
57
|
-
|
|
57
|
+
let sellerToGetPickUp_1: string;
|
|
58
58
|
export { sellerToGetPickUp_1 as sellerToGetPickUp };
|
|
59
|
-
|
|
59
|
+
let sellerSelfReject_1: string;
|
|
60
60
|
export { sellerSelfReject_1 as sellerSelfReject };
|
|
61
|
-
|
|
61
|
+
let liquidationRequested_1: string;
|
|
62
62
|
export { liquidationRequested_1 as liquidationRequested };
|
|
63
|
-
|
|
63
|
+
let rejected_1: string;
|
|
64
64
|
export { rejected_1 as rejected };
|
|
65
|
-
|
|
65
|
+
let hold_1: string;
|
|
66
66
|
export { hold_1 as hold };
|
|
67
|
-
|
|
67
|
+
let draft_1: string;
|
|
68
68
|
export { draft_1 as draft };
|
|
69
|
-
|
|
69
|
+
let accepted_1: string;
|
|
70
70
|
export { accepted_1 as accepted };
|
|
71
|
-
|
|
71
|
+
let qualityControl_1: string;
|
|
72
72
|
export { qualityControl_1 as qualityControl };
|
|
73
|
-
|
|
73
|
+
let pendingPublication_1: string;
|
|
74
74
|
export { pendingPublication_1 as pendingPublication };
|
|
75
|
-
|
|
75
|
+
let merchantDonated_1: string;
|
|
76
76
|
export { merchantDonated_1 as merchantDonated };
|
|
77
|
-
|
|
77
|
+
let listed_1: string;
|
|
78
78
|
export { listed_1 as listed };
|
|
79
|
-
|
|
79
|
+
let clearance_1: string;
|
|
80
80
|
export { clearance_1 as clearance };
|
|
81
|
-
|
|
81
|
+
let soldSellerToBePaid_1: string;
|
|
82
82
|
export { soldSellerToBePaid_1 as soldSellerToBePaid };
|
|
83
|
-
|
|
83
|
+
let soldSellerPaid_1: string;
|
|
84
84
|
export { soldSellerPaid_1 as soldSellerPaid };
|
|
85
|
-
|
|
85
|
+
let liquidationReady_1: string;
|
|
86
86
|
export { liquidationReady_1 as liquidationReady };
|
|
87
|
-
|
|
87
|
+
let sellerLiquidated_1: string;
|
|
88
88
|
export { sellerLiquidated_1 as sellerLiquidated };
|
|
89
|
-
|
|
89
|
+
let availableInStore_1: string;
|
|
90
90
|
export { availableInStore_1 as availableInStore };
|
|
91
|
-
|
|
91
|
+
let sold_1: string;
|
|
92
92
|
export { sold_1 as sold };
|
|
93
|
-
|
|
93
|
+
let returned_1: string;
|
|
94
94
|
export { returned_1 as returned };
|
|
95
|
-
|
|
95
|
+
let loading_1: string;
|
|
96
96
|
export { loading_1 as loading };
|
|
97
|
-
|
|
97
|
+
let shoppingBag_1: string;
|
|
98
98
|
export { shoppingBag_1 as shoppingBag };
|
|
99
|
-
|
|
99
|
+
let reservationQueue_1: string;
|
|
100
100
|
export { reservationQueue_1 as reservationQueue };
|
|
101
|
-
|
|
101
|
+
let reserved_1: string;
|
|
102
102
|
export { reserved_1 as reserved };
|
|
103
|
-
|
|
103
|
+
let soldSellerSelfPay_1: string;
|
|
104
104
|
export { soldSellerSelfPay_1 as soldSellerSelfPay };
|
|
105
|
-
|
|
105
|
+
let soldSellerPayoutProcessing_1: string;
|
|
106
106
|
export { soldSellerPayoutProcessing_1 as soldSellerPayoutProcessing };
|
|
107
|
-
|
|
107
|
+
let soldSellerPayoutFailed_1: string;
|
|
108
108
|
export { soldSellerPayoutFailed_1 as soldSellerPayoutFailed };
|
|
109
|
-
|
|
109
|
+
let hidden_1: string;
|
|
110
110
|
export { hidden_1 as hidden };
|
|
111
|
-
|
|
111
|
+
let booked_1: string;
|
|
112
112
|
export { booked_1 as booked };
|
|
113
|
-
|
|
113
|
+
let open_1: string;
|
|
114
114
|
export { open_1 as open };
|
|
115
115
|
}
|
|
116
116
|
export namespace ADMIN_SIMPLIFIED_STATES {
|
|
117
|
-
|
|
117
|
+
let draft_2: string;
|
|
118
118
|
export { draft_2 as draft };
|
|
119
|
-
|
|
119
|
+
let pendingPublication_2: string;
|
|
120
120
|
export { pendingPublication_2 as pendingPublication };
|
|
121
|
-
|
|
121
|
+
let listed_2: string;
|
|
122
122
|
export { listed_2 as listed };
|
|
123
123
|
}
|
|
124
124
|
export namespace PRODUCT_STATE_LABELS {
|
|
125
|
-
|
|
125
|
+
let archived_2: string;
|
|
126
126
|
export { archived_2 as archived };
|
|
127
|
-
|
|
127
|
+
let sellRequestReview_2: string;
|
|
128
128
|
export { sellRequestReview_2 as sellRequestReview };
|
|
129
|
-
|
|
129
|
+
let sellRequestReviewDraft_2: string;
|
|
130
130
|
export { sellRequestReviewDraft_2 as sellRequestReviewDraft };
|
|
131
|
-
|
|
131
|
+
let rejected_2: string;
|
|
132
132
|
export { rejected_2 as rejected };
|
|
133
|
-
|
|
133
|
+
let draft_3: string;
|
|
134
134
|
export { draft_3 as draft };
|
|
135
|
-
|
|
135
|
+
let accepted_2: string;
|
|
136
136
|
export { accepted_2 as accepted };
|
|
137
|
-
|
|
137
|
+
let sellerToDropOff_2: string;
|
|
138
138
|
export { sellerToDropOff_2 as sellerToDropOff };
|
|
139
|
-
|
|
139
|
+
let sellerToShip_2: string;
|
|
140
140
|
export { sellerToShip_2 as sellerToShip };
|
|
141
|
-
|
|
141
|
+
let sellerToGetPickUp_2: string;
|
|
142
142
|
export { sellerToGetPickUp_2 as sellerToGetPickUp };
|
|
143
|
-
|
|
143
|
+
let qualityControl_2: string;
|
|
144
144
|
export { qualityControl_2 as qualityControl };
|
|
145
|
-
|
|
145
|
+
let pendingPublication_3: string;
|
|
146
146
|
export { pendingPublication_3 as pendingPublication };
|
|
147
|
-
|
|
147
|
+
let listed_3: string;
|
|
148
148
|
export { listed_3 as listed };
|
|
149
|
-
|
|
149
|
+
let hold_2: string;
|
|
150
150
|
export { hold_2 as hold };
|
|
151
|
-
|
|
151
|
+
let clearance_2: string;
|
|
152
152
|
export { clearance_2 as clearance };
|
|
153
|
-
|
|
153
|
+
let reserved_2: string;
|
|
154
154
|
export { reserved_2 as reserved };
|
|
155
|
-
|
|
155
|
+
let sold_2: string;
|
|
156
156
|
export { sold_2 as sold };
|
|
157
|
-
|
|
157
|
+
let returned_2: string;
|
|
158
158
|
export { returned_2 as returned };
|
|
159
|
-
|
|
159
|
+
let soldSellerToBePaid_2: string;
|
|
160
160
|
export { soldSellerToBePaid_2 as soldSellerToBePaid };
|
|
161
|
-
|
|
161
|
+
let soldSellerPaid_2: string;
|
|
162
162
|
export { soldSellerPaid_2 as soldSellerPaid };
|
|
163
|
-
|
|
163
|
+
let sellerSelfReject_2: string;
|
|
164
164
|
export { sellerSelfReject_2 as sellerSelfReject };
|
|
165
|
-
|
|
165
|
+
let liquidationRequested_2: string;
|
|
166
166
|
export { liquidationRequested_2 as liquidationRequested };
|
|
167
|
-
|
|
167
|
+
let liquidationReady_2: string;
|
|
168
168
|
export { liquidationReady_2 as liquidationReady };
|
|
169
|
-
|
|
169
|
+
let sellerLiquidated_2: string;
|
|
170
170
|
export { sellerLiquidated_2 as sellerLiquidated };
|
|
171
|
-
|
|
171
|
+
let loading_2: string;
|
|
172
172
|
export { loading_2 as loading };
|
|
173
|
-
|
|
173
|
+
let shoppingBag_2: string;
|
|
174
174
|
export { shoppingBag_2 as shoppingBag };
|
|
175
|
-
|
|
175
|
+
let reservationQueue_2: string;
|
|
176
176
|
export { reservationQueue_2 as reservationQueue };
|
|
177
|
-
|
|
177
|
+
let availableInStore_2: string;
|
|
178
178
|
export { availableInStore_2 as availableInStore };
|
|
179
|
-
|
|
179
|
+
let sellerDonated_2: string;
|
|
180
180
|
export { sellerDonated_2 as sellerDonated };
|
|
181
|
-
|
|
181
|
+
let merchantDonated_2: string;
|
|
182
182
|
export { merchantDonated_2 as merchantDonated };
|
|
183
|
-
|
|
183
|
+
let soldSellerSelfPay_2: string;
|
|
184
184
|
export { soldSellerSelfPay_2 as soldSellerSelfPay };
|
|
185
|
-
|
|
185
|
+
let soldSellerPayoutProcessing_2: string;
|
|
186
186
|
export { soldSellerPayoutProcessing_2 as soldSellerPayoutProcessing };
|
|
187
|
-
|
|
187
|
+
let soldSellerPayoutFailed_2: string;
|
|
188
188
|
export { soldSellerPayoutFailed_2 as soldSellerPayoutFailed };
|
|
189
|
-
|
|
189
|
+
let hidden_2: string;
|
|
190
190
|
export { hidden_2 as hidden };
|
|
191
|
-
|
|
191
|
+
let booked_2: string;
|
|
192
192
|
export { booked_2 as booked };
|
|
193
|
-
|
|
193
|
+
let open_2: string;
|
|
194
194
|
export { open_2 as open };
|
|
195
195
|
}
|
|
196
196
|
export namespace PRODUCT_STATE_LABELS_ADMIN_VIEW {
|
|
197
|
-
|
|
197
|
+
let archived_3: string;
|
|
198
198
|
export { archived_3 as archived };
|
|
199
|
-
|
|
199
|
+
let sellRequestReview_3: string;
|
|
200
200
|
export { sellRequestReview_3 as sellRequestReview };
|
|
201
|
-
|
|
201
|
+
let sellRequestReviewDraft_3: string;
|
|
202
202
|
export { sellRequestReviewDraft_3 as sellRequestReviewDraft };
|
|
203
|
-
|
|
203
|
+
let rejected_3: string;
|
|
204
204
|
export { rejected_3 as rejected };
|
|
205
|
-
|
|
205
|
+
let draft_4: string;
|
|
206
206
|
export { draft_4 as draft };
|
|
207
|
-
|
|
207
|
+
let accepted_3: string;
|
|
208
208
|
export { accepted_3 as accepted };
|
|
209
|
-
|
|
209
|
+
let sellerToDropOff_3: string;
|
|
210
210
|
export { sellerToDropOff_3 as sellerToDropOff };
|
|
211
|
-
|
|
211
|
+
let sellerToShip_3: string;
|
|
212
212
|
export { sellerToShip_3 as sellerToShip };
|
|
213
|
-
|
|
213
|
+
let sellerToGetPickUp_3: string;
|
|
214
214
|
export { sellerToGetPickUp_3 as sellerToGetPickUp };
|
|
215
|
-
|
|
215
|
+
let qualityControl_3: string;
|
|
216
216
|
export { qualityControl_3 as qualityControl };
|
|
217
|
-
|
|
217
|
+
let pendingPublication_4: string;
|
|
218
218
|
export { pendingPublication_4 as pendingPublication };
|
|
219
|
-
|
|
219
|
+
let listed_4: string;
|
|
220
220
|
export { listed_4 as listed };
|
|
221
|
-
|
|
221
|
+
let hold_3: string;
|
|
222
222
|
export { hold_3 as hold };
|
|
223
|
-
|
|
223
|
+
let clearance_3: string;
|
|
224
224
|
export { clearance_3 as clearance };
|
|
225
|
-
|
|
225
|
+
let reserved_3: string;
|
|
226
226
|
export { reserved_3 as reserved };
|
|
227
|
-
|
|
227
|
+
let sold_3: string;
|
|
228
228
|
export { sold_3 as sold };
|
|
229
|
-
|
|
229
|
+
let returned_3: string;
|
|
230
230
|
export { returned_3 as returned };
|
|
231
|
-
|
|
231
|
+
let soldSellerToBePaid_3: string;
|
|
232
232
|
export { soldSellerToBePaid_3 as soldSellerToBePaid };
|
|
233
|
-
|
|
233
|
+
let soldSellerPaid_3: string;
|
|
234
234
|
export { soldSellerPaid_3 as soldSellerPaid };
|
|
235
|
-
|
|
235
|
+
let sellerSelfReject_3: string;
|
|
236
236
|
export { sellerSelfReject_3 as sellerSelfReject };
|
|
237
|
-
|
|
237
|
+
let liquidationRequested_3: string;
|
|
238
238
|
export { liquidationRequested_3 as liquidationRequested };
|
|
239
|
-
|
|
239
|
+
let liquidationReady_3: string;
|
|
240
240
|
export { liquidationReady_3 as liquidationReady };
|
|
241
|
-
|
|
241
|
+
let sellerLiquidated_3: string;
|
|
242
242
|
export { sellerLiquidated_3 as sellerLiquidated };
|
|
243
|
-
|
|
243
|
+
let loading_3: string;
|
|
244
244
|
export { loading_3 as loading };
|
|
245
|
-
|
|
245
|
+
let shoppingBag_3: string;
|
|
246
246
|
export { shoppingBag_3 as shoppingBag };
|
|
247
|
-
|
|
247
|
+
let reservationQueue_3: string;
|
|
248
248
|
export { reservationQueue_3 as reservationQueue };
|
|
249
|
-
|
|
249
|
+
let availableInStore_3: string;
|
|
250
250
|
export { availableInStore_3 as availableInStore };
|
|
251
|
-
|
|
251
|
+
let sellerDonated_3: string;
|
|
252
252
|
export { sellerDonated_3 as sellerDonated };
|
|
253
|
-
|
|
253
|
+
let merchantDonated_3: string;
|
|
254
254
|
export { merchantDonated_3 as merchantDonated };
|
|
255
|
-
|
|
255
|
+
let soldSellerSelfPay_3: string;
|
|
256
256
|
export { soldSellerSelfPay_3 as soldSellerSelfPay };
|
|
257
|
-
|
|
257
|
+
let soldSellerPayoutProcessing_3: string;
|
|
258
258
|
export { soldSellerPayoutProcessing_3 as soldSellerPayoutProcessing };
|
|
259
|
-
|
|
259
|
+
let soldSellerPayoutFailed_3: string;
|
|
260
260
|
export { soldSellerPayoutFailed_3 as soldSellerPayoutFailed };
|
|
261
|
-
|
|
261
|
+
let hidden_3: string;
|
|
262
262
|
export { hidden_3 as hidden };
|
|
263
|
-
|
|
263
|
+
let booked_3: string;
|
|
264
264
|
export { booked_3 as booked };
|
|
265
|
-
|
|
265
|
+
let open_3: string;
|
|
266
266
|
export { open_3 as open };
|
|
267
267
|
}
|
|
268
268
|
export namespace MEASUREMENT_CATEGORY {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
269
|
+
let SuitsNBlazers: string;
|
|
270
|
+
let Bottoms: string;
|
|
271
|
+
let Shirts: string;
|
|
272
|
+
let Shoes: string;
|
|
273
|
+
let Accessories: string;
|
|
274
|
+
let Coats: string;
|
|
275
|
+
let Dresses: string;
|
|
276
|
+
let Hats: string;
|
|
277
|
+
let Gloves: string;
|
|
278
|
+
let Eyewear: string;
|
|
279
|
+
let GeneralItems: string;
|
|
280
280
|
}
|
|
281
281
|
export namespace MEASUREMENT_FIELDS_DICT {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
282
|
+
let length: string;
|
|
283
|
+
let width: string;
|
|
284
|
+
let height: string;
|
|
285
|
+
let depth: string;
|
|
286
|
+
let lensWidth: string;
|
|
287
|
+
let bridgeWidth: string;
|
|
288
|
+
let templeLength: string;
|
|
289
|
+
let handLength: string;
|
|
290
|
+
let handCircumference: string;
|
|
291
|
+
let fingerLength: string;
|
|
292
|
+
let headCircumference: string;
|
|
293
|
+
let brimWidth: string;
|
|
294
|
+
let crownHeight: string;
|
|
295
|
+
let bustCircumference: string;
|
|
296
|
+
let waistCircumference: string;
|
|
297
|
+
let hipCircumference: string;
|
|
298
|
+
let shoulderWidth: string;
|
|
299
|
+
let sleeveLength: string;
|
|
300
|
+
let footLength: string;
|
|
301
|
+
let footWidth: string;
|
|
302
|
+
let heelHeight: string;
|
|
303
|
+
let shaftHeight: string;
|
|
304
|
+
let calfCircumference: string;
|
|
305
|
+
let chestCircumference: string;
|
|
306
|
+
let neckCircumference: string;
|
|
307
|
+
let collarLength: string;
|
|
308
|
+
let innerLeg: string;
|
|
309
|
+
let outerLeg: string;
|
|
310
|
+
let footCircumference: string;
|
|
311
|
+
let handDrop: string;
|
|
312
|
+
let shoulderDrop: string;
|
|
313
313
|
}
|
|
314
314
|
export namespace PUBLISH_TYPE {
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
let USER_PUBLISHED: string;
|
|
316
|
+
let MERCHANT_PUBLISHED: string;
|
|
317
317
|
}
|
|
318
318
|
export namespace PAYOUT_METHOD {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
319
|
+
let CASH: string;
|
|
320
|
+
let STORE_CREDIT: string;
|
|
321
|
+
let RIBBN_CREDITS: string;
|
|
322
322
|
}
|
|
323
323
|
export namespace PAYOUT_SYSTEM {
|
|
324
|
-
export
|
|
325
|
-
export
|
|
326
|
-
|
|
324
|
+
export let STRIPE: string;
|
|
325
|
+
export let MANUAL_TRANSFER: string;
|
|
326
|
+
let RIBBN_CREDITS_1: string;
|
|
327
327
|
export { RIBBN_CREDITS_1 as RIBBN_CREDITS };
|
|
328
328
|
}
|
|
329
329
|
export const ADMIN_STATES: {};
|
|
@@ -111,9 +111,9 @@ exports.PRODUCT_STATE_LABELS = {
|
|
|
111
111
|
liquidationReady: 'Ready to take back',
|
|
112
112
|
sellerLiquidated: "You've taken back",
|
|
113
113
|
loading: 'Loading',
|
|
114
|
-
shoppingBag: 'In a shopping bag',
|
|
115
|
-
reservationQueue: 'In waiting list',
|
|
116
|
-
availableInStore: 'Listed for sale in store',
|
|
114
|
+
shoppingBag: 'In a shopping bag', // TODO: DEPRECATE
|
|
115
|
+
reservationQueue: 'In waiting list', // TODO: DEPRECATE
|
|
116
|
+
availableInStore: 'Listed for sale in store', // TODO: DEPRECATE
|
|
117
117
|
sellerDonated: 'Donated by you',
|
|
118
118
|
merchantDonated: 'Donated by merchant',
|
|
119
119
|
soldSellerSelfPay: 'Sold - awaiting self payout',
|
|
@@ -17,8 +17,8 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
17
17
|
price: props.fields.price.inputValue,
|
|
18
18
|
isTaxable: props.fields.isTaxable.selectedValue,
|
|
19
19
|
productClass: props.fields.productClass.selectedValue,
|
|
20
|
-
createdAt: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.createdAt) || new Date().toUTCString(),
|
|
21
|
-
updatedAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.updatedAt) || new Date().toUTCString(),
|
|
20
|
+
createdAt: ((_e = props.props) === null || _e === void 0 ? void 0 : _e.createdAt) || new Date().toUTCString(), // ToDo look into different timestamp
|
|
21
|
+
updatedAt: ((_f = props.props) === null || _f === void 0 ? void 0 : _f.updatedAt) || new Date().toUTCString(), // ToDo look into different timestamp
|
|
22
22
|
publishedAt: ((_g = props.props) === null || _g === void 0 ? void 0 : _g.publishedAt) || new Date().toUTCString(),
|
|
23
23
|
vendorId: props.fields.vendorId.selectedValue || ((_h = props.props) === null || _h === void 0 ? void 0 : _h.vendorId) || '',
|
|
24
24
|
vendorName: props.fields.vendorName.selectedValue || '',
|
|
@@ -87,8 +87,8 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
87
87
|
selectedForClearance: ((_v = props.props) === null || _v === void 0 ? void 0 : _v.selectedForClearance) || '',
|
|
88
88
|
locationIds: props.fields.locationIds.selectedValues || [],
|
|
89
89
|
inventoryLocations: props.fields.inventoryLocations.selectedValues || [],
|
|
90
|
-
majorDefects: props.fields.majorDefects.selectedValues || [],
|
|
91
|
-
minorDefects: props.fields.minorDefects.selectedValues || [],
|
|
90
|
+
majorDefects: props.fields.majorDefects.selectedValues || [], // ToDo: Deprecate
|
|
91
|
+
minorDefects: props.fields.minorDefects.selectedValues || [], // ToDo: Deprecate
|
|
92
92
|
careInstructions: props.fields.careInstructions.inputValue || '',
|
|
93
93
|
};
|
|
94
94
|
const timestampAttributes = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createHash =
|
|
3
|
+
exports.createHash = createHash;
|
|
4
4
|
const CryptoJS = require("crypto-js");
|
|
5
5
|
/**
|
|
6
6
|
* Polyfill for Node.js crypto module to work in React Native environments
|
|
@@ -43,4 +43,3 @@ function createHash(algorithm) {
|
|
|
43
43
|
},
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
exports.createHash = createHash;
|
|
@@ -446,7 +446,7 @@ class OrderHelpers {
|
|
|
446
446
|
creditDiscountPresentment: prepareMoneyObj(creditDiscountAmount),
|
|
447
447
|
additionalDiscountPresentment: prepareMoneyObj(additionalDiscount),
|
|
448
448
|
lineItems,
|
|
449
|
-
subtotalPricePresentment: prepareMoneyObj(subTotalWithSalePriceIncluded),
|
|
449
|
+
subtotalPricePresentment: prepareMoneyObj(subTotalWithSalePriceIncluded), // This is sum of items with sale prices included minus credits minus additional discount. Calculated with getSubtotalWithSalePriceIncluded()
|
|
450
450
|
totalDiscountPresentment: prepareMoneyObj(creditDiscountAmount + additionalDiscount),
|
|
451
451
|
totalShippingPricePresentment: prepareMoneyObj(shippingPrice),
|
|
452
452
|
itemsTaxPresentment: prepareMoneyObj(itemsTax),
|
|
@@ -486,7 +486,7 @@ class OrderHelpers {
|
|
|
486
486
|
saleDiscountPresentment: prepareMoneyObj(saleDiscountPresentmentAmount),
|
|
487
487
|
creditDiscountPresentment: prepareMoneyObj(creditDiscountPresentmentAmount),
|
|
488
488
|
additionalDiscountPresentment: prepareMoneyObj(additionalDiscountPresentmentAmount),
|
|
489
|
-
subtotalPricePresentment: prepareMoneyObj(subtotalPricePresentmentAmount),
|
|
489
|
+
subtotalPricePresentment: prepareMoneyObj(subtotalPricePresentmentAmount), // This is sum of items with sale prices included minus credits minus additional discount
|
|
490
490
|
totalDiscountPresentment: prepareMoneyObj(Number(creditDiscountPresentmentAmount) + Number(additionalDiscountPresentmentAmount)),
|
|
491
491
|
totalShippingPricePresentment: prepareMoneyObj(totalShippingPricePresentmentAmount),
|
|
492
492
|
totalPricePresentment: prepareMoneyObj(Number(subtotalPricePresentmentAmount) + Number(totalShippingPricePresentmentAmount)),
|
|
@@ -8,7 +8,7 @@ class SellerProductLedgerHelpers {
|
|
|
8
8
|
return {
|
|
9
9
|
documentId: utilities.makeRandId(28),
|
|
10
10
|
timestamp: Date.now(),
|
|
11
|
-
sellerProductLedgerId: payload.sellerProductLedgerId || '',
|
|
11
|
+
sellerProductLedgerId: payload.sellerProductLedgerId || '', // There should always be a sellerProductLedgerId
|
|
12
12
|
action: (payload === null || payload === void 0 ? void 0 : payload.action) || SellerProductLedgerActivityLogAction.STATUS_CHANGED_TO_PENDING_RETURN_PERIOD_COMPLETION,
|
|
13
13
|
details: (payload === null || payload === void 0 ? void 0 : payload.details) || '',
|
|
14
14
|
actorId: (payload === null || payload === void 0 ? void 0 : payload.actorId) || 'system',
|
package/lib/helpers/Utilities.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getPresentmentLocaleByCurrencyCode = getPresentmentLocaleByCurrencyCode;
|
|
4
|
+
exports.convertAddressInputToFormatted = convertAddressInputToFormatted;
|
|
5
|
+
exports.formatPrice = formatPrice;
|
|
6
|
+
exports.getFormattedTimestamp = getFormattedTimestamp;
|
|
7
|
+
exports.capitalizeString = capitalizeString;
|
|
8
|
+
exports.singularizeProductType = singularizeProductType;
|
|
4
9
|
// @ts-ignore
|
|
5
10
|
const lodash_1 = require("lodash");
|
|
6
11
|
class Utilities {
|
|
@@ -207,7 +212,6 @@ function getPresentmentLocaleByCurrencyCode(currencyCode) {
|
|
|
207
212
|
}
|
|
208
213
|
return presentmentLocale;
|
|
209
214
|
}
|
|
210
|
-
exports.getPresentmentLocaleByCurrencyCode = getPresentmentLocaleByCurrencyCode;
|
|
211
215
|
function convertAddressInputToFormatted(address) {
|
|
212
216
|
if (!address) {
|
|
213
217
|
return '';
|
|
@@ -219,27 +223,23 @@ function convertAddressInputToFormatted(address) {
|
|
|
219
223
|
const formattedAddress = `${address1}${address2 ? `\n${address2}` : ''}\n${city}${province ? `, ${province}` : ''}, ${zip}, ${country}`;
|
|
220
224
|
return formattedAddress;
|
|
221
225
|
}
|
|
222
|
-
exports.convertAddressInputToFormatted = convertAddressInputToFormatted;
|
|
223
226
|
function formatPrice({ currencyCode, amount, fractionDigits = 2, }) {
|
|
224
227
|
const presentmentLocale = getPresentmentLocaleByCurrencyCode(currencyCode);
|
|
225
228
|
const priceFormatter = initFormatter(presentmentLocale, currencyCode);
|
|
226
229
|
const valueToFormat = Number(parseFloat(String(amount)).toFixed(fractionDigits));
|
|
227
230
|
return priceFormatter.format(valueToFormat);
|
|
228
231
|
}
|
|
229
|
-
exports.formatPrice = formatPrice;
|
|
230
232
|
function getFormattedTimestamp(locale, timestamp) {
|
|
231
233
|
const date = timestamp ? new Date(timestamp) : new Date();
|
|
232
234
|
const hours = String(date.getHours()).padStart(2, '0');
|
|
233
235
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
234
236
|
return `${date.toLocaleDateString(locale)} ${hours}:${minutes}`;
|
|
235
237
|
}
|
|
236
|
-
exports.getFormattedTimestamp = getFormattedTimestamp;
|
|
237
238
|
function capitalizeString(s) {
|
|
238
239
|
if (typeof s !== 'string')
|
|
239
240
|
return '';
|
|
240
241
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
241
242
|
}
|
|
242
|
-
exports.capitalizeString = capitalizeString;
|
|
243
243
|
function singularizeProductType(word) {
|
|
244
244
|
const irregulars = {
|
|
245
245
|
Blazers: 'Blazer',
|
|
@@ -269,4 +269,3 @@ function singularizeProductType(word) {
|
|
|
269
269
|
}
|
|
270
270
|
return word;
|
|
271
271
|
}
|
|
272
|
-
exports.singularizeProductType = singularizeProductType;
|
package/lib/models/Merchant.js
CHANGED
|
@@ -157,7 +157,6 @@ class Merchant extends Base_1.default {
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
exports.default = Merchant;
|
|
161
160
|
Merchant.MERCHANT_TYPES = merchant_constants_1.MERCHANT_TYPES;
|
|
162
161
|
Merchant.PAYMENT_TIERS = merchant_constants_1.PAYMENT_TIERS;
|
|
163
162
|
Merchant.INDUSTRY_TYPES = merchant_constants_1.INDUSTRY_TYPES;
|
|
@@ -165,3 +164,4 @@ Merchant.UNIT_SYSTEM_TYPES = merchant_constants_1.UNIT_SYSTEM_TYPES;
|
|
|
165
164
|
Merchant.METRIC_WEIGHT_TYPES = merchant_constants_1.METRIC_WEIGHT_TYPES;
|
|
166
165
|
Merchant.IMPERIAL_WEIGHT_TYPES = merchant_constants_1.IMPERIAL_WEIGHT_TYPES;
|
|
167
166
|
Merchant.RIBBN_WEBHOOK_EVENT_DICT = merchant_constants_1.RIBBN_WEBHOOK_EVENT_DICT;
|
|
167
|
+
exports.default = Merchant;
|
package/lib/models/Order.js
CHANGED
|
@@ -418,10 +418,10 @@ class Order extends Base_1.default {
|
|
|
418
418
|
return stagedObj;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
exports.default = Order;
|
|
422
421
|
Order.SHIPPING_TYPES = order_constants_1.SHIPPING_TYPES;
|
|
423
422
|
Order.PAYMENT_TYPES = order_constants_1.PAYMENT_TYPES;
|
|
424
423
|
Order.ORDER_STATES = order_constants_1.ORDER_STATES;
|
|
425
424
|
Order.SALES_CHANNELS = order_constants_1.SALES_CHANNELS;
|
|
426
425
|
Order.FULFILLMENT_TYPES = order_constants_1.FULFILLMENT_TYPES;
|
|
427
426
|
Order.FINANCIAL_TYPES = order_constants_1.FINANCIAL_TYPES;
|
|
427
|
+
exports.default = Order;
|
|
@@ -57,7 +57,6 @@ class PayoutAccount extends Base_1.default {
|
|
|
57
57
|
return '';
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
exports.default = PayoutAccount;
|
|
61
60
|
PayoutAccount.PAYOUT_TYPES = {
|
|
62
61
|
bankTransfer: 'bank-transfer',
|
|
63
62
|
paypal: 'paypal',
|
|
@@ -65,3 +64,4 @@ PayoutAccount.PAYOUT_TYPES = {
|
|
|
65
64
|
mobileMoney: 'mobile-money',
|
|
66
65
|
debitCard: 'debit-card',
|
|
67
66
|
};
|
|
67
|
+
exports.default = PayoutAccount;
|
package/lib/models/Product.js
CHANGED
|
@@ -47,9 +47,9 @@ class Product extends Base_1.default {
|
|
|
47
47
|
brand: (props === null || props === void 0 ? void 0 : props.brand) || '',
|
|
48
48
|
color: (props === null || props === void 0 ? void 0 : props.color) || '',
|
|
49
49
|
gender: (props === null || props === void 0 ? void 0 : props.gender) || '',
|
|
50
|
-
clothingSize: (props === null || props === void 0 ? void 0 : props.clothingSize) || [],
|
|
51
|
-
jeanSize: (props === null || props === void 0 ? void 0 : props.jeanSize) || '',
|
|
52
|
-
shoeSize: (props === null || props === void 0 ? void 0 : props.shoeSize) || '',
|
|
50
|
+
clothingSize: (props === null || props === void 0 ? void 0 : props.clothingSize) || [], // Will be deprecated in a future release
|
|
51
|
+
jeanSize: (props === null || props === void 0 ? void 0 : props.jeanSize) || '', // Will be deprecated in a future release
|
|
52
|
+
shoeSize: (props === null || props === void 0 ? void 0 : props.shoeSize) || '', // Will be deprecated in a future release
|
|
53
53
|
size: (props === null || props === void 0 ? void 0 : props.size) || '',
|
|
54
54
|
standardSize: this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.standardSize) || '',
|
|
55
55
|
internationalSize: this.utilities.sanitizeString(props === null || props === void 0 ? void 0 : props.internationalSize) || '',
|
|
@@ -90,8 +90,8 @@ class Product extends Base_1.default {
|
|
|
90
90
|
selectedForClearance: (props === null || props === void 0 ? void 0 : props.selectedForClearance) || '',
|
|
91
91
|
locationIds: (props === null || props === void 0 ? void 0 : props.locationIds) || [],
|
|
92
92
|
inventoryLocations: this.validateInventoryLocation(props === null || props === void 0 ? void 0 : props.inventoryLocations) || [],
|
|
93
|
-
majorDefects: (props === null || props === void 0 ? void 0 : props.majorDefects) || [],
|
|
94
|
-
minorDefects: (props === null || props === void 0 ? void 0 : props.minorDefects) || [],
|
|
93
|
+
majorDefects: (props === null || props === void 0 ? void 0 : props.majorDefects) || [], // ToDo: Deprecate
|
|
94
|
+
minorDefects: (props === null || props === void 0 ? void 0 : props.minorDefects) || [], // ToDo: Deprecate,
|
|
95
95
|
careInstructions: (props === null || props === void 0 ? void 0 : props.careInstructions) || '',
|
|
96
96
|
};
|
|
97
97
|
this.timestampAttributes = {
|
|
@@ -151,7 +151,11 @@ class Product extends Base_1.default {
|
|
|
151
151
|
return Object.assign(Object.assign({}, this.attributes), this.filterAttributes);
|
|
152
152
|
} // ToDo: Deprecate soon
|
|
153
153
|
toObj() {
|
|
154
|
-
|
|
154
|
+
const obj = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.attributes), this.filterAttributes), this.consignmentAttributes), this.timestampAttributes), this.payoutAttributes);
|
|
155
|
+
if ((obj === null || obj === void 0 ? void 0 : obj.inventoryLocations) && Array.isArray(obj.inventoryLocations)) {
|
|
156
|
+
obj.inventoryLocations = obj.inventoryLocations.map((loc) => (Object.assign(Object.assign({}, loc), { availableAmount: Number(loc === null || loc === void 0 ? void 0 : loc.availableAmount) || 0, incomingAmount: Number(loc === null || loc === void 0 ? void 0 : loc.incomingAmount) || 0 })));
|
|
157
|
+
}
|
|
158
|
+
return obj;
|
|
155
159
|
}
|
|
156
160
|
toProductInputObjForShopify(location) {
|
|
157
161
|
const productInputObj = {
|
|
@@ -263,7 +267,7 @@ class Product extends Base_1.default {
|
|
|
263
267
|
},
|
|
264
268
|
sku: this.attributes.sku,
|
|
265
269
|
price: this.attributes.price || '0',
|
|
266
|
-
taxable: false,
|
|
270
|
+
taxable: false, // ToDo: Add this back in
|
|
267
271
|
weight: parseFloat(this.attributes.weight) || parseFloat('999'),
|
|
268
272
|
weightUnit: weightUnit || 'GRAMS',
|
|
269
273
|
},
|
|
@@ -409,8 +413,8 @@ class Product extends Base_1.default {
|
|
|
409
413
|
Array.isArray((_b = this.consignmentAttributes) === null || _b === void 0 ? void 0 : _b.inventoryLocations)) {
|
|
410
414
|
this.consignmentAttributes.inventoryLocations.forEach((l) => {
|
|
411
415
|
if (l.id) {
|
|
412
|
-
stagedObj[`inventoryLocations.${l.id}.availableAmount`] = (l === null || l === void 0 ? void 0 : l.availableAmount) || 0;
|
|
413
|
-
stagedObj[`inventoryLocations.${l.id}.incomingAmount`] = (l === null || l === void 0 ? void 0 : l.incomingAmount) || 0;
|
|
416
|
+
stagedObj[`inventoryLocations.${l.id}.availableAmount`] = Number(l === null || l === void 0 ? void 0 : l.availableAmount) || 0;
|
|
417
|
+
stagedObj[`inventoryLocations.${l.id}.incomingAmount`] = Number(l === null || l === void 0 ? void 0 : l.incomingAmount) || 0;
|
|
414
418
|
}
|
|
415
419
|
});
|
|
416
420
|
}
|
|
@@ -1171,8 +1175,8 @@ class Product extends Base_1.default {
|
|
|
1171
1175
|
return {
|
|
1172
1176
|
id: v.id,
|
|
1173
1177
|
name: v.name,
|
|
1174
|
-
availableAmount: (v === null || v === void 0 ? void 0 : v.availableAmount) || 0,
|
|
1175
|
-
incomingAmount: (v === null || v === void 0 ? void 0 : v.incomingAmount) || 0,
|
|
1178
|
+
availableAmount: Number(v === null || v === void 0 ? void 0 : v.availableAmount) || 0,
|
|
1179
|
+
incomingAmount: Number(v === null || v === void 0 ? void 0 : v.incomingAmount) || 0,
|
|
1176
1180
|
};
|
|
1177
1181
|
});
|
|
1178
1182
|
}
|
|
@@ -29,7 +29,7 @@ class ProductCollection extends Base_1.default {
|
|
|
29
29
|
subTitle: this.subTitle,
|
|
30
30
|
description: this.description,
|
|
31
31
|
type: this.type,
|
|
32
|
-
imgUrl: this.imgUrl,
|
|
32
|
+
imgUrl: this.imgUrl, // deprecate soon, will be migrated into imageUrls
|
|
33
33
|
refinements: this.refinements,
|
|
34
34
|
tags: this.tags,
|
|
35
35
|
collectionId: this.collectionId,
|
|
@@ -207,7 +207,7 @@ class ProductCollection extends Base_1.default {
|
|
|
207
207
|
subTitle: this.utilities.sanitizeString(this.subTitle),
|
|
208
208
|
description: this.utilities.sanitizeString(this.description),
|
|
209
209
|
type: this.utilities.sanitizeString(this.type),
|
|
210
|
-
imgUrl: this.utilities.sanitizeString(this.imgUrl),
|
|
210
|
+
imgUrl: this.utilities.sanitizeString(this.imgUrl), // deprecate soon, will be migrated into imageUrls
|
|
211
211
|
'refinements.brandRefinement': this.utilities.sanitzeStringArr(this.refinements.brandRefinement),
|
|
212
212
|
'refinements.clothingSizeRefinement': this.utilities.sanitzeStringArr(this.refinements.clothingSizeRefinement),
|
|
213
213
|
'refinements.colorRefinement': this.utilities.sanitzeStringArr(this.refinements.colorRefinement),
|
|
@@ -78,5 +78,5 @@ class ProductStateManager extends Base_1.default {
|
|
|
78
78
|
return (this.state.getVal() === product_constants_1.PRODUCT_STATES.shoppingBag || this.state.getVal() === product_constants_1.PRODUCT_STATES.reservationQueue);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
exports.default = ProductStateManager;
|
|
82
81
|
ProductStateManager.PRODUCT_STATES = product_constants_1.PRODUCT_STATES;
|
|
82
|
+
exports.default = ProductStateManager;
|
|
@@ -144,12 +144,12 @@ declare enum SaleType {
|
|
|
144
144
|
DIRECT_SALE = "DIRECT_SALE"
|
|
145
145
|
}
|
|
146
146
|
declare enum SellerProductLedgerStatus {
|
|
147
|
-
PENDING_RETURN_PERIOD_COMPLETION = "PENDING_RETURN_PERIOD_COMPLETION"
|
|
148
|
-
RETURNED_AND_RELISTED = "RETURNED_AND_RELISTED"
|
|
149
|
-
SELLER_LIQUIDATED = "SELLER_LIQUIDATED",
|
|
150
|
-
MERCHANT_DONATED = "MERCHANT_DONATED",
|
|
151
|
-
SELLER_TO_BE_PAID = "SELLER_TO_BE_PAID"
|
|
152
|
-
PAYMENT_IN_PROGRESS = "PAYMENT_IN_PROGRESS"
|
|
147
|
+
PENDING_RETURN_PERIOD_COMPLETION = "PENDING_RETURN_PERIOD_COMPLETION",// Order is created => each item in order should get created (or logged if already created); Admin can also add to ledger from Products Table Action
|
|
148
|
+
RETURNED_AND_RELISTED = "RETURNED_AND_RELISTED",// Merchant will be the actor to move ledgerEntity to this state once item has cleared the return period. We can set up scheduledFunctionToTagSellerProductLedgerEntities to tag ledger entities on how long ago the item sold and how long it's been in return period
|
|
149
|
+
SELLER_LIQUIDATED = "SELLER_LIQUIDATED",// Item was returned and relisted but then seller decides to take item back. In this case, item amount owed to seller goes to zero
|
|
150
|
+
MERCHANT_DONATED = "MERCHANT_DONATED",// Item was returned and relisted but merchant decides to donate item and seller does not want it back. In this case, item amount owed to seller goes to zero
|
|
151
|
+
SELLER_TO_BE_PAID = "SELLER_TO_BE_PAID",// From here
|
|
152
|
+
PAYMENT_IN_PROGRESS = "PAYMENT_IN_PROGRESS",// to here is when fees would be added in Admin UI
|
|
153
153
|
SELLER_PAID = "SELLER_PAID",
|
|
154
154
|
DISPUTED = "DISPUTED",
|
|
155
155
|
RESOLVED = "RESOLVED",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rerobe-js-orm",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.7",
|
|
4
4
|
"description": "ReRobe's Javascript ORM Framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"homepage": "https://github.com/ReRobe/rerobe-product#readme",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/crypto-js": "^4.2.2",
|
|
32
|
-
"@types/jest": "^
|
|
32
|
+
"@types/jest": "^29.5.12",
|
|
33
33
|
"@types/slug": "^5.0.9",
|
|
34
|
-
"jest": "^
|
|
34
|
+
"jest": "^29.7.0",
|
|
35
35
|
"prettier": "^2.3.0",
|
|
36
|
-
"ts-jest": "^
|
|
36
|
+
"ts-jest": "^29.2.5",
|
|
37
37
|
"tslint": "^6.1.3",
|
|
38
38
|
"tslint-config-prettier": "^1.18.0",
|
|
39
|
-
"typescript": "^
|
|
39
|
+
"typescript": "^5.6.0"
|
|
40
40
|
},
|
|
41
41
|
"files": [
|
|
42
42
|
"lib/**/*"
|