taxtank-core 2.0.50 → 2.0.51

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.
@@ -11485,6 +11485,8 @@ var BadgeColorEnum;
11485
11485
  BadgeColorEnum["GREEN"] = "green";
11486
11486
  BadgeColorEnum["GOLD"] = "gold";
11487
11487
  BadgeColorEnum["GRAY"] = "gray";
11488
+ BadgeColorEnum["PRIMARY"] = "bg-primary";
11489
+ BadgeColorEnum["ERROR"] = "bg-error";
11488
11490
  })(BadgeColorEnum || (BadgeColorEnum = {}));
11489
11491
 
11490
11492
  /**
@@ -11506,6 +11508,9 @@ class FinancialGoal extends AbstractModel {
11506
11508
  this.paymentFrequency = DailyFrequencyEnum.MONTHLY;
11507
11509
  this.inCalendar = true;
11508
11510
  }
11511
+ isCompleted() {
11512
+ return this.status === FinancialGoalStatusEnum.COMPLETE;
11513
+ }
11509
11514
  /**
11510
11515
  * today's forecasted progress
11511
11516
  */
@@ -11519,13 +11524,15 @@ class FinancialGoal extends AbstractModel {
11519
11524
  * How much user saved so far.
11520
11525
  */
11521
11526
  get progress() {
11522
- return Math.abs(this.bankAccount.currentBalance - this.initialValue);
11527
+ return this.isCompleted()
11528
+ ? Math.abs(this.finalValue - this.initialValue)
11529
+ : Math.abs(this.bankAccount.currentBalance - this.initialValue);
11523
11530
  }
11524
11531
  /**
11525
11532
  * How much is left to reach the goal from the current balance.
11526
11533
  */
11527
11534
  get remaining() {
11528
- return this.target - this.progress;
11535
+ return this.isCompleted() ? 0 : this.target - this.progress;
11529
11536
  }
11530
11537
  /**
11531
11538
  * How much needs to deposit to achieve the goal from the start
@@ -11544,19 +11551,19 @@ class FinancialGoal extends AbstractModel {
11544
11551
  case this.status === FinancialGoalStatusEnum.PAUSE:
11545
11552
  return new Badge('Paused', BadgeColorEnum.GOLD);
11546
11553
  case this.status === FinancialGoalStatusEnum.COMPLETE:
11547
- return new Badge('Completed', BadgeColorEnum.DEFAULT);
11554
+ return new Badge('Completed', BadgeColorEnum.GREEN);
11548
11555
  case this.forecast === 0:
11549
- return this.progress ? new Badge(`Ahead`, BadgeColorEnum.GREEN) : new Badge(`On track`, BadgeColorEnum.GREEN);
11556
+ return this.progress ? new Badge(`Ahead`, BadgeColorEnum.GREEN) : new Badge(`On track`, BadgeColorEnum.PRIMARY);
11550
11557
  case this.progress >= this.target:
11551
11558
  return new Badge('Achieved', BadgeColorEnum.GREEN);
11552
11559
  case this.forecastPercent >= 1.05:
11553
11560
  return new Badge(`Ahead by ${this.forecastPercent} %`, BadgeColorEnum.GREEN);
11554
11561
  case this.forecastPercent >= 0.95 && this.forecastPercent <= 1.05:
11555
- return new Badge('On track', BadgeColorEnum.GREEN);
11562
+ return new Badge('On track', BadgeColorEnum.PRIMARY);
11556
11563
  case this.forecastPercent >= 0.8 && this.forecastPercent <= 0.95:
11557
- return new Badge(`Behind by ${this.forecastPercent}%`, BadgeColorEnum.GREEN);
11564
+ return new Badge(`Behind by ${this.forecastPercent}%`, BadgeColorEnum.GOLD);
11558
11565
  default:
11559
- return new Badge(`Behind by ${this.forecastPercent}%`, BadgeColorEnum.GREEN);
11566
+ return new Badge(`Behind by ${this.forecastPercent}%`, BadgeColorEnum.ERROR);
11560
11567
  }
11561
11568
  }
11562
11569
  /**