@infrab4a/connect 3.14.3-beta.0 → 3.14.3-beta.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/bundles/infrab4a-connect.umd.js +72 -68
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/models/category.d.ts +2 -0
- package/esm2015/domain/catalog/models/category.js +6 -1
- package/fesm2015/infrab4a-connect.js +50 -46
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
2
|
import { Shops } from './enums';
|
|
3
3
|
import { Filter } from './filter';
|
|
4
|
+
import { Product } from './product';
|
|
4
5
|
import { CategoryCondition, CategoryMetadata } from './types';
|
|
5
6
|
export declare class Category extends BaseModel<Category> {
|
|
6
7
|
id: string;
|
|
@@ -25,5 +26,6 @@ export declare class Category extends BaseModel<Category> {
|
|
|
25
26
|
parentId?: number;
|
|
26
27
|
parent?: Category;
|
|
27
28
|
filters?: Filter[];
|
|
29
|
+
childrenProducts?: Product[];
|
|
28
30
|
static get identifiersFields(): GenericIdentifier[];
|
|
29
31
|
}
|
|
@@ -2,6 +2,7 @@ import { __decorate, __metadata } from "tslib";
|
|
|
2
2
|
import { Type } from 'class-transformer';
|
|
3
3
|
import { BaseModel } from '../../generic/model';
|
|
4
4
|
import { Filter } from './filter';
|
|
5
|
+
import { Product } from './product';
|
|
5
6
|
export class Category extends BaseModel {
|
|
6
7
|
static get identifiersFields() {
|
|
7
8
|
return ['id'];
|
|
@@ -15,4 +16,8 @@ __decorate([
|
|
|
15
16
|
Type(() => Filter),
|
|
16
17
|
__metadata("design:type", Array)
|
|
17
18
|
], Category.prototype, "filters", void 0);
|
|
18
|
-
|
|
19
|
+
__decorate([
|
|
20
|
+
Type(() => Product),
|
|
21
|
+
__metadata("design:type", Array)
|
|
22
|
+
], Category.prototype, "childrenProducts", void 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HM/OiBQcm9kdWN0W11cblxuICBzdGF0aWMgZ2V0IGlkZW50aWZpZXJzRmllbGRzKCk6IEdlbmVyaWNJZGVudGlmaWVyW10ge1xuICAgIHJldHVybiBbJ2lkJ11cbiAgfVxufVxuIl19
|
|
@@ -1193,6 +1193,52 @@ class Filter extends BaseModel {
|
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
1195
|
|
|
1196
|
+
class KitProduct extends BaseModel {
|
|
1197
|
+
static get identifiersFields() {
|
|
1198
|
+
return ['productId', 'kitProductId'];
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
__decorate([
|
|
1202
|
+
Type(() => Product),
|
|
1203
|
+
__metadata("design:type", Product)
|
|
1204
|
+
], KitProduct.prototype, "kit", void 0);
|
|
1205
|
+
__decorate([
|
|
1206
|
+
Type(() => Product),
|
|
1207
|
+
__metadata("design:type", Product)
|
|
1208
|
+
], KitProduct.prototype, "product", void 0);
|
|
1209
|
+
|
|
1210
|
+
class Product extends BaseModel {
|
|
1211
|
+
get evaluation() {
|
|
1212
|
+
return {
|
|
1213
|
+
reviews: this.reviews,
|
|
1214
|
+
count: this.reviewsTotal,
|
|
1215
|
+
rating: this.rate,
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
set evaluation(evaluation) {
|
|
1219
|
+
if (!evaluation) {
|
|
1220
|
+
this.reviews = null;
|
|
1221
|
+
this.reviewsTotal = null;
|
|
1222
|
+
this.rate = null;
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
this.reviews = evaluation.reviews || this.reviews;
|
|
1226
|
+
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
1227
|
+
this.rate = evaluation.rating || this.rate;
|
|
1228
|
+
}
|
|
1229
|
+
static get identifiersFields() {
|
|
1230
|
+
return ['id'];
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
__decorate([
|
|
1234
|
+
Type(() => Category),
|
|
1235
|
+
__metadata("design:type", Category)
|
|
1236
|
+
], Product.prototype, "category", void 0);
|
|
1237
|
+
__decorate([
|
|
1238
|
+
Type(() => KitProduct),
|
|
1239
|
+
__metadata("design:type", Array)
|
|
1240
|
+
], Product.prototype, "kitProducts", void 0);
|
|
1241
|
+
|
|
1196
1242
|
class Category extends BaseModel {
|
|
1197
1243
|
static get identifiersFields() {
|
|
1198
1244
|
return ['id'];
|
|
@@ -1206,6 +1252,10 @@ __decorate([
|
|
|
1206
1252
|
Type(() => Filter),
|
|
1207
1253
|
__metadata("design:type", Array)
|
|
1208
1254
|
], Category.prototype, "filters", void 0);
|
|
1255
|
+
__decorate([
|
|
1256
|
+
Type(() => Product),
|
|
1257
|
+
__metadata("design:type", Array)
|
|
1258
|
+
], Category.prototype, "childrenProducts", void 0);
|
|
1209
1259
|
|
|
1210
1260
|
class CategoryCollectionChildren extends BaseModel {
|
|
1211
1261
|
static get identifiersFields() {
|
|
@@ -1252,52 +1302,6 @@ class FilterOption extends BaseModel {
|
|
|
1252
1302
|
}
|
|
1253
1303
|
}
|
|
1254
1304
|
|
|
1255
|
-
class Product extends BaseModel {
|
|
1256
|
-
get evaluation() {
|
|
1257
|
-
return {
|
|
1258
|
-
reviews: this.reviews,
|
|
1259
|
-
count: this.reviewsTotal,
|
|
1260
|
-
rating: this.rate,
|
|
1261
|
-
};
|
|
1262
|
-
}
|
|
1263
|
-
set evaluation(evaluation) {
|
|
1264
|
-
if (!evaluation) {
|
|
1265
|
-
this.reviews = null;
|
|
1266
|
-
this.reviewsTotal = null;
|
|
1267
|
-
this.rate = null;
|
|
1268
|
-
return;
|
|
1269
|
-
}
|
|
1270
|
-
this.reviews = evaluation.reviews || this.reviews;
|
|
1271
|
-
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
1272
|
-
this.rate = evaluation.rating || this.rate;
|
|
1273
|
-
}
|
|
1274
|
-
static get identifiersFields() {
|
|
1275
|
-
return ['id'];
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
__decorate([
|
|
1279
|
-
Type(() => Category),
|
|
1280
|
-
__metadata("design:type", Category)
|
|
1281
|
-
], Product.prototype, "category", void 0);
|
|
1282
|
-
__decorate([
|
|
1283
|
-
Type(() => KitProduct),
|
|
1284
|
-
__metadata("design:type", Array)
|
|
1285
|
-
], Product.prototype, "kitProducts", void 0);
|
|
1286
|
-
|
|
1287
|
-
class KitProduct extends BaseModel {
|
|
1288
|
-
static get identifiersFields() {
|
|
1289
|
-
return ['productId', 'kitProductId'];
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
__decorate([
|
|
1293
|
-
Type(() => Product),
|
|
1294
|
-
__metadata("design:type", Product)
|
|
1295
|
-
], KitProduct.prototype, "kit", void 0);
|
|
1296
|
-
__decorate([
|
|
1297
|
-
Type(() => Product),
|
|
1298
|
-
__metadata("design:type", Product)
|
|
1299
|
-
], KitProduct.prototype, "product", void 0);
|
|
1300
|
-
|
|
1301
1305
|
class Variant extends BaseModel {
|
|
1302
1306
|
static get identifiersFields() {
|
|
1303
1307
|
return ['id', 'productId'];
|