@infrab4a/connect 1.0.0-beta.22 → 1.0.0-beta.23
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 +13 -7
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/generic/repository/create.repository.d.ts +2 -2
- package/esm2015/domain/generic/repository/create.repository.js +1 -1
- package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +4 -2
- package/esm2015/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +2 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +3 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.js +8 -6
- package/fesm2015/infrab4a-connect.js +13 -7
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/package.json +1 -1
|
@@ -2404,7 +2404,9 @@
|
|
|
2404
2404
|
productIds = chunks_1_1.value;
|
|
2405
2405
|
if ((options === null || options === void 0 ? void 0 : options.limit) && products.length >= (options === null || options === void 0 ? void 0 : options.limit))
|
|
2406
2406
|
return [3 /*break*/, 6];
|
|
2407
|
-
return [4 /*yield*/, this.collection('
|
|
2407
|
+
return [4 /*yield*/, this.collection('productsErpVitrine')
|
|
2408
|
+
.where(publishedField, '==', true)
|
|
2409
|
+
.where('id', 'in', productIds)];
|
|
2408
2410
|
case 3:
|
|
2409
2411
|
query = _b.sent();
|
|
2410
2412
|
if (options === null || options === void 0 ? void 0 : options.hasStock)
|
|
@@ -2446,7 +2448,7 @@
|
|
|
2446
2448
|
var _this = _super.call(this) || this;
|
|
2447
2449
|
_this.firestore = firestore;
|
|
2448
2450
|
_this.reviews = {};
|
|
2449
|
-
_this.collectionName = '
|
|
2451
|
+
_this.collectionName = 'productsErpVitrine';
|
|
2450
2452
|
_this.model = Product;
|
|
2451
2453
|
return _this;
|
|
2452
2454
|
}
|
|
@@ -4019,6 +4021,8 @@
|
|
|
4019
4021
|
return __generator(this, function (_c) {
|
|
4020
4022
|
switch (_c.label) {
|
|
4021
4023
|
case 0:
|
|
4024
|
+
if (!reviews)
|
|
4025
|
+
return [2 /*return*/, []];
|
|
4022
4026
|
if (!('action' in reviews && reviews.action === 'remove')) return [3 /*break*/, 3];
|
|
4023
4027
|
return [4 /*yield*/, Promise.all(reviews.value.map(function (reviewData) { return __awaiter(_this, void 0, void 0, function () {
|
|
4024
4028
|
var review;
|
|
@@ -4221,15 +4225,17 @@
|
|
|
4221
4225
|
}, {}); },
|
|
4222
4226
|
bindFindFilter: function (sentence) {
|
|
4223
4227
|
var filters = Object.values(sentence).shift();
|
|
4224
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((filters === null || filters === void 0 ? void 0 : filters.price) && { price: filters.price })), (filters.fullPrice && { full_price: filters.fullPrice })), (filters.subscriberDiscountPercentage && {
|
|
4228
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, (((filters === null || filters === void 0 ? void 0 : filters.price) || (filters === null || filters === void 0 ? void 0 : filters.price) === 0) && { price: filters.price })), ((filters.fullPrice || filters.fullPrice === 0) && { full_price: filters.fullPrice })), ((filters.subscriberDiscountPercentage || filters.subscriberDiscountPercentage === 0) && {
|
|
4225
4229
|
subscriber_discount_percentage: filters.subscriberDiscountPercentage,
|
|
4226
|
-
})), (filters.subscriberPrice
|
|
4230
|
+
})), ((filters.subscriberPrice || filters.subscriberPrice === 0) && {
|
|
4231
|
+
subscriber_price: filters.subscriberPrice,
|
|
4232
|
+
}));
|
|
4227
4233
|
},
|
|
4228
|
-
bindPersistData: function (value
|
|
4234
|
+
bindPersistData: function (value) {
|
|
4229
4235
|
var priceData = Object.values(value).shift();
|
|
4230
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((priceData === null || priceData === void 0 ? void 0 : priceData.price) && { price: priceData.price })), (priceData.fullPrice && { full_price: priceData.fullPrice })), (priceData.subscriberDiscountPercentage && {
|
|
4236
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, ((priceData === null || priceData === void 0 ? void 0 : priceData.price) >= 0 && { price: priceData.price })), (priceData.fullPrice >= 0 && { full_price: priceData.fullPrice })), (priceData.subscriberDiscountPercentage >= 0 && {
|
|
4231
4237
|
subscriber_discount_percentage: priceData.subscriberDiscountPercentage,
|
|
4232
|
-
})), (priceData.subscriberPrice && { subscriber_price: priceData.subscriberPrice }));
|
|
4238
|
+
})), (priceData.subscriberPrice >= 0 && { subscriber_price: priceData.subscriberPrice }));
|
|
4233
4239
|
},
|
|
4234
4240
|
},
|
|
4235
4241
|
},
|