rerobe-js-orm 3.1.4 → 3.1.6

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.
@@ -1,31 +1,102 @@
1
- export namespace PRODUCT_STATES {
1
+ export namespace SELLER_DRIVEN_STATES {
2
2
  const archived: string;
3
+ const sellerDonated: string;
3
4
  const sellRequestReview: string;
4
5
  const sellRequestReviewDraft: string;
5
- const rejected: string;
6
- const hold: string;
7
- const draft: string;
8
- const accepted: string;
9
6
  const sellerToDropOff: string;
10
7
  const sellerToShip: string;
11
8
  const sellerToGetPickUp: string;
12
- const qualityControl: string;
13
- const pendingPublication: string;
9
+ const sellerSelfReject: string;
10
+ const liquidationRequested: string;
11
+ }
12
+ export namespace ADMIN_DRIVEN_STATES {
13
+ const archived_1: string;
14
+ export { archived_1 as archived };
15
+ export const rejected: string;
16
+ export const hold: string;
17
+ export const draft: string;
18
+ export const accepted: string;
19
+ export const qualityControl: string;
20
+ export const pendingPublication: string;
21
+ export const merchantDonated: string;
22
+ }
23
+ export namespace ADMIN_ACTION_DRIVEN_STATES {
14
24
  const listed: string;
15
25
  const clearance: string;
16
- const reserved: string;
17
- const sold: string;
18
- const returned: string;
19
26
  const soldSellerToBePaid: string;
20
27
  const soldSellerPaid: string;
21
- const sellerSelfReject: string;
22
- const liquidationRequested: string;
23
28
  const liquidationReady: string;
24
29
  const sellerLiquidated: string;
30
+ const availableInStore: string;
31
+ }
32
+ export namespace SYSTEM_DRIVEN_STATES {
33
+ const sold: string;
34
+ const returned: string;
25
35
  const loading: string;
26
36
  const shoppingBag: string;
27
37
  const reservationQueue: string;
28
- const availableInStore: string;
38
+ const reserved: string;
39
+ }
40
+ export namespace PRODUCT_STATES { }
41
+ export namespace PRODUCT_STATE_LABELS {
42
+ const archived_2: string;
43
+ export { archived_2 as archived };
44
+ const sellRequestReview_1: string;
45
+ export { sellRequestReview_1 as sellRequestReview };
46
+ const sellRequestReviewDraft_1: string;
47
+ export { sellRequestReviewDraft_1 as sellRequestReviewDraft };
48
+ const rejected_1: string;
49
+ export { rejected_1 as rejected };
50
+ const draft_1: string;
51
+ export { draft_1 as draft };
52
+ const accepted_1: string;
53
+ export { accepted_1 as accepted };
54
+ const sellerToDropOff_1: string;
55
+ export { sellerToDropOff_1 as sellerToDropOff };
56
+ const sellerToShip_1: string;
57
+ export { sellerToShip_1 as sellerToShip };
58
+ const sellerToGetPickUp_1: string;
59
+ export { sellerToGetPickUp_1 as sellerToGetPickUp };
60
+ const qualityControl_1: string;
61
+ export { qualityControl_1 as qualityControl };
62
+ const pendingPublication_1: string;
63
+ export { pendingPublication_1 as pendingPublication };
64
+ const listed_1: string;
65
+ export { listed_1 as listed };
66
+ const hold_1: string;
67
+ export { hold_1 as hold };
68
+ const clearance_1: string;
69
+ export { clearance_1 as clearance };
70
+ const reserved_1: string;
71
+ export { reserved_1 as reserved };
72
+ const sold_1: string;
73
+ export { sold_1 as sold };
74
+ const returned_1: string;
75
+ export { returned_1 as returned };
76
+ const soldSellerToBePaid_1: string;
77
+ export { soldSellerToBePaid_1 as soldSellerToBePaid };
78
+ const soldSellerPaid_1: string;
79
+ export { soldSellerPaid_1 as soldSellerPaid };
80
+ const sellerSelfReject_1: string;
81
+ export { sellerSelfReject_1 as sellerSelfReject };
82
+ const liquidationRequested_1: string;
83
+ export { liquidationRequested_1 as liquidationRequested };
84
+ const liquidationReady_1: string;
85
+ export { liquidationReady_1 as liquidationReady };
86
+ const sellerLiquidated_1: string;
87
+ export { sellerLiquidated_1 as sellerLiquidated };
88
+ const loading_1: string;
89
+ export { loading_1 as loading };
90
+ const shoppingBag_1: string;
91
+ export { shoppingBag_1 as shoppingBag };
92
+ const reservationQueue_1: string;
93
+ export { reservationQueue_1 as reservationQueue };
94
+ const availableInStore_1: string;
95
+ export { availableInStore_1 as availableInStore };
96
+ const sellerDonated_1: string;
97
+ export { sellerDonated_1 as sellerDonated };
98
+ const merchantDonated_1: string;
99
+ export { merchantDonated_1 as merchantDonated };
29
100
  }
30
101
  export namespace MEASUREMENT_CATEGORY {
31
102
  const SuitsNBlazers: string;
@@ -70,4 +141,6 @@ export namespace MEASUREMENT_FIELDS_DICT {
70
141
  const innerLeg: string;
71
142
  const outerLeg: string;
72
143
  const footCircumference: string;
144
+ const handDrop: string;
145
+ const shoulderDrop: string;
73
146
  }
@@ -1,34 +1,75 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MEASUREMENT_FIELDS_DICT = exports.MEASUREMENT_CATEGORY = exports.PRODUCT_STATES = void 0;
4
- exports.PRODUCT_STATES = {
3
+ exports.MEASUREMENT_FIELDS_DICT = exports.MEASUREMENT_CATEGORY = exports.PRODUCT_STATE_LABELS = exports.PRODUCT_STATES = exports.SYSTEM_DRIVEN_STATES = exports.ADMIN_ACTION_DRIVEN_STATES = exports.ADMIN_DRIVEN_STATES = exports.SELLER_DRIVEN_STATES = void 0;
4
+ exports.SELLER_DRIVEN_STATES = {
5
5
  archived: 'ARCHIVED',
6
+ sellerDonated: 'SELLER_DONATED',
6
7
  sellRequestReview: 'SELL_REQUEST_REVIEW',
7
8
  sellRequestReviewDraft: 'SELL_REQUEST_REVIEW_DRAFT',
9
+ sellerToDropOff: 'SELLER_TO_DROP_OFF',
10
+ sellerToShip: 'SELLER_TO_SHIP',
11
+ sellerToGetPickUp: 'AT_HOME_PICK_UP',
12
+ sellerSelfReject: 'SELLER_SELF_REJECT',
13
+ liquidationRequested: 'LIQUIDATION_REQUESTED',
14
+ };
15
+ exports.ADMIN_DRIVEN_STATES = {
16
+ archived: 'ARCHIVED',
8
17
  rejected: 'REJECTED',
9
18
  hold: 'HOLD',
10
19
  draft: 'DRAFT',
11
20
  accepted: 'ACCEPTED',
12
- sellerToDropOff: 'SELLER_TO_DROP_OFF',
13
- sellerToShip: 'SELLER_TO_SHIP',
14
- sellerToGetPickUp: 'AT_HOME_PICK_UP',
15
21
  qualityControl: 'QUALITY_CONTROL',
16
22
  pendingPublication: 'PENDING_PUBLICATION',
23
+ merchantDonated: 'MERCHANT_DONATED',
24
+ };
25
+ exports.ADMIN_ACTION_DRIVEN_STATES = {
17
26
  listed: 'LISTED',
18
27
  clearance: 'CLEARANCE',
19
- reserved: 'RESERVED',
20
- sold: 'SOLD',
21
- returned: 'RETURNED',
22
28
  soldSellerToBePaid: 'SOLD_SELLER_TO_BE_PAID',
23
29
  soldSellerPaid: 'SOLD_SELLER_PAID',
24
- sellerSelfReject: 'SELLER_SELF_REJECT',
25
- liquidationRequested: 'LIQUIDATION_REQUESTED',
26
30
  liquidationReady: 'LIQUIDATION_READY',
27
31
  sellerLiquidated: 'SELLER_LIQUIDATED',
32
+ availableInStore: 'AVAILABLE_IN_STORE',
33
+ };
34
+ exports.SYSTEM_DRIVEN_STATES = {
35
+ sold: 'SOLD',
36
+ returned: 'RETURNED',
28
37
  loading: 'LOADING',
29
38
  shoppingBag: 'IN_SHOPPING_BAG',
30
39
  reservationQueue: 'IN_RESERVATION_QUEUE',
31
- availableInStore: 'AVAILABLE_IN_STORE',
40
+ reserved: 'RESERVED',
41
+ };
42
+ exports.PRODUCT_STATES = Object.assign(Object.assign(Object.assign(Object.assign({}, exports.SELLER_DRIVEN_STATES), exports.ADMIN_DRIVEN_STATES), exports.ADMIN_ACTION_DRIVEN_STATES), exports.SYSTEM_DRIVEN_STATES);
43
+ exports.PRODUCT_STATE_LABELS = {
44
+ archived: 'Saved for later',
45
+ sellRequestReview: 'Waiting for approval',
46
+ sellRequestReviewDraft: 'In draft',
47
+ rejected: 'Declined by merchant',
48
+ draft: 'In admin draft',
49
+ accepted: 'Accepted',
50
+ sellerToDropOff: 'To drop off with merchant',
51
+ sellerToShip: 'To ship to merchant',
52
+ sellerToGetPickUp: 'Awaiting pick up from courier',
53
+ qualityControl: 'In quality control',
54
+ pendingPublication: 'Pending publication',
55
+ listed: 'Published for sale',
56
+ hold: 'Published-on hold by merchant for a potential customer',
57
+ clearance: 'On clearance',
58
+ reserved: 'In a shopping cart',
59
+ sold: 'Sold—return period open',
60
+ returned: 'Returned-pending publication',
61
+ soldSellerToBePaid: 'SOLD-pendingy payment',
62
+ soldSellerPaid: 'Paid out',
63
+ sellerSelfReject: 'Declined by you',
64
+ liquidationRequested: 'Requested to take back',
65
+ liquidationReady: 'Ready to take back',
66
+ sellerLiquidated: 'You’ve taken back',
67
+ loading: 'Loading',
68
+ shoppingBag: 'In a shopping bag',
69
+ reservationQueue: 'In ',
70
+ availableInStore: 'Listed for sale in store',
71
+ sellerDonated: 'Donated by you',
72
+ merchantDonated: 'Donated by merchant',
32
73
  };
33
74
  exports.MEASUREMENT_CATEGORY = {
34
75
  SuitsNBlazers: 'Suits & Blazers',
@@ -74,4 +115,6 @@ exports.MEASUREMENT_FIELDS_DICT = {
74
115
  outerLeg: 'Outer Leg',
75
116
  footCircumference: 'Foot Circumference',
76
117
  sleeveLength: 'Sleeve Length',
118
+ handDrop: 'Hand Drop',
119
+ shoulderDrop: 'Shoulder Drop',
77
120
  };
@@ -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;
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;
8
8
  const productAttributes = {
9
9
  availableForSale: props.fields.availableForSale.selectedValue,
10
10
  description: props.fields.description.inputValue,
@@ -107,6 +107,9 @@ class ProductFromFormState extends ProductFactory_1.default {
107
107
  sellerLiquidatedTimestamp: (_14 = props.props) === null || _14 === void 0 ? void 0 : _14.sellerLiquidatedTimestamp,
108
108
  archivedTimestamp: (_15 = props.props) === null || _15 === void 0 ? void 0 : _15.archivedTimestamp,
109
109
  liquidationReadyTimestamp: (_16 = props.props) === null || _16 === void 0 ? void 0 : _16.liquidationReadyTimestamp,
110
+ sellerDonatedTimestamp: (_17 = props.props) === null || _17 === void 0 ? void 0 : _17.sellerDonatedTimestamp,
111
+ merchantDonatedTimestamp: (_18 = props.props) === null || _18 === void 0 ? void 0 : _18.merchantDonatedTimestamp,
112
+ draftTimestamp: (_19 = props.props) === null || _19 === void 0 ? void 0 : _19.draftTimestamp,
110
113
  };
111
114
  return new Product_1.default(Object.assign(Object.assign(Object.assign(Object.assign({}, productAttributes), productFilterAttributes), consignmentAttributes), timestampAttributes));
112
115
  }
@@ -45,6 +45,11 @@ const measurementCategoryOptions = [
45
45
  value: 'Bottoms',
46
46
  measurementFields: ['waistCircumference', 'innerLeg', 'outerLeg', 'footCircumference'],
47
47
  },
48
+ {
49
+ label: 'Bags',
50
+ value: 'Bags',
51
+ measurementFields: ['length', 'height', 'width', 'handDrop', 'shoulderDrop'],
52
+ },
48
53
  {
49
54
  label: 'Shirts',
50
55
  value: 'Shirts',
@@ -282,7 +282,7 @@ class ReRobeProductHelpers {
282
282
  static createTimestampsForStates(productObj) {
283
283
  const docFieldsToUpdate = {};
284
284
  if (productObj) {
285
- 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;
285
+ 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;
286
286
  if (status === product_constants_1.PRODUCT_STATES.sellRequestReviewDraft && !sellRequestReviewDraftTimestamp) {
287
287
  docFieldsToUpdate.sellRequestReviewDraftTimestamp = new Date().getTime();
288
288
  }
@@ -360,6 +360,15 @@ class ReRobeProductHelpers {
360
360
  if (status === product_constants_1.PRODUCT_STATES.liquidationReady && !liquidationReadyTimestamp) {
361
361
  docFieldsToUpdate.liquidationReadyTimestamp = new Date().getTime();
362
362
  }
363
+ if (status === product_constants_1.PRODUCT_STATES.sellerDonated && !sellerDonatedTimestamp) {
364
+ docFieldsToUpdate.sellerDonatedTimestamp = new Date().getTime();
365
+ }
366
+ if (status === product_constants_1.PRODUCT_STATES.merchantDonated && !merchantDonatedTimestamp) {
367
+ docFieldsToUpdate.merchantDonatedTimestamp = new Date().getTime();
368
+ }
369
+ if (status === product_constants_1.PRODUCT_STATES.draft && !draftTimestamp) {
370
+ docFieldsToUpdate.draftTimestamp = new Date().getTime();
371
+ }
363
372
  }
364
373
  return docFieldsToUpdate;
365
374
  }
@@ -117,6 +117,9 @@ class Product extends Base_1.default {
117
117
  sellerLiquidatedTimestamp: (props === null || props === void 0 ? void 0 : props.sellerLiquidatedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.sellerLiquidatedTimestamp) : null,
118
118
  archivedTimestamp: (props === null || props === void 0 ? void 0 : props.archivedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.archivedTimestamp) : null,
119
119
  liquidationReadyTimestamp: (props === null || props === void 0 ? void 0 : props.liquidationReadyTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.liquidationReadyTimestamp) : null,
120
+ sellerDonatedTimestamp: (props === null || props === void 0 ? void 0 : props.sellerDonatedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.sellerDonatedTimestamp) : null,
121
+ merchantDonatedTimestamp: (props === null || props === void 0 ? void 0 : props.merchantDonatedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.merchantDonatedTimestamp) : null,
122
+ draftTimestamp: (props === null || props === void 0 ? void 0 : props.draftTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.draftTimestamp) : null,
120
123
  };
121
124
  }
122
125
  toPartialObj() {
@@ -333,6 +336,9 @@ class Product extends Base_1.default {
333
336
  sellerLiquidatedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.sellerLiquidatedTimestamp),
334
337
  archivedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.archivedTimestamp),
335
338
  liquidationReadyTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.liquidationReadyTimestamp),
339
+ sellerDonatedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.sellerDonatedTimestamp),
340
+ merchantDonatedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.merchantDonatedTimestamp),
341
+ draftTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.draftTimestamp),
336
342
  selectedForClearance: this.utilities.sanitizeString(this.consignmentAttributes.selectedForClearance),
337
343
  availableForSale: !!this.attributes.availableForSale,
338
344
  color: this.utilities.sanitizeString(this.filterAttributes.color),
@@ -1,33 +1,35 @@
1
1
  import Base from '../Base';
2
2
  export default class ProductStateManager extends Base {
3
3
  static PRODUCT_STATES: {
4
+ sold: string;
5
+ returned: string;
6
+ loading: string;
7
+ shoppingBag: string;
8
+ reservationQueue: string;
9
+ reserved: string;
10
+ listed: string;
11
+ clearance: string;
12
+ soldSellerToBePaid: string;
13
+ soldSellerPaid: string;
14
+ liquidationReady: string;
15
+ sellerLiquidated: string;
16
+ availableInStore: string;
4
17
  archived: string;
5
- sellRequestReview: string;
6
- sellRequestReviewDraft: string;
7
18
  rejected: string;
8
19
  hold: string;
9
20
  draft: string;
10
21
  accepted: string;
22
+ qualityControl: string;
23
+ pendingPublication: string;
24
+ merchantDonated: string;
25
+ sellerDonated: string;
26
+ sellRequestReview: string;
27
+ sellRequestReviewDraft: string;
11
28
  sellerToDropOff: string;
12
29
  sellerToShip: string;
13
30
  sellerToGetPickUp: string;
14
- qualityControl: string;
15
- pendingPublication: string;
16
- listed: string;
17
- clearance: string;
18
- reserved: string;
19
- sold: string;
20
- returned: string;
21
- soldSellerToBePaid: string;
22
- soldSellerPaid: string;
23
31
  sellerSelfReject: string;
24
32
  liquidationRequested: string;
25
- liquidationReady: string;
26
- sellerLiquidated: string;
27
- loading: string;
28
- shoppingBag: string;
29
- reservationQueue: string;
30
- availableInStore: string;
31
33
  };
32
34
  state: ProductState;
33
35
  states: ProductStates;
@@ -78,6 +78,7 @@ declare type ProductConsignmentAttributes = {
78
78
  declare type ProductTimestampAttributes = {
79
79
  createdAtTimestamp: number | null;
80
80
  updatedAtTimestamp: number | null;
81
+ draftTimestamp: number | null;
81
82
  sellRequestReviewTimestamp: number | null;
82
83
  sellRequestReviewDraftTimestamp: number | null;
83
84
  rejectedTimestamp: number | null;
@@ -100,6 +101,8 @@ declare type ProductTimestampAttributes = {
100
101
  sellerLiquidatedTimestamp: number | null;
101
102
  archivedTimestamp: number | null;
102
103
  liquidationReadyTimestamp: number | null;
104
+ sellerDonatedTimestamp: number | null;
105
+ merchantDonatedTimestamp: number | null;
103
106
  };
104
107
  declare type TranslatableAttributes = {
105
108
  description: string;
@@ -294,8 +297,11 @@ declare type TypesenseProductObj = {
294
297
  sellerSelfRejectTimestamp: number;
295
298
  liquidationRequestedTimestamp: number;
296
299
  sellerLiquidatedTimestamp: number;
300
+ draftTimestamp: number;
297
301
  archivedTimestamp: number;
298
302
  liquidationReadyTimestamp: number;
303
+ sellerDonatedTimestamp: number | null;
304
+ merchantDonatedTimestamp: number | null;
299
305
  availableForSale: boolean;
300
306
  color: string;
301
307
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",