@infrab4a/connect 3.13.8-beta.3 → 3.14.0-beta.0
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 +20 -63
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/helpers/index.d.ts +1 -1
- package/domain/catalog/models/types/shop-description.type.d.ts +0 -1
- package/domain/catalog/repositories/category.repository.d.ts +0 -2
- package/domain/shopping/models/coupons/coupon.d.ts +18 -4
- package/esm2015/domain/catalog/helpers/RoundProdutcPriceHelper.js +15 -0
- package/esm2015/domain/catalog/helpers/index.js +2 -2
- package/esm2015/domain/catalog/models/types/shop-description.type.js +1 -1
- package/esm2015/domain/catalog/repositories/category.repository.js +1 -1
- package/esm2015/domain/shopping/models/coupons/coupon.js +16 -14
- package/esm2015/domain/users/models/user.js +2 -2
- package/esm2015/infra/elasticsearch/indexes/products-index.js +3 -8
- package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +1 -7
- package/esm2015/infra/hasura-graphql/models/product-hasura-graphql.js +1 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +1 -19
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +4 -8
- package/fesm2015/infrab4a-connect.js +20 -49
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +0 -2
- package/infra/hasura-graphql/models/product-hasura-graphql.d.ts +0 -1
- package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +0 -2
- package/package.json +1 -1
- package/esm2015/domain/catalog/helpers/round-product-price.helper.js +0 -15
- /package/domain/catalog/helpers/{round-product-price.helper.d.ts → RoundProdutcPriceHelper.d.ts} +0 -0
|
@@ -1452,9 +1452,21 @@
|
|
|
1452
1452
|
Coupon.createCoupon = function (userId) {
|
|
1453
1453
|
return this.toInstance({
|
|
1454
1454
|
nickname: "" + Date.now(),
|
|
1455
|
-
type: exports.CouponTypes.ABSOLUTE,
|
|
1456
1455
|
checkoutType: exports.CheckoutTypes.ECOMMERCE,
|
|
1457
|
-
discount:
|
|
1456
|
+
discount: {
|
|
1457
|
+
subscriber: {
|
|
1458
|
+
type: exports.CouponTypes.ABSOLUTE,
|
|
1459
|
+
value: 10,
|
|
1460
|
+
},
|
|
1461
|
+
non_subscriber: {
|
|
1462
|
+
type: exports.CouponTypes.ABSOLUTE,
|
|
1463
|
+
value: 10,
|
|
1464
|
+
},
|
|
1465
|
+
subscription: {
|
|
1466
|
+
type: exports.CouponTypes.ABSOLUTE,
|
|
1467
|
+
value: 10,
|
|
1468
|
+
},
|
|
1469
|
+
},
|
|
1458
1470
|
user: userId,
|
|
1459
1471
|
useLimit: 1,
|
|
1460
1472
|
useLimitPerUser: true,
|
|
@@ -1464,15 +1476,7 @@
|
|
|
1464
1476
|
});
|
|
1465
1477
|
};
|
|
1466
1478
|
return Coupon;
|
|
1467
|
-
}(BaseModel));
|
|
1468
|
-
__decorate([
|
|
1469
|
-
classTransformer.Expose({ name: 'checkout_type' }),
|
|
1470
|
-
__metadata("design:type", Number)
|
|
1471
|
-
], Coupon.prototype, "checkoutType", void 0);
|
|
1472
|
-
__decorate([
|
|
1473
|
-
classTransformer.Expose({ name: 'exclusivity_type' }),
|
|
1474
|
-
__metadata("design:type", Number)
|
|
1475
|
-
], Coupon.prototype, "exclusivityType", void 0);
|
|
1479
|
+
}(BaseModel));
|
|
1476
1480
|
|
|
1477
1481
|
var SubscriptionPlan = /** @class */ (function (_super) {
|
|
1478
1482
|
__extends(SubscriptionPlan, _super);
|
|
@@ -1518,7 +1522,7 @@
|
|
|
1518
1522
|
var instance = _super.toInstance.call(this, data);
|
|
1519
1523
|
if (!lodash.isNil(data.firstName))
|
|
1520
1524
|
instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
|
|
1521
|
-
return
|
|
1525
|
+
return;
|
|
1522
1526
|
};
|
|
1523
1527
|
User.prototype.toPlain = function () {
|
|
1524
1528
|
var plain = _super.prototype.toPlain.call(this);
|
|
@@ -2543,12 +2547,7 @@
|
|
|
2543
2547
|
})];
|
|
2544
2548
|
case 1:
|
|
2545
2549
|
search = _a.sent();
|
|
2546
|
-
search.hits = search.hits
|
|
2547
|
-
.filter(function (e) { return e._source.name !== ''; })
|
|
2548
|
-
.map(function (hit) {
|
|
2549
|
-
RoundProductPricesHelper.roundProductPrices(hit._source);
|
|
2550
|
-
return hit;
|
|
2551
|
-
});
|
|
2550
|
+
search.hits = search.hits.filter(function (e) { return e._source.name !== ''; });
|
|
2552
2551
|
return [2 /*return*/, search];
|
|
2553
2552
|
}
|
|
2554
2553
|
});
|
|
@@ -3341,12 +3340,6 @@
|
|
|
3341
3340
|
CategoryFirestoreRepository.prototype.getCategoryByShop = function (shop) {
|
|
3342
3341
|
return;
|
|
3343
3342
|
};
|
|
3344
|
-
CategoryFirestoreRepository.prototype.getChildren = function (parentId) {
|
|
3345
|
-
return;
|
|
3346
|
-
};
|
|
3347
|
-
CategoryFirestoreRepository.prototype.isChild = function (id, parentId) {
|
|
3348
|
-
return;
|
|
3349
|
-
};
|
|
3350
3343
|
return CategoryFirestoreRepository;
|
|
3351
3344
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
3352
3345
|
|
|
@@ -5155,38 +5148,6 @@
|
|
|
5155
5148
|
});
|
|
5156
5149
|
});
|
|
5157
5150
|
};
|
|
5158
|
-
CategoryHasuraGraphQLRepository.prototype.getChildren = function (parentId) {
|
|
5159
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5160
|
-
var category_tree;
|
|
5161
|
-
return __generator(this, function (_c) {
|
|
5162
|
-
switch (_c.label) {
|
|
5163
|
-
case 0: return [4 /*yield*/, this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
5164
|
-
args: {
|
|
5165
|
-
type: 'category_tree_args',
|
|
5166
|
-
value: { parentid: parentId },
|
|
5167
|
-
required: true,
|
|
5168
|
-
},
|
|
5169
|
-
})];
|
|
5170
|
-
case 1:
|
|
5171
|
-
category_tree = (_c.sent()).category_tree;
|
|
5172
|
-
return [2 /*return*/, category_tree.map(function (c) { return Category.toInstance(c); })];
|
|
5173
|
-
}
|
|
5174
|
-
});
|
|
5175
|
-
});
|
|
5176
|
-
};
|
|
5177
|
-
CategoryHasuraGraphQLRepository.prototype.isChild = function (id, parentId) {
|
|
5178
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
5179
|
-
var categoryTree;
|
|
5180
|
-
return __generator(this, function (_c) {
|
|
5181
|
-
switch (_c.label) {
|
|
5182
|
-
case 0: return [4 /*yield*/, this.getChildren(parentId)];
|
|
5183
|
-
case 1:
|
|
5184
|
-
categoryTree = _c.sent();
|
|
5185
|
-
return [2 /*return*/, categoryTree.some(function (c) { return c.id == id.toString(); })];
|
|
5186
|
-
}
|
|
5187
|
-
});
|
|
5188
|
-
});
|
|
5189
|
-
};
|
|
5190
5151
|
return CategoryHasuraGraphQLRepository;
|
|
5191
5152
|
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
5192
5153
|
|
|
@@ -5440,30 +5401,26 @@
|
|
|
5440
5401
|
whoMustUse: data.who_must_use,
|
|
5441
5402
|
howToUse: data.how_to_use,
|
|
5442
5403
|
brand: data.brand_description,
|
|
5443
|
-
ingredients: data.ingredients,
|
|
5444
5404
|
}); },
|
|
5445
5405
|
bindFindFilter: function (sentence) {
|
|
5446
5406
|
var filters = Object.values(sentence).shift();
|
|
5447
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
5407
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ((filters === null || filters === void 0 ? void 0 : filters.description) && { description: filters.description })), (filters.differentials && { differentials: filters.differentials })), (filters.whoMustUse && {
|
|
5448
5408
|
who_must_use: filters.whoMustUse,
|
|
5449
5409
|
})), (filters.howToUse && {
|
|
5450
5410
|
how_to_use: filters.howToUse,
|
|
5451
5411
|
})), (filters.brand && {
|
|
5452
5412
|
brand_description: filters.brand,
|
|
5453
|
-
})), (filters.ingredients && {
|
|
5454
|
-
ingredients: filters.ingredients,
|
|
5455
5413
|
}));
|
|
5456
5414
|
},
|
|
5457
|
-
bindPersistData: function (descriptionData) { return (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
5415
|
+
bindPersistData: function (descriptionData) { return (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ((descriptionData === null || descriptionData === void 0 ? void 0 : descriptionData.description) && { description: descriptionData.description })), (descriptionData.differentials && { differentials: descriptionData.differentials })), (descriptionData.whoMustUse && {
|
|
5458
5416
|
who_must_use: descriptionData.whoMustUse,
|
|
5459
|
-
})), (descriptionData.howToUse && { how_to_use: descriptionData.howToUse })), (descriptionData.brand && { brand_description: descriptionData.brand }))
|
|
5417
|
+
})), (descriptionData.howToUse && { how_to_use: descriptionData.howToUse })), (descriptionData.brand && { brand_description: descriptionData.brand }))); },
|
|
5460
5418
|
},
|
|
5461
5419
|
},
|
|
5462
5420
|
{ differentials: { columnName: 'differentials' } },
|
|
5463
5421
|
{ whoMustUse: { columnName: 'who_must_use' } },
|
|
5464
5422
|
{ howToUse: { columnName: 'how_to_use' } },
|
|
5465
5423
|
{ brandDescription: { columnName: 'brand_description' } },
|
|
5466
|
-
{ ingredients: { columnName: 'ingredients' } },
|
|
5467
5424
|
{ hasVariants: { columnName: 'has_variants' } },
|
|
5468
5425
|
{
|
|
5469
5426
|
images: {
|