rerobe-js-orm 2.5.9 → 2.6.2
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.
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export namespace PRODUCT_STATES {
|
|
2
|
+
const archived: string;
|
|
3
|
+
const sellRequestReview: string;
|
|
4
|
+
const sellRequestReviewDraft: string;
|
|
5
|
+
const rejected: string;
|
|
6
|
+
const hold: string;
|
|
7
|
+
const draft: string;
|
|
8
|
+
const accepted: string;
|
|
9
|
+
const sellerToDropOff: string;
|
|
10
|
+
const sellerToShip: string;
|
|
11
|
+
const sellerToGetPickUp: string;
|
|
12
|
+
const qualityControl: string;
|
|
13
|
+
const pendingPublication: string;
|
|
14
|
+
const listed: string;
|
|
15
|
+
const clearance: string;
|
|
16
|
+
const reserved: string;
|
|
17
|
+
const sold: string;
|
|
18
|
+
const returned: string;
|
|
19
|
+
const soldSellerToBePaid: string;
|
|
20
|
+
const soldSellerPaid: string;
|
|
21
|
+
const sellerSelfReject: string;
|
|
22
|
+
const liquidationRequested: string;
|
|
23
|
+
const liquidationReady: string;
|
|
24
|
+
const sellerLiquidated: string;
|
|
25
|
+
const loading: string;
|
|
26
|
+
const shoppingBag: string;
|
|
27
|
+
const reservationQueue: string;
|
|
28
|
+
const availableInStore: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PRODUCT_STATES = void 0;
|
|
4
|
+
exports.PRODUCT_STATES = {
|
|
5
|
+
archived: 'ARCHIVED',
|
|
6
|
+
sellRequestReview: 'SELL_REQUEST_REVIEW',
|
|
7
|
+
sellRequestReviewDraft: 'SELL_REQUEST_REVIEW_DRAFT',
|
|
8
|
+
rejected: 'REJECTED',
|
|
9
|
+
hold: 'HOLD',
|
|
10
|
+
draft: 'DRAFT',
|
|
11
|
+
accepted: 'ACCEPTED',
|
|
12
|
+
sellerToDropOff: 'DROP_OFF_AT_REROBE',
|
|
13
|
+
sellerToShip: 'SHIP_TO_REROBE',
|
|
14
|
+
sellerToGetPickUp: 'AT_HOME_PICK_UP',
|
|
15
|
+
qualityControl: 'QUALITY_CONTROL',
|
|
16
|
+
pendingPublication: 'PENDING_PUBLICATION',
|
|
17
|
+
listed: 'LISTED',
|
|
18
|
+
clearance: 'CLEARANCE',
|
|
19
|
+
reserved: 'RESERVED',
|
|
20
|
+
sold: 'SOLD',
|
|
21
|
+
returned: 'RETURNED',
|
|
22
|
+
soldSellerToBePaid: 'SOLD_SELLER_TO_BE_PAID',
|
|
23
|
+
soldSellerPaid: 'SOLD_SELLER_PAID',
|
|
24
|
+
sellerSelfReject: 'SELLER_SELF_REJECT',
|
|
25
|
+
liquidationRequested: 'LIQUIDATION_REQUESTED',
|
|
26
|
+
liquidationReady: 'LIQUIDATION_READY',
|
|
27
|
+
sellerLiquidated: 'SELLER_LIQUIDATED',
|
|
28
|
+
loading: 'LOADING',
|
|
29
|
+
shoppingBag: 'IN_SHOPPING_BAG',
|
|
30
|
+
reservationQueue: 'IN_RESERVATION_QUEUE',
|
|
31
|
+
availableInStore: 'AVAILABLE_IN_STORE',
|
|
32
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.productOptions = exports.productIsOnSaleOptions = exports.discountTypeOptions = exports.salesChannelOptions = exports.unisexJewelry = exports.mensJewelry = exports.jewelry = exports.unisexAccessories = exports.mensAccessories = exports.accessories = exports.unisexBags = exports.mensBags = exports.bags = exports.unisexShoes = exports.mensShoes = exports.shoes = exports.unisexClothing = exports.mensClothing = exports.clothing = exports.productCategories = exports.clothingMaterials = exports.shoeSizes = exports.jeanSizes = exports.gender = exports.conditions = exports.colors = exports.brands = exports.sizeCommentOptions = exports.clothingSizeOptions = exports.statusOptions = exports.publishTypeOptions = exports.availableForSaleOptions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const product_constants_1 = require("../../constants/product-constants");
|
|
5
5
|
const lodash_1 = require("lodash");
|
|
6
6
|
const availableForSaleOptions = [
|
|
7
7
|
{
|
|
@@ -29,7 +29,7 @@ const publishTypeOptions = [
|
|
|
29
29
|
},
|
|
30
30
|
];
|
|
31
31
|
exports.publishTypeOptions = publishTypeOptions;
|
|
32
|
-
const statusOptions = Object.values(
|
|
32
|
+
const statusOptions = Object.values(product_constants_1.PRODUCT_STATES).map((val) => ({
|
|
33
33
|
label: lodash_1.startCase(lodash_1.toLower(val)),
|
|
34
34
|
value: val,
|
|
35
35
|
}));
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
// @ts-ignore
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const options_1 = require("../form-states/Product/options");
|
|
6
|
-
const
|
|
6
|
+
const product_constants_1 = require("../constants/product-constants");
|
|
7
7
|
class ReRobeProductHelpers {
|
|
8
8
|
static calculateProductionFee(commission) {
|
|
9
9
|
if (commission === 0.16) {
|
|
@@ -197,13 +197,13 @@ class ReRobeProductHelpers {
|
|
|
197
197
|
static prepareProductForMutation(productObj, mediaInputArr = []) {
|
|
198
198
|
const productObjClone = Object.assign({}, productObj);
|
|
199
199
|
const { status, dateInQualityControl, dateInPendingPublication, dateListedOnline, publishedAt, price } = productObj;
|
|
200
|
-
if (status ===
|
|
200
|
+
if (status === product_constants_1.PRODUCT_STATES.qualityControl && !dateInQualityControl) {
|
|
201
201
|
productObjClone.dateInQualityControl = new Date().toISOString().split('T')[0];
|
|
202
202
|
}
|
|
203
|
-
if (status ===
|
|
203
|
+
if (status === product_constants_1.PRODUCT_STATES.pendingPublication && !dateInPendingPublication) {
|
|
204
204
|
productObjClone.dateInPendingPublication = new Date().toISOString().split('T')[0];
|
|
205
205
|
}
|
|
206
|
-
if (status ===
|
|
206
|
+
if (status === product_constants_1.PRODUCT_STATES.listed && !dateListedOnline) {
|
|
207
207
|
productObjClone.dateListedOnline = publishedAt
|
|
208
208
|
? new Date(publishedAt).toISOString().split('T')[0]
|
|
209
209
|
: new Date().toISOString().split('T')[0];
|
|
@@ -227,56 +227,56 @@ class ReRobeProductHelpers {
|
|
|
227
227
|
const docFieldsToUpdate = {};
|
|
228
228
|
if (productObj) {
|
|
229
229
|
const { status, sellRequestReviewDraftTimestamp, sellRequestReviewTimestamp, rejectedTimestamp, holdTimestamp, acceptedTimestamp, sellerToDropOffTimestamp, sellerToShipTimestamp, sellerToGetPickUpTimestamp, qualityControlTimestamp, pendingPublicationTimestamp, listedTimestamp, clearanceTimestamp, reservedTimestamp, soldTimestamp, soldSellerToBePaidTimestamp, soldSellerPaidTimestamp, returnedTimestamp, sellerSelfRejectTimestamp, liquidationRequestedTimestamp, sellerLiquidatedTimestamp, archivedTimestamp, liquidationReadyTimestamp, } = productObj;
|
|
230
|
-
if (status ===
|
|
230
|
+
if (status === product_constants_1.PRODUCT_STATES.sellRequestReviewDraft && !sellRequestReviewDraftTimestamp) {
|
|
231
231
|
docFieldsToUpdate.sellRequestReviewDraftTimestamp = new Date().getTime();
|
|
232
232
|
}
|
|
233
|
-
if (status ===
|
|
233
|
+
if (status === product_constants_1.PRODUCT_STATES.sellRequestReview && !sellRequestReviewTimestamp) {
|
|
234
234
|
docFieldsToUpdate.sellRequestReviewTimestamp = new Date().getTime();
|
|
235
235
|
}
|
|
236
|
-
if (status ===
|
|
236
|
+
if (status === product_constants_1.PRODUCT_STATES.rejected && !rejectedTimestamp) {
|
|
237
237
|
docFieldsToUpdate.rejectedTimestamp = new Date().getTime();
|
|
238
238
|
}
|
|
239
|
-
if (status ===
|
|
239
|
+
if (status === product_constants_1.PRODUCT_STATES.hold && !holdTimestamp) {
|
|
240
240
|
docFieldsToUpdate.holdTimestamp = new Date().getTime();
|
|
241
241
|
}
|
|
242
|
-
if (status ===
|
|
242
|
+
if (status === product_constants_1.PRODUCT_STATES.accepted && !acceptedTimestamp) {
|
|
243
243
|
docFieldsToUpdate.acceptedTimestamp = new Date().getTime();
|
|
244
244
|
}
|
|
245
|
-
if (status ===
|
|
245
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerToDropOff && !sellerToDropOffTimestamp) {
|
|
246
246
|
docFieldsToUpdate.sellerToDropOffTimestamp = new Date().getTime();
|
|
247
247
|
}
|
|
248
|
-
if (status ===
|
|
248
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerToShip && !sellerToShipTimestamp) {
|
|
249
249
|
docFieldsToUpdate.sellerToShipTimestamp = new Date().getTime();
|
|
250
250
|
}
|
|
251
|
-
if (status ===
|
|
251
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerToGetPickUp && !sellerToGetPickUpTimestamp) {
|
|
252
252
|
docFieldsToUpdate.sellerToGetPickUpTimestamp = new Date().getTime();
|
|
253
253
|
}
|
|
254
|
-
if (status ===
|
|
254
|
+
if (status === product_constants_1.PRODUCT_STATES.qualityControl && !qualityControlTimestamp) {
|
|
255
255
|
docFieldsToUpdate.qualityControlTimestamp = new Date().getTime();
|
|
256
256
|
}
|
|
257
|
-
if (status ===
|
|
257
|
+
if (status === product_constants_1.PRODUCT_STATES.pendingPublication && !pendingPublicationTimestamp) {
|
|
258
258
|
docFieldsToUpdate.pendingPublicationTimestamp = new Date().getTime();
|
|
259
259
|
}
|
|
260
|
-
if (status ===
|
|
260
|
+
if (status === product_constants_1.PRODUCT_STATES.listed && !listedTimestamp) {
|
|
261
261
|
docFieldsToUpdate.listedTimestamp = new Date().getTime();
|
|
262
262
|
}
|
|
263
|
-
if (status ===
|
|
263
|
+
if (status === product_constants_1.PRODUCT_STATES.clearance && !clearanceTimestamp) {
|
|
264
264
|
docFieldsToUpdate.clearanceTimestamp = new Date().getTime();
|
|
265
265
|
}
|
|
266
|
-
if (status ===
|
|
266
|
+
if (status === product_constants_1.PRODUCT_STATES.reserved && !reservedTimestamp) {
|
|
267
267
|
docFieldsToUpdate.reservedTimestamp = new Date().getTime();
|
|
268
268
|
}
|
|
269
|
-
if (status ===
|
|
269
|
+
if (status === product_constants_1.PRODUCT_STATES.sold && !soldTimestamp) {
|
|
270
270
|
docFieldsToUpdate.soldTimestamp = new Date().getTime();
|
|
271
271
|
}
|
|
272
|
-
if (status ===
|
|
272
|
+
if (status === product_constants_1.PRODUCT_STATES.soldSellerToBePaid && !soldSellerToBePaidTimestamp) {
|
|
273
273
|
const timeNow = new Date().getTime();
|
|
274
274
|
docFieldsToUpdate.soldSellerToBePaidTimestamp = timeNow;
|
|
275
275
|
if (!soldTimestamp) {
|
|
276
276
|
docFieldsToUpdate.soldTimestamp = timeNow;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
if (status ===
|
|
279
|
+
if (status === product_constants_1.PRODUCT_STATES.soldSellerPaid && !soldSellerPaidTimestamp) {
|
|
280
280
|
const timeNow = new Date().getTime();
|
|
281
281
|
docFieldsToUpdate.soldSellerPaidTimestamp = timeNow;
|
|
282
282
|
if (!soldSellerToBePaidTimestamp) {
|
|
@@ -286,22 +286,22 @@ class ReRobeProductHelpers {
|
|
|
286
286
|
docFieldsToUpdate.soldTimestamp = timeNow;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
if (status ===
|
|
289
|
+
if (status === product_constants_1.PRODUCT_STATES.returned && !returnedTimestamp) {
|
|
290
290
|
docFieldsToUpdate.returnedTimestamp = new Date().getTime();
|
|
291
291
|
}
|
|
292
|
-
if (status ===
|
|
292
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerSelfReject && !sellerSelfRejectTimestamp) {
|
|
293
293
|
docFieldsToUpdate.sellerSelfRejectTimestamp = new Date().getTime();
|
|
294
294
|
}
|
|
295
|
-
if (status ===
|
|
295
|
+
if (status === product_constants_1.PRODUCT_STATES.liquidationRequested && !liquidationRequestedTimestamp) {
|
|
296
296
|
docFieldsToUpdate.liquidationRequestedTimestamp = new Date().getTime();
|
|
297
297
|
}
|
|
298
|
-
if (status ===
|
|
298
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerLiquidated && !sellerLiquidatedTimestamp) {
|
|
299
299
|
docFieldsToUpdate.sellerLiquidatedTimestamp = new Date().getTime();
|
|
300
300
|
}
|
|
301
|
-
if (status ===
|
|
301
|
+
if (status === product_constants_1.PRODUCT_STATES.archived && !archivedTimestamp) {
|
|
302
302
|
docFieldsToUpdate.archivedTimestamp = new Date().getTime();
|
|
303
303
|
}
|
|
304
|
-
if (status ===
|
|
304
|
+
if (status === product_constants_1.PRODUCT_STATES.liquidationReady && !liquidationReadyTimestamp) {
|
|
305
305
|
docFieldsToUpdate.liquidationReadyTimestamp = new Date().getTime();
|
|
306
306
|
}
|
|
307
307
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const Base_1 = require("../Base");
|
|
4
|
+
const product_constants_1 = require("../constants/product-constants");
|
|
4
5
|
class ProductStateManager extends Base_1.default {
|
|
5
6
|
constructor() {
|
|
6
7
|
super();
|
|
@@ -349,32 +350,4 @@ class ProductStateManager extends Base_1.default {
|
|
|
349
350
|
}
|
|
350
351
|
}
|
|
351
352
|
exports.default = ProductStateManager;
|
|
352
|
-
ProductStateManager.PRODUCT_STATES =
|
|
353
|
-
archived: 'ARCHIVED',
|
|
354
|
-
sellRequestReview: 'SELL_REQUEST_REVIEW',
|
|
355
|
-
sellRequestReviewDraft: 'SELL_REQUEST_REVIEW_DRAFT',
|
|
356
|
-
rejected: 'REJECTED',
|
|
357
|
-
hold: 'HOLD',
|
|
358
|
-
draft: 'DRAFT',
|
|
359
|
-
accepted: 'ACCEPTED',
|
|
360
|
-
sellerToDropOff: 'DROP_OFF_AT_REROBE',
|
|
361
|
-
sellerToShip: 'SHIP_TO_REROBE',
|
|
362
|
-
sellerToGetPickUp: 'AT_HOME_PICK_UP',
|
|
363
|
-
qualityControl: 'QUALITY_CONTROL',
|
|
364
|
-
pendingPublication: 'PENDING_PUBLICATION',
|
|
365
|
-
listed: 'LISTED',
|
|
366
|
-
clearance: 'CLEARANCE',
|
|
367
|
-
reserved: 'RESERVED',
|
|
368
|
-
sold: 'SOLD',
|
|
369
|
-
returned: 'RETURNED',
|
|
370
|
-
soldSellerToBePaid: 'SOLD_SELLER_TO_BE_PAID',
|
|
371
|
-
soldSellerPaid: 'SOLD_SELLER_PAID',
|
|
372
|
-
sellerSelfReject: 'SELLER_SELF_REJECT',
|
|
373
|
-
liquidationRequested: 'LIQUIDATION_REQUESTED',
|
|
374
|
-
liquidationReady: 'LIQUIDATION_READY',
|
|
375
|
-
sellerLiquidated: 'SELLER_LIQUIDATED',
|
|
376
|
-
loading: 'LOADING',
|
|
377
|
-
shoppingBag: 'IN_SHOPPING_BAG',
|
|
378
|
-
reservationQueue: 'IN_RESERVATION_QUEUE',
|
|
379
|
-
availableInStore: 'AVAILABLE_IN_STORE',
|
|
380
|
-
};
|
|
353
|
+
ProductStateManager.PRODUCT_STATES = product_constants_1.PRODUCT_STATES;
|