rerobe-js-orm 2.5.0 → 2.5.1

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.
@@ -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, } = 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;
230
230
  if (status === ProductStateManager_1.default.PRODUCT_STATES.sellRequestReviewDraft && !sellRequestReviewDraftTimestamp) {
231
231
  docFieldsToUpdate.sellRequestReviewDraftTimestamp = new Date().getTime();
232
232
  }
@@ -298,6 +298,9 @@ class ReRobeProductHelpers {
298
298
  if (status === ProductStateManager_1.default.PRODUCT_STATES.sellerLiquidated && !sellerLiquidatedTimestamp) {
299
299
  docFieldsToUpdate.sellerLiquidatedTimestamp = new Date().getTime();
300
300
  }
301
+ if (status === ProductStateManager_1.default.PRODUCT_STATES.archived && !archivedTimestamp) {
302
+ docFieldsToUpdate.archivedTimestamp = new Date().getTime();
303
+ }
301
304
  }
302
305
  return docFieldsToUpdate;
303
306
  }
@@ -113,6 +113,7 @@ class Product extends Base_1.default {
113
113
  ? Number(props === null || props === void 0 ? void 0 : props.liquidationRequestedTimestamp)
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
+ archivedTimestamp: (props === null || props === void 0 ? void 0 : props.archivedTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.archivedTimestamp) : null,
116
117
  };
117
118
  }
118
119
  toPartialObj() {
@@ -277,6 +278,7 @@ class Product extends Base_1.default {
277
278
  sellerSelfRejectTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.sellerSelfRejectTimestamp),
278
279
  liquidationRequestedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.liquidationRequestedTimestamp),
279
280
  sellerLiquidatedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.sellerLiquidatedTimestamp),
281
+ archivedTimestamp: this.utilities.sanitizeMillisTimeStamp(this.timestampAttributes.archivedTimestamp),
280
282
  selectedForClearance: this.utilities.sanitizeString(this.consignmentAttributes.selectedForClearance),
281
283
  availableForSale: !!this.attributes.availableForSale,
282
284
  color: this.utilities.sanitizeString(this.filterAttributes.color),
@@ -410,7 +412,7 @@ class Product extends Base_1.default {
410
412
  return acc;
411
413
  }, '');
412
414
  }
413
- generateSchemaForTypesense(name = 'prod_products_20210108') {
415
+ generateSchemaForTypesense(name = 'prod_products_20220503') {
414
416
  return {
415
417
  default_sorting_field: 'createdAtTimestamp',
416
418
  fields: [
@@ -550,18 +552,18 @@ class Product extends Base_1.default {
550
552
  type: 'string',
551
553
  },
552
554
  {
553
- facet: false,
555
+ facet: true,
554
556
  optional: true,
555
557
  name: '.*Timestamp',
556
558
  type: 'int32',
557
559
  },
558
560
  {
559
- facet: false,
561
+ facet: true,
560
562
  name: 'createdAtTimestamp',
561
563
  type: 'int32',
562
564
  },
563
565
  {
564
- facet: false,
566
+ facet: true,
565
567
  name: 'updatedAtTimestamp',
566
568
  type: 'int32',
567
569
  },
@@ -94,6 +94,7 @@ declare type ProductTimestampAttributes = {
94
94
  sellerSelfRejectTimestamp: number | null;
95
95
  liquidationRequestedTimestamp: number | null;
96
96
  sellerLiquidatedTimestamp: number | null;
97
+ archivedTimestamp: number | null;
97
98
  };
98
99
  declare type TranslatableAttributes = {
99
100
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",