@infrab4a/connect 3.13.2-beta1 → 3.13.2
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 -17
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +3 -4
- package/esm2015/utils/index.js +2 -1
- package/esm2015/utils/round-product-price.js +12 -0
- package/fesm2015/infrab4a-connect.js +13 -15
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/package.json +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/round-product-price.d.ts +2 -0
- package/domain/catalog/helpers/RoundProdutcPriceHelper.d.ts +0 -4
- package/esm2015/domain/catalog/helpers/RoundProdutcPriceHelper.js +0 -14
|
@@ -856,6 +856,17 @@
|
|
|
856
856
|
return date;
|
|
857
857
|
};
|
|
858
858
|
|
|
859
|
+
var roundProductPrices = function (product) {
|
|
860
|
+
product.price.price = Number(product.price.price.toFixed(2));
|
|
861
|
+
product.price.fullPrice = Number(product.price.fullPrice.toFixed(2));
|
|
862
|
+
if (product.price.subscriberPrice) {
|
|
863
|
+
product.price.subscriberPrice = Number(product.price.subscriberPrice.toFixed(2));
|
|
864
|
+
}
|
|
865
|
+
if (product instanceof LineItem && product.pricePaid) {
|
|
866
|
+
product.pricePaid = Number(product.pricePaid.toFixed(2));
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
|
|
859
870
|
exports.CheckoutTypes = void 0;
|
|
860
871
|
(function (CheckoutTypes) {
|
|
861
872
|
CheckoutTypes[CheckoutTypes["ECOMMERCE"] = 1] = "ECOMMERCE";
|
|
@@ -4718,22 +4729,6 @@
|
|
|
4718
4729
|
return FilterOptionHasuraGraphQLRepository;
|
|
4719
4730
|
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
4720
4731
|
|
|
4721
|
-
var RoundProductPricesHelper = /** @class */ (function () {
|
|
4722
|
-
function RoundProductPricesHelper() {
|
|
4723
|
-
}
|
|
4724
|
-
RoundProductPricesHelper.roundProductPrices = function (product) {
|
|
4725
|
-
product.price.price = Number(product.price.price.toFixed(2));
|
|
4726
|
-
product.price.fullPrice = Number(product.price.fullPrice.toFixed(2));
|
|
4727
|
-
if (product.price.subscriberPrice) {
|
|
4728
|
-
product.price.subscriberPrice = Number(product.price.subscriberPrice.toFixed(2));
|
|
4729
|
-
}
|
|
4730
|
-
if (product instanceof LineItem && product.pricePaid) {
|
|
4731
|
-
product.pricePaid = Number(product.pricePaid.toFixed(2));
|
|
4732
|
-
}
|
|
4733
|
-
};
|
|
4734
|
-
return RoundProductPricesHelper;
|
|
4735
|
-
}());
|
|
4736
|
-
|
|
4737
4732
|
var ProductHasuraGraphQLRepository = /** @class */ (function (_super_1) {
|
|
4738
4733
|
__extends(ProductHasuraGraphQLRepository, _super_1);
|
|
4739
4734
|
function ProductHasuraGraphQLRepository(endpoint, authOptions) {
|
|
@@ -5033,7 +5028,7 @@
|
|
|
5033
5028
|
case 1:
|
|
5034
5029
|
result = _c.sent();
|
|
5035
5030
|
product = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
|
|
5036
|
-
|
|
5031
|
+
roundProductPrices(product);
|
|
5037
5032
|
return [2 /*return*/, product];
|
|
5038
5033
|
}
|
|
5039
5034
|
});
|
|
@@ -5768,6 +5763,7 @@
|
|
|
5768
5763
|
exports.WeakPasswordError = WeakPasswordError;
|
|
5769
5764
|
exports.isUUID = isUUID;
|
|
5770
5765
|
exports.parseDateTime = parseDateTime;
|
|
5766
|
+
exports.roundProductPrices = roundProductPrices;
|
|
5771
5767
|
exports.withCreateFirestore = withCreateFirestore;
|
|
5772
5768
|
exports.withCreateHasuraGraphQL = withCreateHasuraGraphQL;
|
|
5773
5769
|
exports.withCrudFirestore = withCrudFirestore;
|