simpo-component-library 3.6.212 → 3.6.213

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.
@@ -8423,21 +8423,13 @@ class CartComponent extends BaseSection {
8423
8423
  this.router.navigate(['/home-appointment']);
8424
8424
  }
8425
8425
  redeemScheme(scheme, action) {
8426
+ if (this.responseData?.totalAmount ?? 0 - this.responseData?.billdetails?.discountAmount ?? 0 < scheme.amount) {
8427
+ this.messageService.add({ severity: 'error', summary: 'Scheme Redeem', detail: 'Cart amount should be more that redeem amount' });
8428
+ return;
8429
+ }
8426
8430
  this.restService.redeemScheme(scheme, this.cartInfo.cartId, action).subscribe((res) => {
8427
- if (!action) {
8428
- if (this.responseData?.totalAmount ?? 0 - this.responseData?.billdetails?.discountAmount ?? 0 < scheme.amount) {
8429
- this.showReedemError = true;
8430
- this.vaildAmount = scheme.amount - (this.responseData?.totalAmount ?? 0 - this.responseData?.billdetails?.discountAmount ?? 0);
8431
- }
8432
- else {
8433
- this.cartInfo.billdetails.orraSchemeRedeemedAmount = scheme.amount;
8434
- this.cartInfo.billdetails.orraSchemeCode = scheme.GPPId;
8435
- }
8436
- }
8437
- else {
8438
- this.cartInfo.billdetails.orraSchemeRedeemedAmount = 0;
8439
- this.cartInfo.billdetails.orraSchemeCode = null;
8440
- }
8431
+ this.cartInfo.billdetails.orraSchemeRedeemedAmount = scheme.amount;
8432
+ this.cartInfo.billdetails.orraSchemeCode = scheme.GPPId;
8441
8433
  });
8442
8434
  }
8443
8435
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CartComponent, deps: [{ token: EventsService }, { token: CartService }, { token: i2$2.Router }, { token: RestService }, { token: i1$1.MatDialog }, { token: StorageServiceService }, { token: i4$1.MessageService }, { token: i8$2.MatBottomSheet }, { token: i2$2.ActivatedRoute }, { token: MAT_DIALOG_DATA, optional: true }, { token: i1$1.MatDialogRef, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }