rerobe-js-orm 4.2.6 → 4.2.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.
- package/lib/constants/product-constants.d.ts +21 -0
- package/lib/constants/product-constants.js +15 -3
- package/lib/factories/Product/ProductFromFormState.js +20 -12
- package/lib/helpers/OrderHelpers.d.ts +1 -173
- package/lib/helpers/OrderHelpers.js +1 -1
- package/lib/helpers/ReRobeProductHelpers.js +31 -1
- package/lib/models/Product.d.ts +2 -0
- package/lib/models/Product.js +45 -1
- package/lib/models/ProductStateManager.d.ts +3 -0
- package/lib/types/rerobe-order-types.d.ts +14 -0
- package/lib/types/rerobe-product-types.d.ts +15 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export namespace SELLER_DRIVEN_STATES {
|
|
|
8
8
|
const sellerToGetPickUp: string;
|
|
9
9
|
const sellerSelfReject: string;
|
|
10
10
|
const liquidationRequested: string;
|
|
11
|
+
const soldSellerSelfPay: string;
|
|
11
12
|
}
|
|
12
13
|
export namespace ADMIN_DRIVEN_STATES {
|
|
13
14
|
const archived_1: string;
|
|
@@ -39,6 +40,8 @@ export namespace ADMIN_SIMPLIFIED_STATES {
|
|
|
39
40
|
}
|
|
40
41
|
export namespace SYSTEM_DRIVEN_STATES {
|
|
41
42
|
const sold: string;
|
|
43
|
+
const soldSellerPayoutProcessing: string;
|
|
44
|
+
const soldSellerPayoutFailed: string;
|
|
42
45
|
const returned: string;
|
|
43
46
|
const loading: string;
|
|
44
47
|
const shoppingBag: string;
|
|
@@ -104,6 +107,12 @@ export namespace PRODUCT_STATES {
|
|
|
104
107
|
export { reservationQueue_1 as reservationQueue };
|
|
105
108
|
const reserved_1: string;
|
|
106
109
|
export { reserved_1 as reserved };
|
|
110
|
+
const soldSellerSelfPay_1: string;
|
|
111
|
+
export { soldSellerSelfPay_1 as soldSellerSelfPay };
|
|
112
|
+
const soldSellerPayoutProcessing_1: string;
|
|
113
|
+
export { soldSellerPayoutProcessing_1 as soldSellerPayoutProcessing };
|
|
114
|
+
const soldSellerPayoutFailed_1: string;
|
|
115
|
+
export { soldSellerPayoutFailed_1 as soldSellerPayoutFailed };
|
|
107
116
|
}
|
|
108
117
|
export namespace PRODUCT_STATE_LABELS {
|
|
109
118
|
const archived_3: string;
|
|
@@ -164,6 +173,12 @@ export namespace PRODUCT_STATE_LABELS {
|
|
|
164
173
|
export { sellerDonated_2 as sellerDonated };
|
|
165
174
|
const merchantDonated_2: string;
|
|
166
175
|
export { merchantDonated_2 as merchantDonated };
|
|
176
|
+
const soldSellerSelfPay_2: string;
|
|
177
|
+
export { soldSellerSelfPay_2 as soldSellerSelfPay };
|
|
178
|
+
const soldSellerPayoutProcessing_2: string;
|
|
179
|
+
export { soldSellerPayoutProcessing_2 as soldSellerPayoutProcessing };
|
|
180
|
+
const soldSellerPayoutFailed_2: string;
|
|
181
|
+
export { soldSellerPayoutFailed_2 as soldSellerPayoutFailed };
|
|
167
182
|
}
|
|
168
183
|
export namespace PRODUCT_STATE_LABELS_ADMIN_VIEW {
|
|
169
184
|
const archived_4: string;
|
|
@@ -224,6 +239,12 @@ export namespace PRODUCT_STATE_LABELS_ADMIN_VIEW {
|
|
|
224
239
|
export { sellerDonated_3 as sellerDonated };
|
|
225
240
|
const merchantDonated_3: string;
|
|
226
241
|
export { merchantDonated_3 as merchantDonated };
|
|
242
|
+
const soldSellerSelfPay_3: string;
|
|
243
|
+
export { soldSellerSelfPay_3 as soldSellerSelfPay };
|
|
244
|
+
const soldSellerPayoutProcessing_3: string;
|
|
245
|
+
export { soldSellerPayoutProcessing_3 as soldSellerPayoutProcessing };
|
|
246
|
+
const soldSellerPayoutFailed_3: string;
|
|
247
|
+
export { soldSellerPayoutFailed_3 as soldSellerPayoutFailed };
|
|
227
248
|
}
|
|
228
249
|
export namespace MEASUREMENT_CATEGORY {
|
|
229
250
|
const SuitsNBlazers: string;
|
|
@@ -11,7 +11,8 @@ exports.SELLER_DRIVEN_STATES = {
|
|
|
11
11
|
sellerToGetPickUp: 'AT_HOME_PICK_UP',
|
|
12
12
|
sellerSelfReject: 'SELLER_SELF_REJECT',
|
|
13
13
|
liquidationRequested: 'LIQUIDATION_REQUESTED',
|
|
14
|
-
|
|
14
|
+
soldSellerSelfPay: 'SOLD_SELLER_SELF_PAY',
|
|
15
|
+
}; // 10
|
|
15
16
|
exports.ADMIN_DRIVEN_STATES = {
|
|
16
17
|
archived: 'ARCHIVED',
|
|
17
18
|
rejected: 'REJECTED',
|
|
@@ -38,12 +39,14 @@ exports.ADMIN_SIMPLIFIED_STATES = {
|
|
|
38
39
|
};
|
|
39
40
|
exports.SYSTEM_DRIVEN_STATES = {
|
|
40
41
|
sold: 'SOLD',
|
|
42
|
+
soldSellerPayoutProcessing: 'SOLD_SELLER_PAYOUT_PROCESSING',
|
|
43
|
+
soldSellerPayoutFailed: 'SOLD_SELLER_PAYOUT_FAILED',
|
|
41
44
|
returned: 'RETURNED',
|
|
42
45
|
loading: 'LOADING',
|
|
43
46
|
shoppingBag: 'IN_SHOPPING_BAG',
|
|
44
47
|
reservationQueue: 'IN_RESERVATION_QUEUE',
|
|
45
48
|
reserved: 'RESERVED',
|
|
46
|
-
}; //
|
|
49
|
+
}; // 8
|
|
47
50
|
exports.PRODUCT_STATES = {
|
|
48
51
|
archived: 'ARCHIVED',
|
|
49
52
|
sellerDonated: 'SELLER_DONATED',
|
|
@@ -74,6 +77,9 @@ exports.PRODUCT_STATES = {
|
|
|
74
77
|
shoppingBag: 'IN_SHOPPING_BAG',
|
|
75
78
|
reservationQueue: 'IN_RESERVATION_QUEUE',
|
|
76
79
|
reserved: 'RESERVED',
|
|
80
|
+
soldSellerSelfPay: 'SOLD_SELLER_SELF_PAY',
|
|
81
|
+
soldSellerPayoutProcessing: 'SOLD_SELLER_PAYOUT_PROCESSING',
|
|
82
|
+
soldSellerPayoutFailed: 'SOLD_SELLER_PAYOUT_FAILED',
|
|
77
83
|
};
|
|
78
84
|
exports.PRODUCT_STATE_LABELS = {
|
|
79
85
|
archived: 'Saved for later',
|
|
@@ -98,13 +104,16 @@ exports.PRODUCT_STATE_LABELS = {
|
|
|
98
104
|
sellerSelfReject: 'Declined by you',
|
|
99
105
|
liquidationRequested: 'Requested to take back',
|
|
100
106
|
liquidationReady: 'Ready to take back',
|
|
101
|
-
sellerLiquidated: '
|
|
107
|
+
sellerLiquidated: "You've taken back",
|
|
102
108
|
loading: 'Loading',
|
|
103
109
|
shoppingBag: 'In a shopping bag',
|
|
104
110
|
reservationQueue: 'In waiting list',
|
|
105
111
|
availableInStore: 'Listed for sale in store',
|
|
106
112
|
sellerDonated: 'Donated by you',
|
|
107
113
|
merchantDonated: 'Donated by merchant',
|
|
114
|
+
soldSellerSelfPay: 'Sold—self payout initiated',
|
|
115
|
+
soldSellerPayoutProcessing: 'Sold—payout processing',
|
|
116
|
+
soldSellerPayoutFailed: 'Sold—payout failed',
|
|
108
117
|
};
|
|
109
118
|
exports.PRODUCT_STATE_LABELS_ADMIN_VIEW = {
|
|
110
119
|
archived: 'Saved for later',
|
|
@@ -136,6 +145,9 @@ exports.PRODUCT_STATE_LABELS_ADMIN_VIEW = {
|
|
|
136
145
|
availableInStore: 'Listed for sale in store',
|
|
137
146
|
sellerDonated: 'Donated by seller',
|
|
138
147
|
merchantDonated: 'Donated by merchant',
|
|
148
|
+
soldSellerSelfPay: 'Sold—seller self payout initiated',
|
|
149
|
+
soldSellerPayoutProcessing: 'Sold—seller payout processing',
|
|
150
|
+
soldSellerPayoutFailed: 'Sold—seller payout failed',
|
|
139
151
|
};
|
|
140
152
|
exports.MEASUREMENT_CATEGORY = {
|
|
141
153
|
SuitsNBlazers: 'Suits & Blazers',
|
|
@@ -4,7 +4,7 @@ const ProductFactory_1 = require("./ProductFactory");
|
|
|
4
4
|
const Product_1 = require("../../models/Product");
|
|
5
5
|
class ProductFromFormState extends ProductFactory_1.default {
|
|
6
6
|
createProduct(props) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22;
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28;
|
|
8
8
|
const productAttributes = {
|
|
9
9
|
availableForSale: props.fields.availableForSale.selectedValue,
|
|
10
10
|
description: props.fields.description.inputValue,
|
|
@@ -108,18 +108,26 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
108
108
|
reservedTimestamp: (_10 = props.props) === null || _10 === void 0 ? void 0 : _10.reservedTimestamp,
|
|
109
109
|
soldTimestamp: (_11 = props.props) === null || _11 === void 0 ? void 0 : _11.soldTimestamp,
|
|
110
110
|
returnedTimestamp: (_12 = props.props) === null || _12 === void 0 ? void 0 : _12.returnedTimestamp,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
soldSellerSelfPayTimestamp: (_13 = props.props) === null || _13 === void 0 ? void 0 : _13.soldSellerSelfPayTimestamp,
|
|
112
|
+
soldSellerPayoutProcessingTimestamp: (_14 = props.props) === null || _14 === void 0 ? void 0 : _14.soldSellerPayoutProcessingTimestamp,
|
|
113
|
+
soldSellerPayoutFailedTimestamp: (_15 = props.props) === null || _15 === void 0 ? void 0 : _15.soldSellerPayoutFailedTimestamp,
|
|
114
|
+
soldSellerToBePaidTimestamp: (_16 = props.props) === null || _16 === void 0 ? void 0 : _16.soldSellerToBePaidTimestamp,
|
|
115
|
+
soldSellerPaidTimestamp: (_17 = props.props) === null || _17 === void 0 ? void 0 : _17.soldSellerPaidTimestamp,
|
|
116
|
+
sellerSelfRejectTimestamp: (_18 = props.props) === null || _18 === void 0 ? void 0 : _18.sellerSelfRejectTimestamp,
|
|
117
|
+
liquidationRequestedTimestamp: (_19 = props.props) === null || _19 === void 0 ? void 0 : _19.liquidationRequestedTimestamp,
|
|
118
|
+
sellerLiquidatedTimestamp: (_20 = props.props) === null || _20 === void 0 ? void 0 : _20.sellerLiquidatedTimestamp,
|
|
119
|
+
archivedTimestamp: (_21 = props.props) === null || _21 === void 0 ? void 0 : _21.archivedTimestamp,
|
|
120
|
+
liquidationReadyTimestamp: (_22 = props.props) === null || _22 === void 0 ? void 0 : _22.liquidationReadyTimestamp,
|
|
121
|
+
sellerDonatedTimestamp: (_23 = props.props) === null || _23 === void 0 ? void 0 : _23.sellerDonatedTimestamp,
|
|
122
|
+
merchantDonatedTimestamp: (_24 = props.props) === null || _24 === void 0 ? void 0 : _24.merchantDonatedTimestamp,
|
|
123
|
+
draftTimestamp: (_25 = props.props) === null || _25 === void 0 ? void 0 : _25.draftTimestamp,
|
|
121
124
|
};
|
|
122
|
-
|
|
125
|
+
const payoutAttributes = {
|
|
126
|
+
payoutMethod: (_26 = props.props) === null || _26 === void 0 ? void 0 : _26.payoutMethod,
|
|
127
|
+
payoutSystem: (_27 = props.props) === null || _27 === void 0 ? void 0 : _27.payoutSystem,
|
|
128
|
+
payoutReference: (_28 = props.props) === null || _28 === void 0 ? void 0 : _28.payoutReference,
|
|
129
|
+
};
|
|
130
|
+
return new Product_1.default(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, productAttributes), productFilterAttributes), consignmentAttributes), timestampAttributes), payoutAttributes));
|
|
123
131
|
}
|
|
124
132
|
}
|
|
125
133
|
exports.default = ProductFromFormState;
|
|
@@ -43,179 +43,7 @@ export default class OrderHelpers {
|
|
|
43
43
|
subTotalWithSalePriceIncluded: number;
|
|
44
44
|
totalIncludingShipping: number;
|
|
45
45
|
totalIncludingShippingAndTaxes: number;
|
|
46
|
-
}):
|
|
47
|
-
discountTitlePresentment: string;
|
|
48
|
-
saleDiscountPresentment: {
|
|
49
|
-
amount: string;
|
|
50
|
-
currencyCode: string;
|
|
51
|
-
};
|
|
52
|
-
creditDiscountPresentment: {
|
|
53
|
-
amount: string;
|
|
54
|
-
currencyCode: string;
|
|
55
|
-
};
|
|
56
|
-
additionalDiscountPresentment: {
|
|
57
|
-
amount: string;
|
|
58
|
-
currencyCode: string;
|
|
59
|
-
};
|
|
60
|
-
lineItems: {
|
|
61
|
-
presentmentTotalPrice: {
|
|
62
|
-
amount: string;
|
|
63
|
-
currencyCode: string;
|
|
64
|
-
};
|
|
65
|
-
presentmentUnitPrice: {
|
|
66
|
-
amount: string;
|
|
67
|
-
currencyCode: string;
|
|
68
|
-
};
|
|
69
|
-
presentmentSalePrice: {
|
|
70
|
-
amount: string;
|
|
71
|
-
currencyCode: string;
|
|
72
|
-
};
|
|
73
|
-
presentmentTaxPrice: {
|
|
74
|
-
amount: string;
|
|
75
|
-
currencyCode: string;
|
|
76
|
-
};
|
|
77
|
-
brand?: string | null | undefined;
|
|
78
|
-
productId?: string | null | undefined;
|
|
79
|
-
shopifyProductId?: string | number | null | undefined;
|
|
80
|
-
refundedQuantity?: string | number | undefined;
|
|
81
|
-
canceledQuantity?: string | number | undefined;
|
|
82
|
-
fulfilledQuantity?: string | number | undefined;
|
|
83
|
-
unfulfilledQuantity?: string | number | undefined;
|
|
84
|
-
status?: string | undefined;
|
|
85
|
-
isOnSale?: string | undefined;
|
|
86
|
-
salePrice?: string | undefined;
|
|
87
|
-
isTaxable?: boolean | undefined;
|
|
88
|
-
taxRate?: number | undefined;
|
|
89
|
-
fromCountry?: string | undefined;
|
|
90
|
-
toCountry?: string | undefined;
|
|
91
|
-
taxAmount?: Money | undefined;
|
|
92
|
-
discountedPrice?: Money | undefined;
|
|
93
|
-
taxAmountWithDiscount?: Money | undefined;
|
|
94
|
-
handle?: string | undefined;
|
|
95
|
-
title: string;
|
|
96
|
-
quantity: string | number;
|
|
97
|
-
variant: ProductVariant | null;
|
|
98
|
-
originalTotalPrice?: Money | undefined;
|
|
99
|
-
originalUnitPrice?: Money | undefined;
|
|
100
|
-
discountedTotalPrice?: Money | undefined;
|
|
101
|
-
image?: Image | undefined;
|
|
102
|
-
}[];
|
|
103
|
-
subtotalPricePresentment: {
|
|
104
|
-
amount: string;
|
|
105
|
-
currencyCode: string;
|
|
106
|
-
};
|
|
107
|
-
totalDiscountPresentment: {
|
|
108
|
-
amount: string;
|
|
109
|
-
currencyCode: string;
|
|
110
|
-
};
|
|
111
|
-
totalShippingPricePresentment: {
|
|
112
|
-
amount: string;
|
|
113
|
-
currencyCode: string;
|
|
114
|
-
};
|
|
115
|
-
itemsTaxPresentment: {
|
|
116
|
-
amount: string;
|
|
117
|
-
currencyCode: string;
|
|
118
|
-
};
|
|
119
|
-
shippingFeeTax: {
|
|
120
|
-
amount: string;
|
|
121
|
-
currencyCode: string;
|
|
122
|
-
};
|
|
123
|
-
totalTaxPresentment: {
|
|
124
|
-
amount: string;
|
|
125
|
-
currencyCode: string;
|
|
126
|
-
};
|
|
127
|
-
totalPricePresentment: {
|
|
128
|
-
amount: string;
|
|
129
|
-
currencyCode: string;
|
|
130
|
-
};
|
|
131
|
-
shippingFeeTaxPresentment?: undefined;
|
|
132
|
-
} | {
|
|
133
|
-
discountTitlePresentment: string;
|
|
134
|
-
lineItems: {
|
|
135
|
-
presentmentTotalPrice: {
|
|
136
|
-
amount: string;
|
|
137
|
-
currencyCode: string;
|
|
138
|
-
};
|
|
139
|
-
presentmentUnitPrice: {
|
|
140
|
-
amount: string;
|
|
141
|
-
currencyCode: string;
|
|
142
|
-
};
|
|
143
|
-
presentmentSalePrice: {
|
|
144
|
-
amount: string;
|
|
145
|
-
currencyCode: string;
|
|
146
|
-
};
|
|
147
|
-
presentmentTaxPrice: {
|
|
148
|
-
amount: string;
|
|
149
|
-
currencyCode: string;
|
|
150
|
-
};
|
|
151
|
-
brand?: string | null | undefined;
|
|
152
|
-
productId?: string | null | undefined;
|
|
153
|
-
shopifyProductId?: string | number | null | undefined;
|
|
154
|
-
refundedQuantity?: string | number | undefined;
|
|
155
|
-
canceledQuantity?: string | number | undefined;
|
|
156
|
-
fulfilledQuantity?: string | number | undefined;
|
|
157
|
-
unfulfilledQuantity?: string | number | undefined;
|
|
158
|
-
status?: string | undefined;
|
|
159
|
-
isOnSale?: string | undefined;
|
|
160
|
-
salePrice?: string | undefined;
|
|
161
|
-
isTaxable?: boolean | undefined;
|
|
162
|
-
taxRate?: number | undefined;
|
|
163
|
-
fromCountry?: string | undefined;
|
|
164
|
-
toCountry?: string | undefined;
|
|
165
|
-
taxAmount?: Money | undefined;
|
|
166
|
-
discountedPrice?: Money | undefined;
|
|
167
|
-
taxAmountWithDiscount?: Money | undefined;
|
|
168
|
-
handle?: string | undefined;
|
|
169
|
-
title: string;
|
|
170
|
-
quantity: string | number;
|
|
171
|
-
variant: ProductVariant | null;
|
|
172
|
-
originalTotalPrice?: Money | undefined;
|
|
173
|
-
originalUnitPrice?: Money | undefined;
|
|
174
|
-
discountedTotalPrice?: Money | undefined;
|
|
175
|
-
image?: Image | undefined;
|
|
176
|
-
}[];
|
|
177
|
-
saleDiscountPresentment: {
|
|
178
|
-
amount: string;
|
|
179
|
-
currencyCode: string;
|
|
180
|
-
};
|
|
181
|
-
creditDiscountPresentment: {
|
|
182
|
-
amount: string;
|
|
183
|
-
currencyCode: string;
|
|
184
|
-
};
|
|
185
|
-
additionalDiscountPresentment: {
|
|
186
|
-
amount: string;
|
|
187
|
-
currencyCode: string;
|
|
188
|
-
};
|
|
189
|
-
subtotalPricePresentment: {
|
|
190
|
-
amount: string;
|
|
191
|
-
currencyCode: string;
|
|
192
|
-
};
|
|
193
|
-
totalDiscountPresentment: {
|
|
194
|
-
amount: string;
|
|
195
|
-
currencyCode: string;
|
|
196
|
-
};
|
|
197
|
-
totalShippingPricePresentment: {
|
|
198
|
-
amount: string;
|
|
199
|
-
currencyCode: string;
|
|
200
|
-
};
|
|
201
|
-
totalPricePresentment: {
|
|
202
|
-
amount: string;
|
|
203
|
-
currencyCode: string;
|
|
204
|
-
};
|
|
205
|
-
itemsTaxPresentment: {
|
|
206
|
-
amount: string;
|
|
207
|
-
currencyCode: string;
|
|
208
|
-
};
|
|
209
|
-
shippingFeeTaxPresentment: {
|
|
210
|
-
amount: string;
|
|
211
|
-
currencyCode: string;
|
|
212
|
-
};
|
|
213
|
-
totalTaxPresentment: {
|
|
214
|
-
amount: string;
|
|
215
|
-
currencyCode: string;
|
|
216
|
-
};
|
|
217
|
-
shippingFeeTax?: undefined;
|
|
218
|
-
};
|
|
46
|
+
}): PreparePresentmentDataResponse;
|
|
219
47
|
getPaymentTerminalReceiptInfo(payload?: any): PaymentTerminalReceiptInfo;
|
|
220
48
|
getFormattedFulfillmentLocation(order: ReRobeOrderObj): string;
|
|
221
49
|
generateReceiptLabels(locale: string, paymentMethod: string, entryMode?: string): ReceiptLabels;
|
|
@@ -449,7 +449,7 @@ class OrderHelpers {
|
|
|
449
449
|
totalDiscountPresentment: prepareMoneyObj(creditDiscountAmount + additionalDiscount),
|
|
450
450
|
totalShippingPricePresentment: prepareMoneyObj(shippingPrice),
|
|
451
451
|
itemsTaxPresentment: prepareMoneyObj(itemsTax),
|
|
452
|
-
|
|
452
|
+
shippingFeeTaxPresentment: prepareMoneyObj(shippingFeeTax),
|
|
453
453
|
totalTaxPresentment: prepareMoneyObj(totalTax),
|
|
454
454
|
totalPricePresentment: prepareMoneyObj(totalIncludingShippingAndTaxes || totalIncludingShipping),
|
|
455
455
|
};
|
|
@@ -371,7 +371,7 @@ class ReRobeProductHelpers {
|
|
|
371
371
|
static createTimestampsForStates(productObj) {
|
|
372
372
|
const docFieldsToUpdate = {};
|
|
373
373
|
if (productObj) {
|
|
374
|
-
const { status, sellRequestReviewDraftTimestamp, sellRequestReviewTimestamp, rejectedTimestamp, holdTimestamp, acceptedTimestamp, sellerToDropOffTimestamp, sellerToShipTimestamp, sellerToGetPickUpTimestamp, qualityControlTimestamp, pendingPublicationTimestamp, listedTimestamp, clearanceTimestamp, reservedTimestamp, soldTimestamp, soldSellerToBePaidTimestamp, soldSellerPaidTimestamp, returnedTimestamp, sellerSelfRejectTimestamp, liquidationRequestedTimestamp, sellerLiquidatedTimestamp, archivedTimestamp, liquidationReadyTimestamp, sellerDonatedTimestamp, merchantDonatedTimestamp, draftTimestamp, } = productObj;
|
|
374
|
+
const { status, sellRequestReviewDraftTimestamp, sellRequestReviewTimestamp, rejectedTimestamp, holdTimestamp, acceptedTimestamp, sellerToDropOffTimestamp, sellerToShipTimestamp, sellerToGetPickUpTimestamp, qualityControlTimestamp, pendingPublicationTimestamp, listedTimestamp, clearanceTimestamp, reservedTimestamp, soldTimestamp, soldSellerToBePaidTimestamp, soldSellerPaidTimestamp, returnedTimestamp, sellerSelfRejectTimestamp, liquidationRequestedTimestamp, sellerLiquidatedTimestamp, archivedTimestamp, liquidationReadyTimestamp, sellerDonatedTimestamp, merchantDonatedTimestamp, draftTimestamp, soldSellerSelfPayTimestamp, soldSellerPayoutProcessingTimestamp, soldSellerPayoutFailedTimestamp, } = productObj;
|
|
375
375
|
if (status === product_constants_1.PRODUCT_STATES.sellRequestReviewDraft && !sellRequestReviewDraftTimestamp) {
|
|
376
376
|
docFieldsToUpdate.sellRequestReviewDraftTimestamp = new Date().getTime();
|
|
377
377
|
}
|
|
@@ -431,6 +431,36 @@ class ReRobeProductHelpers {
|
|
|
431
431
|
docFieldsToUpdate.soldTimestamp = timeNow;
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
+
if (status === product_constants_1.PRODUCT_STATES.soldSellerSelfPay && !soldSellerSelfPayTimestamp) {
|
|
435
|
+
const timeNow = new Date().getTime();
|
|
436
|
+
docFieldsToUpdate.soldSellerSelfPayTimestamp = timeNow;
|
|
437
|
+
if (!soldTimestamp) {
|
|
438
|
+
docFieldsToUpdate.soldTimestamp = timeNow;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
if (status === product_constants_1.PRODUCT_STATES.soldSellerPayoutProcessing && !soldSellerPayoutProcessingTimestamp) {
|
|
442
|
+
const timeNow = new Date().getTime();
|
|
443
|
+
docFieldsToUpdate.soldSellerPayoutProcessingTimestamp = timeNow;
|
|
444
|
+
if (!soldSellerSelfPayTimestamp) {
|
|
445
|
+
docFieldsToUpdate.soldSellerSelfPayTimestamp = timeNow;
|
|
446
|
+
}
|
|
447
|
+
if (!soldTimestamp) {
|
|
448
|
+
docFieldsToUpdate.soldTimestamp = timeNow;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (status === product_constants_1.PRODUCT_STATES.soldSellerPayoutFailed && !soldSellerPayoutFailedTimestamp) {
|
|
452
|
+
const timeNow = new Date().getTime();
|
|
453
|
+
docFieldsToUpdate.soldSellerPayoutFailedTimestamp = timeNow;
|
|
454
|
+
if (!soldSellerPayoutProcessingTimestamp) {
|
|
455
|
+
docFieldsToUpdate.soldSellerPayoutProcessingTimestamp = timeNow;
|
|
456
|
+
}
|
|
457
|
+
if (!soldSellerSelfPayTimestamp) {
|
|
458
|
+
docFieldsToUpdate.soldSellerSelfPayTimestamp = timeNow;
|
|
459
|
+
}
|
|
460
|
+
if (!soldTimestamp) {
|
|
461
|
+
docFieldsToUpdate.soldTimestamp = timeNow;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
434
464
|
if (status === product_constants_1.PRODUCT_STATES.returned && !returnedTimestamp) {
|
|
435
465
|
docFieldsToUpdate.returnedTimestamp = new Date().getTime();
|
|
436
466
|
}
|
package/lib/models/Product.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export default class Product extends Base {
|
|
|
4
4
|
filterAttributes: ProductFilterAttributes;
|
|
5
5
|
consignmentAttributes: ProductConsignmentAttributes;
|
|
6
6
|
timestampAttributes: ProductTimestampAttributes;
|
|
7
|
+
payoutAttributes: PayoutAttributes;
|
|
7
8
|
FIELD_NOT_TRANSLATABLE_KEY: string;
|
|
8
9
|
constructor(props?: any);
|
|
9
10
|
toPartialObj(): ShopifyProduct;
|
|
@@ -67,4 +68,5 @@ export default class Product extends Base {
|
|
|
67
68
|
private convertMaterialCompJoinedStrToObj;
|
|
68
69
|
private sanitizeMaterialComp;
|
|
69
70
|
private validateInventoryLocation;
|
|
71
|
+
setupPayout(method: PayoutAttributes['payoutMethod'], system: PayoutAttributes['payoutSystem'], reference?: string): void;
|
|
70
72
|
}
|
package/lib/models/Product.js
CHANGED
|
@@ -129,13 +129,25 @@ class Product extends Base_1.default {
|
|
|
129
129
|
sellerDonatedTimestamp: (props === null || props === void 0 ? void 0 : props.sellerDonatedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.sellerDonatedTimestamp) : null,
|
|
130
130
|
merchantDonatedTimestamp: (props === null || props === void 0 ? void 0 : props.merchantDonatedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.merchantDonatedTimestamp) : null,
|
|
131
131
|
draftTimestamp: (props === null || props === void 0 ? void 0 : props.draftTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.draftTimestamp) : null,
|
|
132
|
+
soldSellerSelfPayTimestamp: (props === null || props === void 0 ? void 0 : props.soldSellerSelfPayTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.soldSellerSelfPayTimestamp) : null,
|
|
133
|
+
soldSellerPayoutProcessingTimestamp: (props === null || props === void 0 ? void 0 : props.soldSellerPayoutProcessingTimestamp)
|
|
134
|
+
? Number(props === null || props === void 0 ? void 0 : props.soldSellerPayoutProcessingTimestamp)
|
|
135
|
+
: null,
|
|
136
|
+
soldSellerPayoutFailedTimestamp: (props === null || props === void 0 ? void 0 : props.soldSellerPayoutFailedTimestamp)
|
|
137
|
+
? Number(props === null || props === void 0 ? void 0 : props.soldSellerPayoutFailedTimestamp)
|
|
138
|
+
: null,
|
|
139
|
+
};
|
|
140
|
+
this.payoutAttributes = {
|
|
141
|
+
payoutMethod: (props === null || props === void 0 ? void 0 : props.payoutMethod) || null,
|
|
142
|
+
payoutSystem: (props === null || props === void 0 ? void 0 : props.payoutSystem) || null,
|
|
143
|
+
payoutReference: (props === null || props === void 0 ? void 0 : props.payoutReference) || '',
|
|
132
144
|
};
|
|
133
145
|
}
|
|
134
146
|
toPartialObj() {
|
|
135
147
|
return Object.assign(Object.assign({}, this.attributes), this.filterAttributes);
|
|
136
148
|
} // ToDo: Deprecate soon
|
|
137
149
|
toObj() {
|
|
138
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, this.attributes), this.filterAttributes), this.consignmentAttributes), this.timestampAttributes);
|
|
150
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.attributes), this.filterAttributes), this.consignmentAttributes), this.timestampAttributes), this.payoutAttributes);
|
|
139
151
|
}
|
|
140
152
|
toProductInputObjForShopify(location) {
|
|
141
153
|
const productInputObj = {
|
|
@@ -329,6 +341,9 @@ class Product extends Base_1.default {
|
|
|
329
341
|
vendorId: this.utilities.sanitizeString(this.attributes.vendorId),
|
|
330
342
|
weightRange: this.utilities.sanitizeString(this.attributes.weightRange),
|
|
331
343
|
weightUnit: this.utilities.sanitizeString(this.attributes.weightUnit),
|
|
344
|
+
payoutMethod: this.utilities.sanitizeString(this.payoutAttributes.payoutMethod),
|
|
345
|
+
payoutSystem: this.utilities.sanitizeString(this.payoutAttributes.payoutSystem),
|
|
346
|
+
payoutReference: this.utilities.sanitizeString(this.payoutAttributes.payoutReference),
|
|
332
347
|
createdAtTimestamp,
|
|
333
348
|
createdAtHour,
|
|
334
349
|
createdAtDay,
|
|
@@ -351,6 +366,9 @@ class Product extends Base_1.default {
|
|
|
351
366
|
soldTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.soldTimestamp),
|
|
352
367
|
returnedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.returnedTimestamp),
|
|
353
368
|
soldSellerToBePaidTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.soldSellerToBePaidTimestamp),
|
|
369
|
+
soldSellerSelfPayTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.soldSellerSelfPayTimestamp),
|
|
370
|
+
soldSellerPayoutProcessingTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.soldSellerPayoutProcessingTimestamp),
|
|
371
|
+
soldSellerPayoutFailedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.soldSellerPayoutFailedTimestamp),
|
|
354
372
|
soldSellerPaidTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.soldSellerPaidTimestamp),
|
|
355
373
|
sellerSelfRejectTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.sellerSelfRejectTimestamp),
|
|
356
374
|
liquidationRequestedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.liquidationRequestedTimestamp),
|
|
@@ -978,6 +996,24 @@ class Product extends Base_1.default {
|
|
|
978
996
|
type: 'string',
|
|
979
997
|
optional: true,
|
|
980
998
|
},
|
|
999
|
+
{
|
|
1000
|
+
facet: true,
|
|
1001
|
+
name: 'payoutMethod',
|
|
1002
|
+
type: 'string',
|
|
1003
|
+
optional: true,
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
facet: true,
|
|
1007
|
+
name: 'payoutSystem',
|
|
1008
|
+
type: 'string',
|
|
1009
|
+
optional: true,
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
facet: true,
|
|
1013
|
+
name: 'payoutReference',
|
|
1014
|
+
type: 'string',
|
|
1015
|
+
optional: true,
|
|
1016
|
+
},
|
|
981
1017
|
],
|
|
982
1018
|
name,
|
|
983
1019
|
};
|
|
@@ -1117,5 +1153,13 @@ class Product extends Base_1.default {
|
|
|
1117
1153
|
}
|
|
1118
1154
|
return [];
|
|
1119
1155
|
}
|
|
1156
|
+
// Add helper method for payout setup
|
|
1157
|
+
setupPayout(method, system, reference) {
|
|
1158
|
+
this.payoutAttributes.payoutMethod = method;
|
|
1159
|
+
this.payoutAttributes.payoutSystem = system;
|
|
1160
|
+
if (reference) {
|
|
1161
|
+
this.payoutAttributes.payoutReference = reference;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1120
1164
|
}
|
|
1121
1165
|
exports.default = Product;
|
|
@@ -39,6 +39,9 @@ export default class ProductStateManager extends Base {
|
|
|
39
39
|
shoppingBag: string;
|
|
40
40
|
reservationQueue: string;
|
|
41
41
|
reserved: string;
|
|
42
|
+
soldSellerSelfPay: string;
|
|
43
|
+
soldSellerPayoutProcessing: string;
|
|
44
|
+
soldSellerPayoutFailed: string;
|
|
42
45
|
};
|
|
43
46
|
state: ProductState;
|
|
44
47
|
states: Record<ProductStateKey, ProductState>;
|
|
@@ -813,6 +813,20 @@ type OrderPresentmentData = {
|
|
|
813
813
|
saleDiscountPresentment?: Money;
|
|
814
814
|
additionalDiscountPresentment?: Money;
|
|
815
815
|
};
|
|
816
|
+
type PreparePresentmentDataResponse = {
|
|
817
|
+
discountTitlePresentment: string;
|
|
818
|
+
saleDiscountPresentment: Money;
|
|
819
|
+
creditDiscountPresentment: Money;
|
|
820
|
+
additionalDiscountPresentment: Money;
|
|
821
|
+
lineItems: ReRobeOrderLineItem[];
|
|
822
|
+
subtotalPricePresentment: Money;
|
|
823
|
+
totalDiscountPresentment: Money;
|
|
824
|
+
totalShippingPricePresentment: Money;
|
|
825
|
+
itemsTaxPresentment: Money;
|
|
826
|
+
shippingFeeTaxPresentment: Money;
|
|
827
|
+
totalTaxPresentment: Money;
|
|
828
|
+
totalPricePresentment: Money;
|
|
829
|
+
};
|
|
816
830
|
type CompleteOrder = ReRobeOrderObj & {
|
|
817
831
|
[key: string]: any;
|
|
818
832
|
};
|
|
@@ -104,6 +104,9 @@ type ProductTimestampAttributes = {
|
|
|
104
104
|
returnedTimestamp: number | null;
|
|
105
105
|
soldSellerToBePaidTimestamp: number | null;
|
|
106
106
|
soldSellerPaidTimestamp: number | null;
|
|
107
|
+
soldSellerSelfPayTimestamp: number | null;
|
|
108
|
+
soldSellerPayoutProcessingTimestamp: number | null;
|
|
109
|
+
soldSellerPayoutFailedTimestamp: number | null;
|
|
107
110
|
sellerSelfRejectTimestamp: number | null;
|
|
108
111
|
liquidationRequestedTimestamp: number | null;
|
|
109
112
|
sellerLiquidatedTimestamp: number | null;
|
|
@@ -147,7 +150,12 @@ type EditorAuthorization = {
|
|
|
147
150
|
type ProductSellStatusKeys = 'SELL_REQUEST_REVIEW' | 'REJECTED' | 'HOLD' | 'ACCEPTED' | 'DROP_OFF_AT_REROBE' | 'SHIP_TO_REROBE' | 'AT_HOME_PICK_UP' | 'QUALITY_CONTROL' | 'LISTED' | 'SOLD' | 'RETURNED' | 'SOLD_SELLER_TO_BE_PAID' | 'SOLD_SELLER_PAID';
|
|
148
151
|
type ProductPublishKeys = 'USER_PUBLISHED' | 'MERCHANT_PUBLISHED';
|
|
149
152
|
type ShopifyProduct = ProductAttributes & ProductFilterAttributes;
|
|
150
|
-
type
|
|
153
|
+
type PayoutAttributes = {
|
|
154
|
+
payoutMethod?: 'CASH' | 'STORE_CREDIT' | null;
|
|
155
|
+
payoutSystem?: 'STRIPE' | 'MANUAL_TRANSFER' | 'RIBBN_CREDITS' | null;
|
|
156
|
+
payoutReference?: string;
|
|
157
|
+
};
|
|
158
|
+
type CompleteProduct = ProductAttributes & ProductFilterAttributes & ProductConsignmentAttributes & PayoutAttributes & {
|
|
151
159
|
[key: string]: any;
|
|
152
160
|
};
|
|
153
161
|
type ProductAttributesFormFields = {
|
|
@@ -314,6 +322,9 @@ type TypesenseProductObj = {
|
|
|
314
322
|
reservedTimestamp: number;
|
|
315
323
|
soldTimestamp: number;
|
|
316
324
|
returnedTimestamp: number;
|
|
325
|
+
soldSellerSelfPayTimestamp: number | null;
|
|
326
|
+
soldSellerPayoutProcessingTimestamp: number | null;
|
|
327
|
+
soldSellerPayoutFailedTimestamp: number | null;
|
|
317
328
|
soldSellerToBePaidTimestamp: number;
|
|
318
329
|
soldSellerPaidTimestamp: number;
|
|
319
330
|
sellerSelfRejectTimestamp: number;
|
|
@@ -344,6 +355,9 @@ type TypesenseProductObj = {
|
|
|
344
355
|
createdAtYear: string;
|
|
345
356
|
weightRange: string;
|
|
346
357
|
weightUnit: string;
|
|
358
|
+
payoutMethod: 'CASH' | 'STORE_CREDIT' | null;
|
|
359
|
+
payoutSystem: 'STRIPE' | 'MANUAL_TRANSFER' | 'RIBBN_CREDITS' | null;
|
|
360
|
+
payoutReference: string;
|
|
347
361
|
[key: string]: any;
|
|
348
362
|
};
|
|
349
363
|
type GoogleMerchantCenterProductObj = {
|