rerobe-js-orm 2.6.93 → 2.6.96
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.
|
@@ -95,6 +95,8 @@ class OrderFromFormState extends OrderFactory_1.default {
|
|
|
95
95
|
totalRefundedPresentment: fs.props.totalRefundedPresentment,
|
|
96
96
|
totalShippingPricePresentment: fs.props.totalShippingPricePresentment,
|
|
97
97
|
totalTaxPresentment: fs.props.totalTaxPresentment,
|
|
98
|
+
createdAtTimestamp: 0,
|
|
99
|
+
updatedAtTimestamp: 0,
|
|
98
100
|
};
|
|
99
101
|
return new Order_1.default(Object.assign({}, orderAttributes));
|
|
100
102
|
}
|
package/lib/models/Order.d.ts
CHANGED
|
@@ -88,6 +88,18 @@ export default class Order extends Base {
|
|
|
88
88
|
totalRefundedPresentment: Money;
|
|
89
89
|
totalShippingPricePresentment: Money;
|
|
90
90
|
totalTaxPresentment: Money;
|
|
91
|
+
createdAtTimestamp: number;
|
|
92
|
+
updatedAtTimestamp: number;
|
|
91
93
|
constructor(props?: any);
|
|
92
94
|
toObj(): ReRobeOrderObj;
|
|
95
|
+
generateSchemaForTypesense(name?: string): {
|
|
96
|
+
default_sorting_field: string;
|
|
97
|
+
fields: {
|
|
98
|
+
facet: boolean;
|
|
99
|
+
name: string;
|
|
100
|
+
type: string;
|
|
101
|
+
}[];
|
|
102
|
+
name: string;
|
|
103
|
+
};
|
|
104
|
+
toObjForTypesense(): TypesenseOrderObj;
|
|
93
105
|
}
|
package/lib/models/Order.js
CHANGED
|
@@ -124,6 +124,8 @@ class Order extends Base_1.default {
|
|
|
124
124
|
this.totalTaxPresentment = (props === null || props === void 0 ? void 0 : props.totalTaxPresentment) || {
|
|
125
125
|
amount: 0,
|
|
126
126
|
};
|
|
127
|
+
this.createdAtTimestamp = (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) || 0;
|
|
128
|
+
this.updatedAtTimestamp = (props === null || props === void 0 ? void 0 : props.updatedAtTimestamp) || 0;
|
|
127
129
|
}
|
|
128
130
|
toObj() {
|
|
129
131
|
const orderObj = {
|
|
@@ -175,6 +177,8 @@ class Order extends Base_1.default {
|
|
|
175
177
|
totalRefundedPresentment: this.totalRefundedPresentment,
|
|
176
178
|
totalShippingPricePresentment: this.totalShippingPricePresentment,
|
|
177
179
|
totalTaxPresentment: this.totalTaxPresentment,
|
|
180
|
+
createdAtTimestamp: this.createdAtTimestamp,
|
|
181
|
+
updatedAtTimestamp: this.updatedAtTimestamp,
|
|
178
182
|
};
|
|
179
183
|
if (this.paymentType) {
|
|
180
184
|
orderObj.paymentType = this.paymentType;
|
|
@@ -187,6 +191,134 @@ class Order extends Base_1.default {
|
|
|
187
191
|
}
|
|
188
192
|
return orderObj;
|
|
189
193
|
}
|
|
194
|
+
generateSchemaForTypesense(name = 'prod_orders_20220809') {
|
|
195
|
+
return {
|
|
196
|
+
default_sorting_field: 'createdAtTimestamp',
|
|
197
|
+
fields: [
|
|
198
|
+
{
|
|
199
|
+
facet: false,
|
|
200
|
+
name: 'id',
|
|
201
|
+
type: 'string',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
facet: false,
|
|
205
|
+
name: 'documentId',
|
|
206
|
+
type: 'string',
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
facet: false,
|
|
210
|
+
name: 'userId',
|
|
211
|
+
type: 'string',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
facet: true,
|
|
215
|
+
name: 'createdAtTimestamp',
|
|
216
|
+
type: 'int64',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
facet: true,
|
|
220
|
+
name: 'updatedAtTimestamp',
|
|
221
|
+
type: 'int64',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
facet: false,
|
|
225
|
+
name: 'image',
|
|
226
|
+
type: 'string',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
facet: true,
|
|
230
|
+
name: 'orderNumber',
|
|
231
|
+
type: 'int32',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
facet: true,
|
|
235
|
+
name: 'customerName',
|
|
236
|
+
type: 'string',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
facet: true,
|
|
240
|
+
name: 'customerEmail',
|
|
241
|
+
type: 'string',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
facet: true,
|
|
245
|
+
name: 'totalPrice',
|
|
246
|
+
type: 'float',
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
facet: true,
|
|
250
|
+
name: 'state',
|
|
251
|
+
type: 'string',
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
facet: true,
|
|
255
|
+
name: 'financialStatus',
|
|
256
|
+
type: 'string',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
facet: true,
|
|
260
|
+
name: 'fulfillmentStatus',
|
|
261
|
+
type: 'string',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
facet: true,
|
|
265
|
+
name: 'salesChannel',
|
|
266
|
+
type: 'string',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
facet: true,
|
|
270
|
+
name: 'paymentType',
|
|
271
|
+
type: 'string',
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
facet: true,
|
|
275
|
+
name: 'productIds',
|
|
276
|
+
type: 'string[]',
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
facet: true,
|
|
280
|
+
name: 'productTitles',
|
|
281
|
+
type: 'string[]',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
facet: true,
|
|
285
|
+
name: 'productBrands',
|
|
286
|
+
type: 'string[]',
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
facet: true,
|
|
290
|
+
name: 'merchantId',
|
|
291
|
+
type: 'string',
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
name: 'prod_orders_20220809',
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
toObjForTypesense() {
|
|
298
|
+
var _a;
|
|
299
|
+
const stagedObj = {
|
|
300
|
+
id: this.utilities.sanitizeString(this.documentId),
|
|
301
|
+
documentId: this.utilities.sanitizeString(this.documentId),
|
|
302
|
+
userId: this.utilities.sanitizeString(this.userId),
|
|
303
|
+
createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
|
|
304
|
+
updatedAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.updatedAtTimestamp),
|
|
305
|
+
merchantId: this.utilities.sanitizeString(this.merchantId),
|
|
306
|
+
image: this.utilities.sanitizeString((_a = this.lineItems[0].image) === null || _a === void 0 ? void 0 : _a.originalSrc),
|
|
307
|
+
orderNumber: this.utilities.sanitizeNumber(this.orderNumber),
|
|
308
|
+
customerName: this.utilities.sanitizeString(this.customerName),
|
|
309
|
+
customerEmail: this.utilities.sanitizeString(this.email),
|
|
310
|
+
totalPrice: this.utilities.sanitizeNumber(this.totalPrice.amount),
|
|
311
|
+
state: this.utilities.sanitizeString(this.state),
|
|
312
|
+
financialStatus: this.utilities.sanitizeString(this.financialStatus),
|
|
313
|
+
fulfillmentStatus: this.utilities.sanitizeString(this.fulfillmentStatus),
|
|
314
|
+
salesChannel: this.utilities.sanitizeString(this.salesChannel),
|
|
315
|
+
paymentType: this.utilities.sanitizeString(this.paymentType),
|
|
316
|
+
productIds: this.utilities.sanitzeStringArr(this.lineItems.map((l) => l.productId)),
|
|
317
|
+
productTitles: this.utilities.sanitzeStringArr(this.lineItems.map((l) => l.title)),
|
|
318
|
+
productBrands: this.utilities.sanitzeStringArr(this.lineItems.map((l) => l.brand)),
|
|
319
|
+
};
|
|
320
|
+
return stagedObj;
|
|
321
|
+
}
|
|
190
322
|
}
|
|
191
323
|
exports.default = Order;
|
|
192
324
|
Order.SHIPPING_TYPES = order_constants_1.SHIPPING_TYPES;
|
|
@@ -69,6 +69,8 @@ declare type ReRobeOrderObj = {
|
|
|
69
69
|
totalRefundedPresentment?: Money;
|
|
70
70
|
totalShippingPricePresentment?: Money;
|
|
71
71
|
totalTaxPresentment?: Money;
|
|
72
|
+
createdAtTimestamp: number;
|
|
73
|
+
updatedAtTimestamp: number;
|
|
72
74
|
};
|
|
73
75
|
declare type OrderWithRefundsAndFulfillmentsInfoObj = {
|
|
74
76
|
documentId?: string;
|
|
@@ -675,3 +677,24 @@ declare type OrderRefundFormFields = {
|
|
|
675
677
|
refundLineItems: MultiSelectFormField<RefundLineItem>;
|
|
676
678
|
note: TextInputFormField<string>;
|
|
677
679
|
};
|
|
680
|
+
declare type TypesenseOrderObj = {
|
|
681
|
+
id: string;
|
|
682
|
+
documentId: string;
|
|
683
|
+
userId: string;
|
|
684
|
+
createdAtTimestamp: number;
|
|
685
|
+
updatedAtTimestamp: number;
|
|
686
|
+
image: string;
|
|
687
|
+
orderNumber: number;
|
|
688
|
+
customerName: string;
|
|
689
|
+
customerEmail: string;
|
|
690
|
+
totalPrice: number;
|
|
691
|
+
state: string;
|
|
692
|
+
financialStatus: string;
|
|
693
|
+
fulfillmentStatus: string;
|
|
694
|
+
salesChannel: string;
|
|
695
|
+
paymentType: string;
|
|
696
|
+
productIds: string[];
|
|
697
|
+
productTitles: string[];
|
|
698
|
+
productBrands: string[];
|
|
699
|
+
merchantId: string;
|
|
700
|
+
};
|