tickera-angular-components 0.0.1-dev.173 → 0.0.1-dev.174

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.
@@ -2340,6 +2340,7 @@ var SelectedDiscountCardType;
2340
2340
  SelectedDiscountCardType["CORPORATE_BOND"] = "CORPORATE_BOND";
2341
2341
  SelectedDiscountCardType["GIFT_BOND"] = "GIFT_BOND";
2342
2342
  SelectedDiscountCardType["VIP"] = "VIP";
2343
+ SelectedDiscountCardType["SUBSCRIPTION"] = "SUBSCRIPTION";
2343
2344
  })(SelectedDiscountCardType || (SelectedDiscountCardType = {}));
2344
2345
 
2345
2346
  const getCustomerFullname = (customer) => {
@@ -3761,12 +3762,19 @@ class TicketSelectionDiscountService {
3761
3762
  _giftBond = signal(null, ...(ngDevMode ? [{ debugName: "_giftBond" }] : []));
3762
3763
  _giftBondCode = signal(null, ...(ngDevMode ? [{ debugName: "_giftBondCode" }] : []));
3763
3764
  _vipCard = signal(null, ...(ngDevMode ? [{ debugName: "_vipCard" }] : []));
3765
+ /**
3766
+ * Abono (subscription) como metodo de pago. Solo se usa el campo
3767
+ * `service_fee_exempt`: el valor del descuento es siempre 100% (una obra
3768
+ * del abono cubre el ticket por completo), igual que un cupon del 100%.
3769
+ */
3770
+ _subscription = signal(null, ...(ngDevMode ? [{ debugName: "_subscription" }] : []));
3764
3771
  coupon = computed(() => this._coupon(), ...(ngDevMode ? [{ debugName: "coupon" }] : []));
3765
3772
  corporateBond = computed(() => this._corporateBond(), ...(ngDevMode ? [{ debugName: "corporateBond" }] : []));
3766
3773
  corporateBondCode = computed(() => this._corporateBondCode(), ...(ngDevMode ? [{ debugName: "corporateBondCode" }] : []));
3767
3774
  giftBond = computed(() => this._giftBond(), ...(ngDevMode ? [{ debugName: "giftBond" }] : []));
3768
3775
  giftBondCode = computed(() => this._giftBondCode(), ...(ngDevMode ? [{ debugName: "giftBondCode" }] : []));
3769
3776
  vipCard = computed(() => this._vipCard(), ...(ngDevMode ? [{ debugName: "vipCard" }] : []));
3777
+ subscription = computed(() => this._subscription(), ...(ngDevMode ? [{ debugName: "subscription" }] : []));
3770
3778
  selectedDiscount = computed(() => {
3771
3779
  const coupon = this.coupon();
3772
3780
  if (!!coupon) {
@@ -3805,6 +3813,16 @@ class TicketSelectionDiscountService {
3805
3813
  serviceFeeExempt: !!vipCard.category_snapshot?.service_fee_exempt,
3806
3814
  };
3807
3815
  }
3816
+ const subscription = this.subscription();
3817
+ if (!!subscription) {
3818
+ return {
3819
+ name: 'Abono',
3820
+ value: 100,
3821
+ type: SelectedDiscountCardType.SUBSCRIPTION,
3822
+ discountType: 'percentage',
3823
+ serviceFeeExempt: !!subscription.service_fee_exempt,
3824
+ };
3825
+ }
3808
3826
  return null;
3809
3827
  }, ...(ngDevMode ? [{ debugName: "selectedDiscount" }] : []));
3810
3828
  selectedDiscountType = computed(() => {
@@ -3837,6 +3855,13 @@ class TicketSelectionDiscountService {
3837
3855
  setVipCard(card) {
3838
3856
  this._vipCard.set(card);
3839
3857
  }
3858
+ /**
3859
+ * Abono como metodo de pago (paralelo a `setVipCard`). Llamar con `null`
3860
+ * en cuanto deje de ser el metodo de pago elegido.
3861
+ */
3862
+ setSubscription(subscription) {
3863
+ this._subscription.set(subscription);
3864
+ }
3840
3865
  clearSelection() {
3841
3866
  this._coupon.set(null);
3842
3867
  this._corporateBond.set(null);
@@ -3844,6 +3869,7 @@ class TicketSelectionDiscountService {
3844
3869
  this._giftBond.set(null);
3845
3870
  this._giftBondCode.set(null);
3846
3871
  this._vipCard.set(null);
3872
+ this._subscription.set(null);
3847
3873
  }
3848
3874
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionDiscountService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3849
3875
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionDiscountService, providedIn: 'root' });