rerobe-js-orm 2.6.1 → 2.6.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.
- package/lib/helpers/ReRobeProductHelpers.js +26 -26
- package/lib/models/ChatRoom.d.ts +2 -0
- package/lib/models/ChatRoom.js +16 -1
- package/lib/models/ProductCollection.d.ts +17 -0
- package/lib/models/ProductCollection.js +167 -0
- package/lib/types/product-collection-types.d.ts +26 -0
- package/lib/types/rerobe-chatroom-types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
// @ts-ignore
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const options_1 = require("../form-states/Product/options");
|
|
6
|
-
const
|
|
6
|
+
const product_constants_1 = require("../constants/product-constants");
|
|
7
7
|
class ReRobeProductHelpers {
|
|
8
8
|
static calculateProductionFee(commission) {
|
|
9
9
|
if (commission === 0.16) {
|
|
@@ -197,13 +197,13 @@ class ReRobeProductHelpers {
|
|
|
197
197
|
static prepareProductForMutation(productObj, mediaInputArr = []) {
|
|
198
198
|
const productObjClone = Object.assign({}, productObj);
|
|
199
199
|
const { status, dateInQualityControl, dateInPendingPublication, dateListedOnline, publishedAt, price } = productObj;
|
|
200
|
-
if (status ===
|
|
200
|
+
if (status === product_constants_1.PRODUCT_STATES.qualityControl && !dateInQualityControl) {
|
|
201
201
|
productObjClone.dateInQualityControl = new Date().toISOString().split('T')[0];
|
|
202
202
|
}
|
|
203
|
-
if (status ===
|
|
203
|
+
if (status === product_constants_1.PRODUCT_STATES.pendingPublication && !dateInPendingPublication) {
|
|
204
204
|
productObjClone.dateInPendingPublication = new Date().toISOString().split('T')[0];
|
|
205
205
|
}
|
|
206
|
-
if (status ===
|
|
206
|
+
if (status === product_constants_1.PRODUCT_STATES.listed && !dateListedOnline) {
|
|
207
207
|
productObjClone.dateListedOnline = publishedAt
|
|
208
208
|
? new Date(publishedAt).toISOString().split('T')[0]
|
|
209
209
|
: new Date().toISOString().split('T')[0];
|
|
@@ -227,56 +227,56 @@ class ReRobeProductHelpers {
|
|
|
227
227
|
const docFieldsToUpdate = {};
|
|
228
228
|
if (productObj) {
|
|
229
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
|
-
if (status ===
|
|
230
|
+
if (status === product_constants_1.PRODUCT_STATES.sellRequestReviewDraft && !sellRequestReviewDraftTimestamp) {
|
|
231
231
|
docFieldsToUpdate.sellRequestReviewDraftTimestamp = new Date().getTime();
|
|
232
232
|
}
|
|
233
|
-
if (status ===
|
|
233
|
+
if (status === product_constants_1.PRODUCT_STATES.sellRequestReview && !sellRequestReviewTimestamp) {
|
|
234
234
|
docFieldsToUpdate.sellRequestReviewTimestamp = new Date().getTime();
|
|
235
235
|
}
|
|
236
|
-
if (status ===
|
|
236
|
+
if (status === product_constants_1.PRODUCT_STATES.rejected && !rejectedTimestamp) {
|
|
237
237
|
docFieldsToUpdate.rejectedTimestamp = new Date().getTime();
|
|
238
238
|
}
|
|
239
|
-
if (status ===
|
|
239
|
+
if (status === product_constants_1.PRODUCT_STATES.hold && !holdTimestamp) {
|
|
240
240
|
docFieldsToUpdate.holdTimestamp = new Date().getTime();
|
|
241
241
|
}
|
|
242
|
-
if (status ===
|
|
242
|
+
if (status === product_constants_1.PRODUCT_STATES.accepted && !acceptedTimestamp) {
|
|
243
243
|
docFieldsToUpdate.acceptedTimestamp = new Date().getTime();
|
|
244
244
|
}
|
|
245
|
-
if (status ===
|
|
245
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerToDropOff && !sellerToDropOffTimestamp) {
|
|
246
246
|
docFieldsToUpdate.sellerToDropOffTimestamp = new Date().getTime();
|
|
247
247
|
}
|
|
248
|
-
if (status ===
|
|
248
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerToShip && !sellerToShipTimestamp) {
|
|
249
249
|
docFieldsToUpdate.sellerToShipTimestamp = new Date().getTime();
|
|
250
250
|
}
|
|
251
|
-
if (status ===
|
|
251
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerToGetPickUp && !sellerToGetPickUpTimestamp) {
|
|
252
252
|
docFieldsToUpdate.sellerToGetPickUpTimestamp = new Date().getTime();
|
|
253
253
|
}
|
|
254
|
-
if (status ===
|
|
254
|
+
if (status === product_constants_1.PRODUCT_STATES.qualityControl && !qualityControlTimestamp) {
|
|
255
255
|
docFieldsToUpdate.qualityControlTimestamp = new Date().getTime();
|
|
256
256
|
}
|
|
257
|
-
if (status ===
|
|
257
|
+
if (status === product_constants_1.PRODUCT_STATES.pendingPublication && !pendingPublicationTimestamp) {
|
|
258
258
|
docFieldsToUpdate.pendingPublicationTimestamp = new Date().getTime();
|
|
259
259
|
}
|
|
260
|
-
if (status ===
|
|
260
|
+
if (status === product_constants_1.PRODUCT_STATES.listed && !listedTimestamp) {
|
|
261
261
|
docFieldsToUpdate.listedTimestamp = new Date().getTime();
|
|
262
262
|
}
|
|
263
|
-
if (status ===
|
|
263
|
+
if (status === product_constants_1.PRODUCT_STATES.clearance && !clearanceTimestamp) {
|
|
264
264
|
docFieldsToUpdate.clearanceTimestamp = new Date().getTime();
|
|
265
265
|
}
|
|
266
|
-
if (status ===
|
|
266
|
+
if (status === product_constants_1.PRODUCT_STATES.reserved && !reservedTimestamp) {
|
|
267
267
|
docFieldsToUpdate.reservedTimestamp = new Date().getTime();
|
|
268
268
|
}
|
|
269
|
-
if (status ===
|
|
269
|
+
if (status === product_constants_1.PRODUCT_STATES.sold && !soldTimestamp) {
|
|
270
270
|
docFieldsToUpdate.soldTimestamp = new Date().getTime();
|
|
271
271
|
}
|
|
272
|
-
if (status ===
|
|
272
|
+
if (status === product_constants_1.PRODUCT_STATES.soldSellerToBePaid && !soldSellerToBePaidTimestamp) {
|
|
273
273
|
const timeNow = new Date().getTime();
|
|
274
274
|
docFieldsToUpdate.soldSellerToBePaidTimestamp = timeNow;
|
|
275
275
|
if (!soldTimestamp) {
|
|
276
276
|
docFieldsToUpdate.soldTimestamp = timeNow;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
if (status ===
|
|
279
|
+
if (status === product_constants_1.PRODUCT_STATES.soldSellerPaid && !soldSellerPaidTimestamp) {
|
|
280
280
|
const timeNow = new Date().getTime();
|
|
281
281
|
docFieldsToUpdate.soldSellerPaidTimestamp = timeNow;
|
|
282
282
|
if (!soldSellerToBePaidTimestamp) {
|
|
@@ -286,22 +286,22 @@ class ReRobeProductHelpers {
|
|
|
286
286
|
docFieldsToUpdate.soldTimestamp = timeNow;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
if (status ===
|
|
289
|
+
if (status === product_constants_1.PRODUCT_STATES.returned && !returnedTimestamp) {
|
|
290
290
|
docFieldsToUpdate.returnedTimestamp = new Date().getTime();
|
|
291
291
|
}
|
|
292
|
-
if (status ===
|
|
292
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerSelfReject && !sellerSelfRejectTimestamp) {
|
|
293
293
|
docFieldsToUpdate.sellerSelfRejectTimestamp = new Date().getTime();
|
|
294
294
|
}
|
|
295
|
-
if (status ===
|
|
295
|
+
if (status === product_constants_1.PRODUCT_STATES.liquidationRequested && !liquidationRequestedTimestamp) {
|
|
296
296
|
docFieldsToUpdate.liquidationRequestedTimestamp = new Date().getTime();
|
|
297
297
|
}
|
|
298
|
-
if (status ===
|
|
298
|
+
if (status === product_constants_1.PRODUCT_STATES.sellerLiquidated && !sellerLiquidatedTimestamp) {
|
|
299
299
|
docFieldsToUpdate.sellerLiquidatedTimestamp = new Date().getTime();
|
|
300
300
|
}
|
|
301
|
-
if (status ===
|
|
301
|
+
if (status === product_constants_1.PRODUCT_STATES.archived && !archivedTimestamp) {
|
|
302
302
|
docFieldsToUpdate.archivedTimestamp = new Date().getTime();
|
|
303
303
|
}
|
|
304
|
-
if (status ===
|
|
304
|
+
if (status === product_constants_1.PRODUCT_STATES.liquidationReady && !liquidationReadyTimestamp) {
|
|
305
305
|
docFieldsToUpdate.liquidationReadyTimestamp = new Date().getTime();
|
|
306
306
|
}
|
|
307
307
|
}
|
package/lib/models/ChatRoom.d.ts
CHANGED
package/lib/models/ChatRoom.js
CHANGED
|
@@ -5,6 +5,8 @@ class ChatRoom extends Base_1.default {
|
|
|
5
5
|
constructor(props) {
|
|
6
6
|
super();
|
|
7
7
|
this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
|
|
8
|
+
this.createdAt = (props === null || props === void 0 ? void 0 : props.createdAt) || '';
|
|
9
|
+
this.createdAtTimestamp = (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) || 0;
|
|
8
10
|
this.userIdsToBeNotified = (props === null || props === void 0 ? void 0 : props.userIdsToBeNotified) || [];
|
|
9
11
|
this.type = (props === null || props === void 0 ? void 0 : props.type) || 'CUSTOMER_SUPPORT';
|
|
10
12
|
this.lastMessage = (props === null || props === void 0 ? void 0 : props.lastMessage) || {};
|
|
@@ -15,6 +17,8 @@ class ChatRoom extends Base_1.default {
|
|
|
15
17
|
toObj() {
|
|
16
18
|
return {
|
|
17
19
|
documentId: this.documentId,
|
|
20
|
+
createdAt: this.createdAt,
|
|
21
|
+
createdAtTimestamp: this.createdAtTimestamp,
|
|
18
22
|
userIdsToBeNotified: this.userIdsToBeNotified,
|
|
19
23
|
type: this.type,
|
|
20
24
|
lastMessage: this.lastMessage,
|
|
@@ -32,6 +36,11 @@ class ChatRoom extends Base_1.default {
|
|
|
32
36
|
name: 'documentId',
|
|
33
37
|
type: 'string',
|
|
34
38
|
},
|
|
39
|
+
{
|
|
40
|
+
facet: true,
|
|
41
|
+
name: 'createdAtTimestamp',
|
|
42
|
+
type: 'int64',
|
|
43
|
+
},
|
|
35
44
|
{
|
|
36
45
|
facet: true,
|
|
37
46
|
name: 'type',
|
|
@@ -62,6 +71,11 @@ class ChatRoom extends Base_1.default {
|
|
|
62
71
|
name: 'lastMessage.content',
|
|
63
72
|
type: 'string',
|
|
64
73
|
},
|
|
74
|
+
{
|
|
75
|
+
facet: true,
|
|
76
|
+
name: 'createdAtTimestamp',
|
|
77
|
+
type: 'int64',
|
|
78
|
+
},
|
|
65
79
|
{
|
|
66
80
|
facet: true,
|
|
67
81
|
name: 'lastMessage.createdAtTimestamp',
|
|
@@ -83,7 +97,7 @@ class ChatRoom extends Base_1.default {
|
|
|
83
97
|
type: 'string',
|
|
84
98
|
},
|
|
85
99
|
],
|
|
86
|
-
name,
|
|
100
|
+
name: 'dev_chatRooms_20220725',
|
|
87
101
|
};
|
|
88
102
|
}
|
|
89
103
|
toObjForTypesense() {
|
|
@@ -98,6 +112,7 @@ class ChatRoom extends Base_1.default {
|
|
|
98
112
|
}, []);
|
|
99
113
|
const stagedObj = {
|
|
100
114
|
documentId: this.utilities.sanitizeString(this.documentId),
|
|
115
|
+
createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
|
|
101
116
|
type: this.utilities.sanitizeString(this.type),
|
|
102
117
|
userIds: this.utilities.sanitzeStringArr(this.userIds),
|
|
103
118
|
userIdsToBeNotified: this.utilities.sanitzeStringArr(this.userIdsToBeNotified),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Base from '../Base';
|
|
2
2
|
export default class ProductCollection extends Base {
|
|
3
3
|
documentId: string;
|
|
4
|
+
createdAtTimestamp: number;
|
|
4
5
|
preTitle: string;
|
|
5
6
|
title: string;
|
|
6
7
|
subTitle: string;
|
|
@@ -12,4 +13,20 @@ export default class ProductCollection extends Base {
|
|
|
12
13
|
collectionId: string;
|
|
13
14
|
constructor(props?: any);
|
|
14
15
|
toObj(): ProductCollectionType;
|
|
16
|
+
generateSchemaForTypesense(name?: string): {
|
|
17
|
+
default_sorting_field: string;
|
|
18
|
+
fields: ({
|
|
19
|
+
facet: boolean;
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
optional?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
facet: boolean;
|
|
25
|
+
optional: boolean;
|
|
26
|
+
name: string;
|
|
27
|
+
type: string;
|
|
28
|
+
})[];
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
toObjForTypesense(): TypesenseProductCollectionObj;
|
|
15
32
|
}
|
|
@@ -5,6 +5,7 @@ class ProductCollection extends Base_1.default {
|
|
|
5
5
|
constructor(props) {
|
|
6
6
|
super();
|
|
7
7
|
this.documentId = (props === null || props === void 0 ? void 0 : props.documentId) || this.utilities.makeRandId(28);
|
|
8
|
+
this.createdAtTimestamp = (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) || 0;
|
|
8
9
|
this.preTitle = (props === null || props === void 0 ? void 0 : props.preTitle) || '';
|
|
9
10
|
this.title = (props === null || props === void 0 ? void 0 : props.title) || '';
|
|
10
11
|
this.subTitle = (props === null || props === void 0 ? void 0 : props.subTitle) || '';
|
|
@@ -18,6 +19,7 @@ class ProductCollection extends Base_1.default {
|
|
|
18
19
|
toObj() {
|
|
19
20
|
const productCollectionObj = {
|
|
20
21
|
documentId: this.documentId,
|
|
22
|
+
createdAtTimestamp: this.createdAtTimestamp,
|
|
21
23
|
preTitle: this.preTitle,
|
|
22
24
|
title: this.title,
|
|
23
25
|
subTitle: this.subTitle,
|
|
@@ -30,5 +32,170 @@ class ProductCollection extends Base_1.default {
|
|
|
30
32
|
};
|
|
31
33
|
return productCollectionObj;
|
|
32
34
|
}
|
|
35
|
+
generateSchemaForTypesense(name = 'prod_productCollections_20220722') {
|
|
36
|
+
return {
|
|
37
|
+
default_sorting_field: 'createdAtTimestamp',
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
facet: false,
|
|
41
|
+
name: 'documentId',
|
|
42
|
+
type: 'string',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
facet: true,
|
|
46
|
+
name: 'createdAtTimestamp',
|
|
47
|
+
type: 'int64',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
facet: true,
|
|
51
|
+
name: 'title',
|
|
52
|
+
type: 'string',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
facet: true,
|
|
56
|
+
name: 'preTitle',
|
|
57
|
+
type: 'string',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
facet: true,
|
|
61
|
+
name: 'subTitle',
|
|
62
|
+
type: 'string',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
facet: false,
|
|
66
|
+
name: 'description',
|
|
67
|
+
type: 'string',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
facet: true,
|
|
71
|
+
name: 'type',
|
|
72
|
+
type: 'string',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
facet: false,
|
|
76
|
+
name: 'imgUrl',
|
|
77
|
+
type: 'string',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
facet: true,
|
|
81
|
+
optional: true,
|
|
82
|
+
name: 'refinements.brandRefinement',
|
|
83
|
+
type: 'string[]',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
facet: true,
|
|
87
|
+
optional: true,
|
|
88
|
+
name: 'refinements.clothingSizeRefinement',
|
|
89
|
+
type: 'string[]',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
facet: true,
|
|
93
|
+
optional: true,
|
|
94
|
+
name: 'refinements.colorRefinement',
|
|
95
|
+
type: 'string[]',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
facet: true,
|
|
99
|
+
optional: true,
|
|
100
|
+
name: 'refinements.conditionRefinement',
|
|
101
|
+
type: 'string[]',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
facet: true,
|
|
105
|
+
optional: true,
|
|
106
|
+
name: 'refinements.genderRefinement',
|
|
107
|
+
type: 'string[]',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
facet: true,
|
|
111
|
+
optional: true,
|
|
112
|
+
name: 'refinements.jeanSizeRefinement',
|
|
113
|
+
type: 'string[]',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
facet: true,
|
|
117
|
+
optional: true,
|
|
118
|
+
name: 'refinements.materialCompositionRefinement',
|
|
119
|
+
type: 'string[]',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
facet: true,
|
|
123
|
+
optional: true,
|
|
124
|
+
name: 'refinements.priceRangeRefinement',
|
|
125
|
+
type: 'string[]',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
facet: true,
|
|
129
|
+
optional: true,
|
|
130
|
+
name: 'refinements.productCategoryRefinement',
|
|
131
|
+
type: 'string[]',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
facet: true,
|
|
135
|
+
optional: true,
|
|
136
|
+
name: 'refinements.productTypeRefinement',
|
|
137
|
+
type: 'string[]',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
facet: true,
|
|
141
|
+
optional: true,
|
|
142
|
+
name: 'refinements.productStyleRefinement',
|
|
143
|
+
type: 'string[]',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
facet: true,
|
|
147
|
+
optional: true,
|
|
148
|
+
name: 'refinements.shoeSizeRefinement',
|
|
149
|
+
type: 'string[]',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
facet: true,
|
|
153
|
+
optional: true,
|
|
154
|
+
name: 'refinements.statusRefinement',
|
|
155
|
+
type: 'string[]',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
facet: true,
|
|
159
|
+
optional: true,
|
|
160
|
+
name: 'refinements.salesChannelRefinement',
|
|
161
|
+
type: 'string[]',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
facet: false,
|
|
165
|
+
name: 'tags',
|
|
166
|
+
type: 'string[]',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
name: 'dev_productCollections_20220725',
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
toObjForTypesense() {
|
|
173
|
+
const stagedObj = {
|
|
174
|
+
documentId: this.utilities.sanitizeString(this.documentId),
|
|
175
|
+
createdAtTimestamp: this.utilities.sanitizeMillisTimeStamp(this.createdAtTimestamp),
|
|
176
|
+
preTitle: this.utilities.sanitizeString(this.preTitle),
|
|
177
|
+
title: this.utilities.sanitizeString(this.title),
|
|
178
|
+
subTitle: this.utilities.sanitizeString(this.subTitle),
|
|
179
|
+
description: this.utilities.sanitizeString(this.description),
|
|
180
|
+
type: this.utilities.sanitizeString(this.type),
|
|
181
|
+
imgUrl: this.utilities.sanitizeString(this.imgUrl),
|
|
182
|
+
'refinements.brandRefinement': this.utilities.sanitzeStringArr(this.refinements.brandRefinement),
|
|
183
|
+
'refinements.clothingSizeRefinement': this.utilities.sanitzeStringArr(this.refinements.clothingSizeRefinement),
|
|
184
|
+
'refinements.colorRefinement': this.utilities.sanitzeStringArr(this.refinements.colorRefinement),
|
|
185
|
+
'refinements.conditionRefinement': this.utilities.sanitzeStringArr(this.refinements.conditionRefinement),
|
|
186
|
+
'refinements.genderRefinement': this.utilities.sanitzeStringArr(this.refinements.genderRefinement),
|
|
187
|
+
'refinements.jeanSizeRefinement': this.utilities.sanitzeStringArr(this.refinements.jeanSizeRefinement),
|
|
188
|
+
'refinements.materialCompositionRefinement': this.utilities.sanitzeStringArr(this.refinements.materialCompositionRefinement),
|
|
189
|
+
'refinements.priceRangeRefinement': this.utilities.sanitzeStringArr(this.refinements.priceRangeRefinement),
|
|
190
|
+
'refinements.productCategoryRefinement': this.utilities.sanitzeStringArr(this.refinements.productCategoryRefinement),
|
|
191
|
+
'refinements.productTypeRefinement': this.utilities.sanitzeStringArr(this.refinements.productTypeRefinement),
|
|
192
|
+
'refinements.productStyleRefinement': this.utilities.sanitzeStringArr(this.refinements.productStyleRefinement),
|
|
193
|
+
'refinements.shoeSizeRefinement': this.utilities.sanitzeStringArr(this.refinements.shoeSizeRefinement),
|
|
194
|
+
'refinements.statusRefinement': this.utilities.sanitzeStringArr(this.refinements.statusRefinement),
|
|
195
|
+
'refinements.salesChannelRefinement': this.utilities.sanitzeStringArr(this.refinements.salesChannelRefinement),
|
|
196
|
+
tags: this.utilities.sanitzeStringArr(this.tags),
|
|
197
|
+
};
|
|
198
|
+
return stagedObj;
|
|
199
|
+
}
|
|
33
200
|
}
|
|
34
201
|
exports.default = ProductCollection;
|
|
@@ -35,6 +35,7 @@ interface ProductRefinements {
|
|
|
35
35
|
declare type CollectionType = 'AUTOMATED' | 'MANUAL';
|
|
36
36
|
declare type ProductCollectionType = {
|
|
37
37
|
createdAt?: string;
|
|
38
|
+
createdAtTimestamp?: number;
|
|
38
39
|
updatedAt?: string;
|
|
39
40
|
documentId?: string;
|
|
40
41
|
preTitle: string;
|
|
@@ -61,3 +62,28 @@ declare type ProductCollectionFormFields = {
|
|
|
61
62
|
tags: MultiSelectFormField<string>;
|
|
62
63
|
collectionId: TextInputFormField<string>;
|
|
63
64
|
};
|
|
65
|
+
declare type TypesenseProductCollectionObj = {
|
|
66
|
+
documentId: string;
|
|
67
|
+
createdAtTimestamp: number;
|
|
68
|
+
preTitle: string;
|
|
69
|
+
title: string;
|
|
70
|
+
subTitle: string;
|
|
71
|
+
description: string;
|
|
72
|
+
type: string;
|
|
73
|
+
imgUrl: string;
|
|
74
|
+
'refinements.brandRefinement': string[];
|
|
75
|
+
'refinements.clothingSizeRefinement': string[];
|
|
76
|
+
'refinements.colorRefinement': string[];
|
|
77
|
+
'refinements.conditionRefinement': string[];
|
|
78
|
+
'refinements.genderRefinement': string[];
|
|
79
|
+
'refinements.jeanSizeRefinement': string[];
|
|
80
|
+
'refinements.materialCompositionRefinement': string[];
|
|
81
|
+
'refinements.priceRangeRefinement': string[];
|
|
82
|
+
'refinements.productCategoryRefinement': string[];
|
|
83
|
+
'refinements.productTypeRefinement': string[];
|
|
84
|
+
'refinements.productStyleRefinement': string[];
|
|
85
|
+
'refinements.shoeSizeRefinement': string[];
|
|
86
|
+
'refinements.statusRefinement': string[];
|
|
87
|
+
'refinements.salesChannelRefinement': string[];
|
|
88
|
+
tags: string[];
|
|
89
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
declare type ChatRoomAttributes = {
|
|
2
2
|
documentId: string;
|
|
3
|
+
createdAt: string;
|
|
4
|
+
createdAtTimestamp: number;
|
|
3
5
|
userIdsToBeNotified: string[];
|
|
4
6
|
type: ChatRoomType;
|
|
5
7
|
lastMessage: LastMessageObj;
|
|
@@ -30,6 +32,7 @@ declare type ChatRoomUserInfo = {
|
|
|
30
32
|
};
|
|
31
33
|
declare type TypesenseChatRoomObj = {
|
|
32
34
|
documentId: string;
|
|
35
|
+
createdAtTimestamp: number;
|
|
33
36
|
type: string;
|
|
34
37
|
userIds: string[];
|
|
35
38
|
userIdsToBeNotified: string[];
|