rerobe-js-orm 2.5.3 → 2.5.4

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.
@@ -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;
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;
8
8
  const productAttributes = {
9
9
  availableForSale: props.fields.availableForSale.selectedValue,
10
10
  description: props.fields.description.inputValue,
@@ -102,6 +102,7 @@ class ProductFromFormState extends ProductFactory_1.default {
102
102
  liquidationRequestedTimestamp: (_12 = props.props) === null || _12 === void 0 ? void 0 : _12.liquidationRequestedTimestamp,
103
103
  sellerLiquidatedTimestamp: (_13 = props.props) === null || _13 === void 0 ? void 0 : _13.sellerLiquidatedTimestamp,
104
104
  archivedTimestamp: (_14 = props.props) === null || _14 === void 0 ? void 0 : _14.archivedTimestamp,
105
+ liquidationReadyTimestamp: (_15 = props.props) === null || _15 === void 0 ? void 0 : _15.liquidationReadyTimestamp,
105
106
  };
106
107
  return new Product_1.default(Object.assign(Object.assign(Object.assign(Object.assign({}, productAttributes), productFilterAttributes), consignmentAttributes), timestampAttributes));
107
108
  }
@@ -226,7 +226,7 @@ class ReRobeProductHelpers {
226
226
  static createTimestampsForStates(productObj) {
227
227
  const docFieldsToUpdate = {};
228
228
  if (productObj) {
229
- const { status, sellRequestReviewDraftTimestamp, sellRequestReviewTimestamp, rejectedTimestamp, holdTimestamp, acceptedTimestamp, sellerToDropOffTimestamp, sellerToShipTimestamp, sellerToGetPickUpTimestamp, qualityControlTimestamp, pendingPublicationTimestamp, listedTimestamp, clearanceTimestamp, reservedTimestamp, soldTimestamp, soldSellerToBePaidTimestamp, soldSellerPaidTimestamp, returnedTimestamp, sellerSelfRejectTimestamp, liquidationRequestedTimestamp, sellerLiquidatedTimestamp, archivedTimestamp, } = productObj;
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
230
  if (status === ProductStateManager_1.default.PRODUCT_STATES.sellRequestReviewDraft && !sellRequestReviewDraftTimestamp) {
231
231
  docFieldsToUpdate.sellRequestReviewDraftTimestamp = new Date().getTime();
232
232
  }
@@ -301,6 +301,9 @@ class ReRobeProductHelpers {
301
301
  if (status === ProductStateManager_1.default.PRODUCT_STATES.archived && !archivedTimestamp) {
302
302
  docFieldsToUpdate.archivedTimestamp = new Date().getTime();
303
303
  }
304
+ if (status === ProductStateManager_1.default.PRODUCT_STATES.liquidationReady && !liquidationReadyTimestamp) {
305
+ docFieldsToUpdate.liquidationReadyTimestamp = new Date().getTime();
306
+ }
304
307
  }
305
308
  return docFieldsToUpdate;
306
309
  }
@@ -114,6 +114,7 @@ class Product extends Base_1.default {
114
114
  : null,
115
115
  sellerLiquidatedTimestamp: (props === null || props === void 0 ? void 0 : props.sellerLiquidatedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.sellerLiquidatedTimestamp) : null,
116
116
  archivedTimestamp: (props === null || props === void 0 ? void 0 : props.archivedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.archivedTimestamp) : null,
117
+ liquidationReadyTimestamp: (props === null || props === void 0 ? void 0 : props.liquidationReadyTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.liquidationReadyTimestamp) : null,
117
118
  };
118
119
  }
119
120
  toPartialObj() {
@@ -279,6 +280,7 @@ class Product extends Base_1.default {
279
280
  liquidationRequestedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.liquidationRequestedTimestamp),
280
281
  sellerLiquidatedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.sellerLiquidatedTimestamp),
281
282
  archivedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.archivedTimestamp),
283
+ liquidationReadyTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.liquidationReadyTimestamp),
282
284
  selectedForClearance: this.utilities.sanitizeString(this.consignmentAttributes.selectedForClearance),
283
285
  availableForSale: !!this.attributes.availableForSale,
284
286
  color: this.utilities.sanitizeString(this.filterAttributes.color),
@@ -22,6 +22,7 @@ export default class ProductStateManager extends Base {
22
22
  soldSellerPaid: string;
23
23
  sellerSelfReject: string;
24
24
  liquidationRequested: string;
25
+ liquidationReady: string;
25
26
  sellerLiquidated: string;
26
27
  loading: string;
27
28
  shoppingBag: string;
@@ -371,6 +371,7 @@ ProductStateManager.PRODUCT_STATES = {
371
371
  soldSellerPaid: 'SOLD_SELLER_PAID',
372
372
  sellerSelfReject: 'SELLER_SELF_REJECT',
373
373
  liquidationRequested: 'LIQUIDATION_REQUESTED',
374
+ liquidationReady: 'LIQUIDATION_READY',
374
375
  sellerLiquidated: 'SELLER_LIQUIDATED',
375
376
  loading: 'LOADING',
376
377
  shoppingBag: 'IN_SHOPPING_BAG',
@@ -95,6 +95,7 @@ declare type ProductTimestampAttributes = {
95
95
  liquidationRequestedTimestamp: number | null;
96
96
  sellerLiquidatedTimestamp: number | null;
97
97
  archivedTimestamp: number | null;
98
+ liquidationReadyTimestamp: number | null;
98
99
  };
99
100
  declare type TranslatableAttributes = {
100
101
  description: string;
@@ -281,6 +282,7 @@ declare type TypesenseProductObj = {
281
282
  liquidationRequestedTimestamp: number;
282
283
  sellerLiquidatedTimestamp: number;
283
284
  archivedTimestamp: number;
285
+ liquidationReadyTimestamp: number;
284
286
  availableForSale: boolean;
285
287
  color: string;
286
288
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",