rerobe-js-orm 2.4.84 → 2.4.85

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;
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;
8
8
  const productAttributes = {
9
9
  availableForSale: props.fields.availableForSale.selectedValue,
10
10
  description: props.fields.description.inputValue,
@@ -79,26 +79,28 @@ class ProductFromFormState extends ProductFactory_1.default {
79
79
  inventoryLocations: props.fields.inventoryLocations.selectedValues || [],
80
80
  };
81
81
  const timestampAttributes = {
82
- sellRequestReviewTimestamp: (_s = props.props) === null || _s === void 0 ? void 0 : _s.sellRequestReviewTimestamp,
83
- sellRequestReviewDraftTimestamp: (_t = props.props) === null || _t === void 0 ? void 0 : _t.sellRequestReviewDraftTimestamp,
84
- rejectedTimestamp: (_u = props.props) === null || _u === void 0 ? void 0 : _u.rejectedTimestamp,
85
- holdTimestamp: (_v = props.props) === null || _v === void 0 ? void 0 : _v.holdTimestamp,
86
- acceptedTimestamp: (_w = props.props) === null || _w === void 0 ? void 0 : _w.acceptedTimestamp,
87
- sellerToDropOffTimestamp: (_x = props.props) === null || _x === void 0 ? void 0 : _x.sellerToDropOffTimestamp,
88
- sellerToShipTimestamp: (_y = props.props) === null || _y === void 0 ? void 0 : _y.sellerToShipTimestamp,
89
- sellerToGetPickUpTimestamp: (_z = props.props) === null || _z === void 0 ? void 0 : _z.sellerToGetPickUpTimestamp,
90
- qualityControlTimestamp: (_0 = props.props) === null || _0 === void 0 ? void 0 : _0.qualityControlTimestamp,
91
- pendingPublicationTimestamp: (_1 = props.props) === null || _1 === void 0 ? void 0 : _1.pendingPublicationTimestamp,
92
- listedTimestamp: (_2 = props.props) === null || _2 === void 0 ? void 0 : _2.listedTimestamp,
93
- clearanceTimestamp: (_3 = props.props) === null || _3 === void 0 ? void 0 : _3.clearanceTimestamp,
94
- reservedTimestamp: (_4 = props.props) === null || _4 === void 0 ? void 0 : _4.reservedTimestamp,
95
- soldTimestamp: (_5 = props.props) === null || _5 === void 0 ? void 0 : _5.soldTimestamp,
96
- returnedTimestamp: (_6 = props.props) === null || _6 === void 0 ? void 0 : _6.returnedTimestamp,
97
- soldSellerToBePaidTimestamp: (_7 = props.props) === null || _7 === void 0 ? void 0 : _7.soldSellerToBePaidTimestamp,
98
- soldSellerPaidTimestamp: (_8 = props.props) === null || _8 === void 0 ? void 0 : _8.soldSellerPaidTimestamp,
99
- sellerSelfRejectTimestamp: (_9 = props.props) === null || _9 === void 0 ? void 0 : _9.sellerSelfRejectTimestamp,
100
- liquidationRequestedTimestamp: (_10 = props.props) === null || _10 === void 0 ? void 0 : _10.liquidationRequestedTimestamp,
101
- sellerLiquidatedTimestamp: (_11 = props.props) === null || _11 === void 0 ? void 0 : _11.sellerLiquidatedTimestamp,
82
+ createdAtTimestamp: (_s = props.props) === null || _s === void 0 ? void 0 : _s.createdAtTimestamp,
83
+ updatedAtTimestamp: (_t = props.props) === null || _t === void 0 ? void 0 : _t.updatedAtTimestamp,
84
+ sellRequestReviewTimestamp: (_u = props.props) === null || _u === void 0 ? void 0 : _u.sellRequestReviewTimestamp,
85
+ sellRequestReviewDraftTimestamp: (_v = props.props) === null || _v === void 0 ? void 0 : _v.sellRequestReviewDraftTimestamp,
86
+ rejectedTimestamp: (_w = props.props) === null || _w === void 0 ? void 0 : _w.rejectedTimestamp,
87
+ holdTimestamp: (_x = props.props) === null || _x === void 0 ? void 0 : _x.holdTimestamp,
88
+ acceptedTimestamp: (_y = props.props) === null || _y === void 0 ? void 0 : _y.acceptedTimestamp,
89
+ sellerToDropOffTimestamp: (_z = props.props) === null || _z === void 0 ? void 0 : _z.sellerToDropOffTimestamp,
90
+ sellerToShipTimestamp: (_0 = props.props) === null || _0 === void 0 ? void 0 : _0.sellerToShipTimestamp,
91
+ sellerToGetPickUpTimestamp: (_1 = props.props) === null || _1 === void 0 ? void 0 : _1.sellerToGetPickUpTimestamp,
92
+ qualityControlTimestamp: (_2 = props.props) === null || _2 === void 0 ? void 0 : _2.qualityControlTimestamp,
93
+ pendingPublicationTimestamp: (_3 = props.props) === null || _3 === void 0 ? void 0 : _3.pendingPublicationTimestamp,
94
+ listedTimestamp: (_4 = props.props) === null || _4 === void 0 ? void 0 : _4.listedTimestamp,
95
+ clearanceTimestamp: (_5 = props.props) === null || _5 === void 0 ? void 0 : _5.clearanceTimestamp,
96
+ reservedTimestamp: (_6 = props.props) === null || _6 === void 0 ? void 0 : _6.reservedTimestamp,
97
+ soldTimestamp: (_7 = props.props) === null || _7 === void 0 ? void 0 : _7.soldTimestamp,
98
+ returnedTimestamp: (_8 = props.props) === null || _8 === void 0 ? void 0 : _8.returnedTimestamp,
99
+ soldSellerToBePaidTimestamp: (_9 = props.props) === null || _9 === void 0 ? void 0 : _9.soldSellerToBePaidTimestamp,
100
+ soldSellerPaidTimestamp: (_10 = props.props) === null || _10 === void 0 ? void 0 : _10.soldSellerPaidTimestamp,
101
+ sellerSelfRejectTimestamp: (_11 = props.props) === null || _11 === void 0 ? void 0 : _11.sellerSelfRejectTimestamp,
102
+ liquidationRequestedTimestamp: (_12 = props.props) === null || _12 === void 0 ? void 0 : _12.liquidationRequestedTimestamp,
103
+ sellerLiquidatedTimestamp: (_13 = props.props) === null || _13 === void 0 ? void 0 : _13.sellerLiquidatedTimestamp,
102
104
  };
103
105
  return new Product_1.default(Object.assign(Object.assign(Object.assign(Object.assign({}, productAttributes), productFilterAttributes), consignmentAttributes), timestampAttributes));
104
106
  }
