@infrab4a/connect-angular 4.9.2 → 4.9.3-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.
@@ -1199,7 +1199,12 @@ class CouponService {
1199
1199
  getCouponUseLimits(coupon, checkoutType, user) {
1200
1200
  let couponUseLimits;
1201
1201
  if (checkoutType == CheckoutTypes.ECOMMERCE || checkoutType == CheckoutTypes.ALL) {
1202
- couponUseLimits = user && user.isSubscriber ? coupon.useLimits.subscriber : coupon.useLimits.non_subscriber;
1202
+ if (coupon.exclusivityType.length === 1 &&
1203
+ (coupon.exclusivityType.at(0) === Exclusivities.SPECIFIC_USER ||
1204
+ coupon.exclusivityType.at(0) === Exclusivities.COLLABORATORS))
1205
+ couponUseLimits = coupon.useLimits.non_subscriber;
1206
+ else
1207
+ couponUseLimits = user && user.isSubscriber ? coupon.useLimits.subscriber : coupon.useLimits.non_subscriber;
1203
1208
  }
1204
1209
  else {
1205
1210
  couponUseLimits = coupon.useLimits.subscription;
@@ -1976,6 +1981,14 @@ class WishlistService {
1976
1981
  personType: personType ?? PersonTypes.NONE,
1977
1982
  personIsSubscriber: personIsSubscriber ?? false,
1978
1983
  };
1984
+ // const hasWishlist = await this.wishlistRepository
1985
+ // .find({
1986
+ // filters: {
1987
+ // personId,
1988
+ // },
1989
+ // })
1990
+ // .then((res) => res.count)
1991
+ // if (hasWishlist) throw 'Usuário já possui Wishlist'
1979
1992
  const newWishlist = await this.wishlistRepository.create(data);
1980
1993
  await this.wishlistRepository.update({ id: newWishlist.id, slug: newWishlist.id });
1981
1994
  return Wishlist.toInstance({ ...newWishlist.toPlain(), slug: newWishlist.id });