@mx-cartographer/experiences 7.0.14-alpha-debts-missing-sorting-option-ram1 → 7.0.14
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/CHANGELOG.md +0 -4
- package/dist/{DebtsStore-VkyMADzd.mjs → DebtsStore-Dp-CraCD.mjs} +15 -18
- package/dist/common/index.es.js +1 -1
- package/dist/common/types/localization/DebtsCopy.d.ts +0 -1
- package/dist/debts/constants/index.d.ts +4 -7
- package/dist/debts/index.es.js +482 -544
- package/dist/debts/store/DebtsUiStore.d.ts +3 -3
- package/dist/debts/utils/DebtsWidget.d.ts +2 -2
- package/dist/debts/utils/SnowballCard.d.ts +2 -2
- package/dist/debts/utils/shared.d.ts +2 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import { makeAutoObservable as l } from "mobx";
|
|
2
|
-
import { getDate as
|
|
3
|
-
import { A as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const b = {
|
|
2
|
+
import { getDate as o, fromUnixTime as m, startOfMonth as _ } from "date-fns";
|
|
3
|
+
import { A as b } from "./ConnectDrawer-phFH6OHt.mjs";
|
|
4
|
+
var u = /* @__PURE__ */ ((a) => (a[a.HIGHEST_INTEREST = 1] = "HIGHEST_INTEREST", a[a.LOWEST_BALANCE = 2] = "LOWEST_BALANCE", a[a.HIGHEST_BALANCE = 3] = "HIGHEST_BALANCE", a))(u || {});
|
|
5
|
+
const p = {
|
|
7
6
|
unnamed_label: "Unnamed Debt"
|
|
8
7
|
};
|
|
9
8
|
function y(a, e) {
|
|
10
|
-
const t = a.filter((n) => n.account_type ===
|
|
9
|
+
const t = a.filter((n) => n.account_type === b.CHECKING_LINE_OF_CREDIT ? Number(n.balance) <= 0 : n.is_excluded_from_debts !== !0), s = e.filter((n) => t.some((i) => i.guid === n.account_guid)).map(
|
|
11
10
|
(n) => d(t.find((i) => i.guid === n.account_guid), n)
|
|
12
|
-
),
|
|
13
|
-
return [...s, ...
|
|
11
|
+
), r = t.filter((n) => !s.some((i) => i.account.guid === n.guid)).map((n) => d(n));
|
|
12
|
+
return [...s, ...r];
|
|
14
13
|
}
|
|
15
14
|
function d(a, e) {
|
|
16
15
|
const t = { account: a, goal: e, guid: a.guid };
|
|
17
16
|
if (e) {
|
|
18
|
-
const s = e.payment_due_at ?
|
|
19
|
-
t.balance = Math.abs(e.amount - e.current_amount), t.interest_rate = e.interest_rate, t.is_paid_off = e.is_complete, t.monthly_payment = e.monthly_payment, t.name = e.name, t.original_balance = e.initial_amount, t.payment_due_date =
|
|
17
|
+
const s = e.payment_due_at ? o(m(e.payment_due_at)) : 1, r = _(/* @__PURE__ */ new Date()).setDate(s);
|
|
18
|
+
t.balance = Math.abs(e.amount - e.current_amount), t.interest_rate = e.interest_rate, t.is_paid_off = e.is_complete, t.monthly_payment = e.monthly_payment, t.name = e.name, t.original_balance = e.initial_amount, t.payment_due_date = r;
|
|
20
19
|
} else {
|
|
21
|
-
const s = a.payment_due_at ?
|
|
22
|
-
t.balance = Math.max(n, 0), t.interest_rate =
|
|
20
|
+
const s = a.payment_due_at ? o(m(a.payment_due_at)) : 1, r = _(/* @__PURE__ */ new Date()).setDate(s), n = a.balance ?? 0, i = a.minimum_payment ?? void 0, c = a.interest_rate ?? a.apr ?? a.apy;
|
|
21
|
+
t.balance = Math.max(n, 0), t.interest_rate = c, t.is_paid_off = n === 0, t.monthly_payment = i, t.name = a?.name ?? p.unnamed_label, t.original_balance = a.original_balance, t.payment_due_date = r;
|
|
23
22
|
}
|
|
24
23
|
return t.is_impossible = !1, t.priority = void 0, t.projected_payoff_date = void 0, t;
|
|
25
24
|
}
|
|
26
25
|
class h {
|
|
27
26
|
isLoading = !1;
|
|
28
27
|
selectedDebtChartData = {};
|
|
29
|
-
selectedDebtPriority =
|
|
28
|
+
selectedDebtPriority = u.LOWEST_BALANCE;
|
|
30
29
|
constructor() {
|
|
31
30
|
l(this);
|
|
32
31
|
}
|
|
@@ -41,7 +40,7 @@ class h {
|
|
|
41
40
|
setSelectedDebtChartData = (e) => this.selectedDebtChartData = e;
|
|
42
41
|
setSelectedDebtPriority = (e) => this.selectedDebtPriority = e;
|
|
43
42
|
}
|
|
44
|
-
class
|
|
43
|
+
class E {
|
|
45
44
|
globalStore;
|
|
46
45
|
uiStore;
|
|
47
46
|
constructor(e) {
|
|
@@ -56,8 +55,6 @@ class A {
|
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
E as M,
|
|
62
|
-
A as a
|
|
58
|
+
u as D,
|
|
59
|
+
E as a
|
|
63
60
|
};
|
package/dist/common/index.es.js
CHANGED
|
@@ -61,7 +61,7 @@ import { startOfMonth as J } from "date-fns/startOfMonth";
|
|
|
61
61
|
import { startOfToday as L } from "date-fns/startOfToday";
|
|
62
62
|
import { f as bt, a as wt, b as O } from "../BudgetUtil-CeSLAcsl.mjs";
|
|
63
63
|
import { g as Yr, e as zr, c as Xr, d as Kr, i as jr } from "../BudgetUtil-CeSLAcsl.mjs";
|
|
64
|
-
import { a as xt } from "../DebtsStore-
|
|
64
|
+
import { a as xt } from "../DebtsStore-Dp-CraCD.mjs";
|
|
65
65
|
import { a as Ct } from "../FinstrongStore-mkALvztw.mjs";
|
|
66
66
|
import { A as Dt, m as vt, a as At, b as Et } from "../InvestmentUtil-jOyOgzIB.mjs";
|
|
67
67
|
import { M as Tt } from "../MerchantStore-DVH-QOf0.mjs";
|
|
@@ -23,7 +23,6 @@ export interface DebtsCopy {
|
|
|
23
23
|
paydown_drawer_subtitle: string;
|
|
24
24
|
paydown_drawer_title: string;
|
|
25
25
|
paydown_drawer_total_payment: string;
|
|
26
|
-
priority_sort_fastest_payoff: string;
|
|
27
26
|
priority_sort_highest_balance: string;
|
|
28
27
|
priority_sort_highest_interest: string;
|
|
29
28
|
priority_sort_lowest_balance: string;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
HIGHEST_INTEREST = 2,
|
|
6
|
-
LOWEST_BALANCE = 3,
|
|
7
|
-
HIGHEST_BALANCE = 4
|
|
1
|
+
export declare enum DebtPrioriy {
|
|
2
|
+
HIGHEST_INTEREST = 1,
|
|
3
|
+
LOWEST_BALANCE = 2,
|
|
4
|
+
HIGHEST_BALANCE = 3
|
|
8
5
|
}
|