@@ -226,7 +226,7 @@ class ReRobeProductHelpers {
226
226
  static createTimestampsForStates(productObj) {
227
227
  const docFieldsToUpdate = {};
228
228
  if (productObj) {
229
- const { dateSold, 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, } = productObj;
230
230
  if (status === ProductStateManager_1.default.PRODUCT_STATES.sellRequestReviewDraft && !sellRequestReviewDraftTimestamp) {
231
231
  docFieldsToUpdate.sellRequestReviewDraftTimestamp = new Date().getTime();
232
232
  }
@@ -83,6 +83,8 @@ class Product extends Base_1.default {
83
83
  inventoryLocations: (props === null || props === void 0 ? void 0 : props.inventoryLocations) || [],
84
84
  };
85
85
  this.timestampAttributes = {
86
+ createdAtTimestamp: (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.createdAtTimestamp) : null,
87
+ updatedAtTimestamp: (props === null || props === void 0 ? void 0 : props.updatedAtTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.updatedAtTimestamp) : null,
86
88
  sellRequestReviewDraftTimestamp: (props === null || props === void 0 ? void 0 : props.sellRequestReviewDraftTimestamp)
87
89
  ? Number(props === null || props === void 0 ? void 0 : props.sellRequestReviewDraftTimestamp)
88
90
  : null,
@@ -72,6 +72,8 @@ declare type ProductConsignmentAttributes = {
72
72
  inventoryLocations: InventoryLocation[];
73
73
  };
74
74
  declare type ProductTimestampAttributes = {
75
+ createdAtTimestamp: number | null;
76
+ updatedAtTimestamp: number | null;
75
77
  sellRequestReviewTimestamp: number | null;
76
78
  sellRequestReviewDraftTimestamp: number | null;
77
79
  rejectedTimestamp: number | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.4.84",
3
+ "version": "2.4.85",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",