@infrab4a/connect-angular 3.7.4 → 3.7.5
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-angular.umd.js +6 -2
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/services/checkout-subscription.service.js +5 -3
- package/esm2015/services/coupon.service.js +4 -2
- package/fesm2015/infrab4a-connect-angular.js +6 -2
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +1 -1
|
@@ -515,7 +515,7 @@
|
|
|
515
515
|
// Verifica o limite de uso geral por usuario
|
|
516
516
|
if (coupon.useLimit && orders.data.length >= coupon.useLimit)
|
|
517
517
|
throw new InvalidCouponError('Limite de uso atingido.');
|
|
518
|
-
validUser = this.userValidationAndSubscriptionStatus(coupon, checkout.user);
|
|
518
|
+
validUser = this.userValidationAndSubscriptionStatus(coupon, checkout === null || checkout === void 0 ? void 0 : checkout.user);
|
|
519
519
|
if (!validUser)
|
|
520
520
|
throw new InvalidCouponError('Usuário não elegível.');
|
|
521
521
|
return [4 /*yield*/, this.hasProductCategories(coupon, checkout)];
|
|
@@ -644,6 +644,8 @@
|
|
|
644
644
|
CouponService.prototype.userValidationAndSubscriptionStatus = function (coupon, user) {
|
|
645
645
|
if (coupon.exclusivityType === i1$1.Exclusivities.ALL_USERS)
|
|
646
646
|
return true;
|
|
647
|
+
if (!user)
|
|
648
|
+
return true;
|
|
647
649
|
// Verifica se o email do usuário é coorporativo
|
|
648
650
|
if (!this.emailIsFromCollaborator(user.email) && coupon.exclusivityType === i1$1.Exclusivities.COLLABORATORS)
|
|
649
651
|
throw new InvalidCouponError('Você não é colaborador.');
|
|
@@ -1015,7 +1017,9 @@
|
|
|
1015
1017
|
};
|
|
1016
1018
|
CheckoutSubscriptionService.prototype.checkCoupon = function (nickname, userEmail) {
|
|
1017
1019
|
var _this = this;
|
|
1018
|
-
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService
|
|
1020
|
+
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService
|
|
1021
|
+
.checkCoupon(nickname, userEmail, i1$1.CheckoutTypes.SUBSCRIPTION, checkout.subscriptionPlan.name, checkout, true)
|
|
1022
|
+
.pipe(); }));
|
|
1019
1023
|
};
|
|
1020
1024
|
CheckoutSubscriptionService.prototype.calcDiscountSubscription = function (coupon) {
|
|
1021
1025
|
var _this = this;
|