rerobe-js-orm 2.6.98 → 2.7.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.
package/lib/models/ChatRoom.js
CHANGED
package/lib/models/Order.js
CHANGED
|
@@ -280,6 +280,11 @@ class Order extends Base_1.default {
|
|
|
280
280
|
name: 'productIds',
|
|
281
281
|
type: 'string[]',
|
|
282
282
|
},
|
|
283
|
+
{
|
|
284
|
+
facet: true,
|
|
285
|
+
name: 'tags',
|
|
286
|
+
type: 'string[]',
|
|
287
|
+
},
|
|
283
288
|
{
|
|
284
289
|
facet: true,
|
|
285
290
|
name: 'productTitles',
|
|
@@ -300,7 +305,9 @@ class Order extends Base_1.default {
|
|
|
300
305
|
};
|
|
301
306
|
}
|
|
302
307
|
toObjForTypesense() {
|
|
303
|
-
|
|
308
|
+
const image = this.lineItems && this.lineItems[0] && this.lineItems[0].image && this.lineItems[0].image.originalSrc
|
|
309
|
+
? this.lineItems[0].image.originalSrc
|
|
310
|
+
: 'https://res.cloudinary.com/ribbn/image/fetch/e_blur:1000,o_20,q_50/https://cdn.shopify.com/s/files/1/0261/9686/9172/products/7AC16810-F519-4665-8891-7163EB29FBB7_1000x1000.jpg%3Fv%3D1634827512';
|
|
304
311
|
const stagedObj = {
|
|
305
312
|
id: this.utilities.sanitizeString(this.documentId),
|
|
306
313
|
documentId: this.utilities.sanitizeString(this.documentId),
|
|
@@ -308,11 +315,11 @@ class Order extends Base_1.default {
|
|
|
308
315
|
createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
|
|
309
316
|
updatedAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.updatedAtTimestamp),
|
|
310
317
|
merchantId: this.utilities.sanitizeString(this.merchantId),
|
|
311
|
-
image: this.utilities.sanitizeString(
|
|
318
|
+
image: this.utilities.sanitizeString(image),
|
|
312
319
|
orderNumber: this.utilities.sanitizeNumber(this.orderNumber),
|
|
313
320
|
customerName: this.utilities.sanitizeString(this.customerName),
|
|
314
321
|
customerEmail: this.utilities.sanitizeString(this.email),
|
|
315
|
-
totalPrice: this.utilities.sanitizeNumber(this.totalPrice.amount),
|
|
322
|
+
totalPrice: this.utilities.sanitizeNumber(Number(this.totalPrice.amount) - Number(this.totalRefunded.amount)),
|
|
316
323
|
state: this.utilities.sanitizeString(this.state),
|
|
317
324
|
financialStatus: this.utilities.sanitizeString(this.financialStatus),
|
|
318
325
|
fulfillmentStatus: this.utilities.sanitizeString(this.fulfillmentStatus),
|
|
@@ -322,6 +329,7 @@ class Order extends Base_1.default {
|
|
|
322
329
|
productIds: this.utilities.sanitzeStringArr(this.lineItems.map((l) => l.productId)),
|
|
323
330
|
productTitles: this.utilities.sanitzeStringArr(this.lineItems.map((l) => l.title)),
|
|
324
331
|
productBrands: this.utilities.sanitzeStringArr(this.lineItems.map((l) => l.brand)),
|
|
332
|
+
tags: this.utilities.sanitzeStringArr(this.tags),
|
|
325
333
|
};
|
|
326
334
|
return stagedObj;
|
|
327
335
|
}
|
package/lib/models/User.js
CHANGED
|
@@ -164,7 +164,7 @@ class User extends Base_1.default {
|
|
|
164
164
|
};
|
|
165
165
|
return customerInput;
|
|
166
166
|
}
|
|
167
|
-
generateSchemaForTypesense(name = '
|
|
167
|
+
generateSchemaForTypesense(name = 'dev_customers_20220811') {
|
|
168
168
|
return {
|
|
169
169
|
default_sorting_field: 'createdAtTimestamp',
|
|
170
170
|
fields: [
|
|
@@ -229,7 +229,7 @@ class User extends Base_1.default {
|
|
|
229
229
|
type: 'string',
|
|
230
230
|
},
|
|
231
231
|
],
|
|
232
|
-
name: '
|
|
232
|
+
name: 'prod_customers_20220811',
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
235
|
toObjForTypesense(merchantId) {
|