@mx-cartographer/experiences 7.7.2 → 7.8.0-alpha-ram-goal-bug
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 +18 -0
- package/dist/Account-BiB1F8lL.mjs +118 -0
- package/dist/{Account-BfkKlfsW.mjs → Account-DuOz1a27.mjs} +1 -1
- package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
- package/dist/{AccountDetailsHeader-DqYIuhOs.mjs → AccountDetailsHeader-Cf2TUJnM.mjs} +4 -4
- package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
- package/dist/{AccountFields-yP8QdgPd.mjs → AccountFields-UdOvbQ5H.mjs} +7 -6
- package/dist/{AccountListItem-DMbu9ehd.mjs → AccountListItem-BPVxmNT_.mjs} +7 -7
- package/dist/AccountStore-BbPWe2C9.mjs +244 -0
- package/dist/Accounts-M-LTzStv.mjs +27 -0
- package/dist/{CategoryStore-Cnw9yUys.mjs → CategoryStore-BYICdb9m.mjs} +73 -73
- package/dist/CategoryUtil-meuejJqP.mjs +80 -0
- package/dist/{ConnectionsDrawer-BqR6FWJO.mjs → ConnectionsDrawer-BDpVTTSe.mjs} +1 -1
- package/dist/{DebtsStore-DuSdXM1k.mjs → DebtsStore-BIbOVCPe.mjs} +12 -12
- package/dist/{ExportCsvAction-HK5CeZWR.mjs → ExportCsvAction-CDuzTva1.mjs} +2 -2
- package/dist/GlobalAccountFilter-DQCPNc95.mjs +316 -0
- package/dist/GoalStore-B4LVt_kH.mjs +422 -0
- package/dist/{ManageIncome-BrTrlplL.mjs → ManageIncome-CL3hv8i9.mjs} +44 -44
- package/dist/NetWorthStore-yV43kJro.mjs +168 -0
- package/dist/{NotificationSettings-D4Vh3z8I.mjs → NotificationSettings-SPg3pwbX.mjs} +171 -169
- package/dist/{NotificationStore-CDX_kqHa.mjs → NotificationStore-Ck2KdNmT.mjs} +22 -14
- package/dist/{RecurringSettings-D2V6l77l.mjs → RecurringSettings-Bmnnpb48.mjs} +16 -16
- package/dist/{RecurringTransactionsStore-Caf1cq4v.mjs → RecurringTransactionsStore-BQBEJOPP.mjs} +91 -81
- package/dist/{RecurringTransactions-Bf4lX0Cn.mjs → RepeatingTransaction-miZVnk_A.mjs} +4 -4
- package/dist/{SettingsStore-krIRNwHK.mjs → SettingsStore-BHpuyujx.mjs} +1 -1
- package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
- package/dist/{SpendingLegend-gTCJLLkV.mjs → SpendingLegend-CD60HCYS.mjs} +33 -33
- package/dist/{TransactionDetails-7MHOshKQ.mjs → TransactionDetails-BDhz3DLT.mjs} +2 -2
- package/dist/TransactionStore-BSp5bOKg.mjs +705 -0
- package/dist/{User-LJpEwPtn.mjs → User-B0LnmiKO.mjs} +21 -20
- package/dist/WidgetContainer-BbPS3Yxz.mjs +555 -0
- package/dist/accounts/index.es.js +421 -391
- package/dist/accounts/stores/AccountStore.d.ts +30 -23
- package/dist/accounts/utils/Accounts.d.ts +2 -1
- package/dist/budgets/index.es.js +546 -540
- package/dist/budgets/store/BudgetsStore.d.ts +1 -0
- package/dist/cashflow/index.es.js +444 -457
- package/dist/categories/index.es.js +1 -1
- package/dist/categories/stores/CategoryStore.d.ts +10 -5
- package/dist/categories/util/CategoryUtil.d.ts +3 -2
- package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
- package/dist/common/components/SkeletonLoader.d.ts +7 -0
- package/dist/common/components/WidgetContainer.d.ts +7 -6
- package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
- package/dist/common/components/index.d.ts +2 -2
- package/dist/common/hooks/useAriaLive.d.ts +1 -1
- package/dist/common/index.es.js +459 -445
- package/dist/common/stores/AppDataStore.d.ts +3 -1
- package/dist/common/stores/GlobalCopyStore.d.ts +0 -1
- package/dist/common/stores/GlobalStore.d.ts +3 -3
- package/dist/common/stores/GlobalUiStore.d.ts +10 -6
- package/dist/common/stores/UserStore.d.ts +3 -2
- package/dist/common/types/Account.d.ts +9 -6
- package/dist/dashboard/index.es.js +84 -116
- package/dist/debts/index.es.js +417 -413
- package/dist/{exportTransactionsToCSV-BrTYdSgJ.mjs → exportTransactionsToCSV-DtQ7ovAR.mjs} +1 -1
- package/dist/finstrong/index.es.js +1167 -1110
- package/dist/goals/index.es.js +618 -598
- package/dist/goals/stores/GoalStore.d.ts +19 -4
- package/dist/help/index.es.js +13 -13
- package/dist/investments/index.es.js +330 -325
- package/dist/investments/stores/HoldingStore.d.ts +1 -0
- package/dist/networth/components/NetWorthChart.d.ts +3 -2
- package/dist/networth/components/NetWorthList.d.ts +3 -3
- package/dist/networth/index.es.js +423 -433
- package/dist/networth/stores/NetWorthStore.d.ts +20 -9
- package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
- package/dist/notifications/index.es.js +90 -91
- package/dist/notifications/stores/NotificationStore.d.ts +3 -1
- package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
- package/dist/recurringtransactions/index.es.js +543 -562
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +4 -2
- package/dist/settings/index.es.js +253 -248
- package/dist/spending/index.es.js +282 -301
- package/dist/transactions/index.es.js +269 -263
- package/dist/transactions/stores/TransactionStore.d.ts +26 -77
- package/dist/transactions/stores/UiStore.d.ts +0 -2
- package/dist/trends/index.es.js +708 -699
- package/dist/{useAccountDisplayName-BTvP_pw6.mjs → useAccountDisplayName-Bot2tb4n.mjs} +1 -1
- package/package.json +3 -3
- package/dist/AccountStore-CWFzg8-E.mjs +0 -260
- package/dist/Accounts-CWt-NRq8.mjs +0 -9
- package/dist/CategoryUtil-DZflYFam.mjs +0 -78
- package/dist/ConnectDrawer-BOjfI6rz.mjs +0 -563
- package/dist/GoalStore-C7ahxxLi.mjs +0 -364
- package/dist/NetWorthStore-xWIo9CYU.mjs +0 -150
- package/dist/TransactionStore-DJwPaZuM.mjs +0 -677
- package/dist/WidgetContainer-CrK6tyHr.mjs +0 -572
- package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
- package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
- package/dist/common/components/accountfilter/index.d.ts +0 -1
- package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { makeAutoObservable as c, observable as f, runInAction as
|
|
2
|
-
import { fromUnixTime as
|
|
3
|
-
import { F as l, A as
|
|
1
|
+
import { makeAutoObservable as c, observable as f, runInAction as d } from "mobx";
|
|
2
|
+
import { fromUnixTime as a, isSameDay as h } from "date-fns";
|
|
3
|
+
import { F as l, A as o } from "./Fetch-DecPFeGU.mjs";
|
|
4
4
|
class s {
|
|
5
5
|
fetchInstance;
|
|
6
6
|
constructor(t, i, n) {
|
|
7
7
|
this.fetchInstance = new l(t, i, void 0, n);
|
|
8
8
|
}
|
|
9
|
-
getNotifications = () => this.fetchInstance.get(
|
|
9
|
+
getNotifications = () => this.fetchInstance.get(o.NOTIFICATIONS).then(
|
|
10
10
|
(t) => t.notifications.map((i) => i.notification)
|
|
11
11
|
).finally();
|
|
12
|
-
updateNotification = (t) => this.fetchInstance.put(`${
|
|
12
|
+
updateNotification = (t) => this.fetchInstance.put(`${o.NOTIFICATIONS}/${t.guid}`, {
|
|
13
13
|
guid: t.guid,
|
|
14
14
|
has_been_viewed: t.has_been_viewed
|
|
15
15
|
}).then((i) => i.notification).finally();
|
|
16
16
|
// Note: The notifications/mark_all_as_viewed endpoint is broken, but still returns 202.
|
|
17
17
|
// A bug ticket has been filed to fix it, but should not require any changes here.
|
|
18
|
-
markAllAsViewed = (t) => this.fetchInstance.put(`${
|
|
18
|
+
markAllAsViewed = (t) => this.fetchInstance.put(`${o.NOTIFICATIONS}/mark_all_as_viewed`, { channel: t }).finally();
|
|
19
19
|
}
|
|
20
20
|
const w = (e, t) => {
|
|
21
|
-
const i =
|
|
22
|
-
return !
|
|
21
|
+
const i = a(t[e].delivered_at), n = a(t[e - 1]?.delivered_at);
|
|
22
|
+
return !h(i, n);
|
|
23
23
|
};
|
|
24
24
|
function u(e) {
|
|
25
25
|
const i = Math.floor(Date.now() / 1e3);
|
|
@@ -33,7 +33,7 @@ class A {
|
|
|
33
33
|
api = new s("/", "");
|
|
34
34
|
isLoading = !0;
|
|
35
35
|
notifications = [];
|
|
36
|
-
|
|
36
|
+
notificationsLoaded = !1;
|
|
37
37
|
constructor(t) {
|
|
38
38
|
this.globalStore = t, this.api = new s(
|
|
39
39
|
t.endpoint,
|
|
@@ -45,19 +45,27 @@ class A {
|
|
|
45
45
|
get newNotifications() {
|
|
46
46
|
return this.recentNotifications.filter((t) => !t.has_been_viewed);
|
|
47
47
|
}
|
|
48
|
+
get recentNotifications() {
|
|
49
|
+
return u(this.notifications);
|
|
50
|
+
}
|
|
51
|
+
setNotifications = (t) => {
|
|
52
|
+
this.notifications = t, this.notificationsLoaded = !0;
|
|
53
|
+
};
|
|
48
54
|
loadNotifications = async () => {
|
|
55
|
+
this.isLoading = !0;
|
|
49
56
|
try {
|
|
50
|
-
this.isLoading = !0;
|
|
51
57
|
const t = await this.api.getNotifications();
|
|
52
|
-
|
|
53
|
-
this.notifications = t, this.recentNotifications = u(t), this.isLoading = !1;
|
|
54
|
-
});
|
|
58
|
+
this.setNotifications(t);
|
|
55
59
|
} catch (t) {
|
|
56
60
|
console.error(`Error occurred while loading notifications: ${t}`);
|
|
61
|
+
} finally {
|
|
62
|
+
d(() => {
|
|
63
|
+
this.isLoading = !1;
|
|
64
|
+
});
|
|
57
65
|
}
|
|
58
66
|
};
|
|
59
67
|
markAllAsViewed = async () => {
|
|
60
|
-
|
|
68
|
+
await this.api.markAllAsViewed();
|
|
61
69
|
};
|
|
62
70
|
updateNotification = async (t) => {
|
|
63
71
|
t.has_been_viewed = !0, await this.api.updateNotification(t);
|
|
@@ -3,21 +3,21 @@ import u from "react";
|
|
|
3
3
|
import { observer as h } from "mobx-react-lite";
|
|
4
4
|
import c from "@mui/material/Box";
|
|
5
5
|
import p from "@mui/material/Tab";
|
|
6
|
-
import
|
|
6
|
+
import R from "@mui/material/Tabs";
|
|
7
7
|
import d from "@mui/material/Divider";
|
|
8
|
-
import
|
|
8
|
+
import b from "@mui/material/List";
|
|
9
9
|
import T from "@mui/material/Stack";
|
|
10
|
-
import { R as C, A as S, a as E, M as v } from "./ManageIncome-
|
|
10
|
+
import { R as C, A as S, a as E, M as v } from "./ManageIncome-CL3hv8i9.mjs";
|
|
11
11
|
import { u as _, j as A, g as f } from "./hooks-ZMp65DFz.mjs";
|
|
12
|
-
import { R as y, F as N } from "./
|
|
13
|
-
import { A as m } from "./WidgetContainer-
|
|
12
|
+
import { R as y, F as N } from "./RepeatingTransaction-miZVnk_A.mjs";
|
|
13
|
+
import { A as m } from "./WidgetContainer-BbPS3Yxz.mjs";
|
|
14
14
|
const I = h(() => {
|
|
15
|
-
const { recurring: g } = _(), {
|
|
16
|
-
|
|
15
|
+
const { recurring: g } = _(), { detailedRepeatingTransactions: n } = A(), { onEvent: a } = f(), l = (r) => {
|
|
16
|
+
a(m.RECURRING_TRANSACTIONS_CLICK_EXPENSE, {
|
|
17
17
|
repeating_transaction_guid: r.guid
|
|
18
18
|
});
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, o = () => {
|
|
20
|
+
a(m.RECURRING_TRANSACTIONS_CLICK_ADD_EXPENSE);
|
|
21
21
|
}, i = n.filter(
|
|
22
22
|
(r) => r.repeating_transaction_type !== y.Income && (r.transactions.length > 0 || r.recurrence_type === N.EveryYear)
|
|
23
23
|
);
|
|
@@ -29,7 +29,7 @@ const I = h(() => {
|
|
|
29
29
|
maxHeight: "calc(100vh - 109px)"
|
|
30
30
|
},
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */ e(c, { sx: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ e(
|
|
32
|
+
/* @__PURE__ */ e(c, { sx: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ e(b, { sx: { bgcolor: "background.paper" }, children: i.map((r, s) => /* @__PURE__ */ t(u.Fragment, { children: [
|
|
33
33
|
/* @__PURE__ */ e(C, { onClick: l, repeatingTransaction: r }),
|
|
34
34
|
/* @__PURE__ */ e(
|
|
35
35
|
d,
|
|
@@ -51,7 +51,7 @@ const I = h(() => {
|
|
|
51
51
|
py: 12,
|
|
52
52
|
textAlign: "right"
|
|
53
53
|
},
|
|
54
|
-
children: /* @__PURE__ */ e(S, { label: g.add_expense, onAddRecurringTransaction:
|
|
54
|
+
children: /* @__PURE__ */ e(S, { label: g.add_expense, onAddRecurringTransaction: o })
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
] })
|
|
@@ -59,13 +59,13 @@ const I = h(() => {
|
|
|
59
59
|
}
|
|
60
60
|
) : /* @__PURE__ */ e(E, { zeroStateFor: "expenses" }) });
|
|
61
61
|
}), X = h(({ defaultSelectedTab: g = 0 }) => {
|
|
62
|
-
const [n,
|
|
62
|
+
const [n, a] = u.useState(g), { onEvent: l } = f(), { recurring: o } = _();
|
|
63
63
|
return /* @__PURE__ */ t(c, { bgcolor: "background.default", height: "100%", children: [
|
|
64
64
|
/* @__PURE__ */ t(
|
|
65
|
-
|
|
65
|
+
R,
|
|
66
66
|
{
|
|
67
67
|
onChange: (r, s) => {
|
|
68
|
-
|
|
68
|
+
a(s), l(
|
|
69
69
|
s === 0 ? "recurring_transactions_widget_manage_expenses" : "recurring_transactions_widget_edit_income"
|
|
70
70
|
);
|
|
71
71
|
},
|
|
@@ -73,8 +73,8 @@ const I = h(() => {
|
|
|
73
73
|
value: n,
|
|
74
74
|
variant: "fullWidth",
|
|
75
75
|
children: [
|
|
76
|
-
/* @__PURE__ */ e(p, { label:
|
|
77
|
-
/* @__PURE__ */ e(p, { label:
|
|
76
|
+
/* @__PURE__ */ e(p, { label: o.expenses }),
|
|
77
|
+
/* @__PURE__ */ e(p, { label: o.income })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
),
|
package/dist/{RecurringTransactionsStore-Caf1cq4v.mjs → RecurringTransactionsStore-BQBEJOPP.mjs}
RENAMED
|
@@ -1,58 +1,64 @@
|
|
|
1
|
-
import { makeAutoObservable as
|
|
2
|
-
import { endOfMonth as
|
|
3
|
-
import { isAfter as
|
|
4
|
-
import { isBefore as
|
|
5
|
-
import { isSameDay as
|
|
6
|
-
import { isWithinInterval as
|
|
7
|
-
import { startOfMonth as
|
|
8
|
-
import { startOfToday as
|
|
9
|
-
import { subDays as
|
|
1
|
+
import { makeAutoObservable as R, runInAction as c } from "mobx";
|
|
2
|
+
import { endOfMonth as f } from "date-fns/endOfMonth";
|
|
3
|
+
import { isAfter as g } from "date-fns/isAfter";
|
|
4
|
+
import { isBefore as S } from "date-fns/isBefore";
|
|
5
|
+
import { isSameDay as p } from "date-fns/isSameDay";
|
|
6
|
+
import { isWithinInterval as T } from "date-fns/isWithinInterval";
|
|
7
|
+
import { startOfMonth as y } from "date-fns/startOfMonth";
|
|
8
|
+
import { startOfToday as i } from "date-fns/startOfToday";
|
|
9
|
+
import { subDays as I } from "date-fns/subDays";
|
|
10
10
|
import { F as x, A as o } from "./Fetch-DecPFeGU.mjs";
|
|
11
|
-
import {
|
|
12
|
-
var
|
|
13
|
-
const
|
|
11
|
+
import { a as u, b as A, c as r, d } from "./RepeatingTransaction-miZVnk_A.mjs";
|
|
12
|
+
var E = /* @__PURE__ */ ((a) => (a.Small = "small", a.Medium = "medium", a.Large = "large", a))(E || {});
|
|
13
|
+
const G = 44;
|
|
14
14
|
class h {
|
|
15
15
|
fetchInstance;
|
|
16
|
-
constructor(
|
|
17
|
-
this.fetchInstance = new x(
|
|
16
|
+
constructor(t, e, n) {
|
|
17
|
+
this.fetchInstance = new x(t, e, void 0, n);
|
|
18
18
|
}
|
|
19
|
-
addRepeatingTransaction = async (
|
|
20
|
-
getRepeatingTransactions = async () => this.fetchInstance.get(o.REPEATING_TRANSACTIONS).then((
|
|
21
|
-
updateRepeatingTransaction = async (
|
|
22
|
-
`${o.REPEATING_TRANSACTIONS}/${
|
|
23
|
-
|
|
24
|
-
).then((
|
|
25
|
-
deleteRepeatingTransaction = async (
|
|
19
|
+
addRepeatingTransaction = async (t) => this.fetchInstance.post(o.REPEATING_TRANSACTIONS, t).then((e) => e.repeating_transaction);
|
|
20
|
+
getRepeatingTransactions = async () => this.fetchInstance.get(o.REPEATING_TRANSACTIONS).then((t) => t.repeating_transactions);
|
|
21
|
+
updateRepeatingTransaction = async (t) => this.fetchInstance.put(
|
|
22
|
+
`${o.REPEATING_TRANSACTIONS}/${t.guid}`,
|
|
23
|
+
t
|
|
24
|
+
).then((e) => e.repeating_transaction);
|
|
25
|
+
deleteRepeatingTransaction = async (t) => this.fetchInstance.delete(`${o.REPEATING_TRANSACTIONS}/${t}`).then((e) => e);
|
|
26
26
|
}
|
|
27
|
-
const l = (
|
|
28
|
-
class
|
|
27
|
+
const l = (a, t) => T(t.expectedDate, a), s = (a, t) => a + t.amount;
|
|
28
|
+
class U {
|
|
29
29
|
globalStore;
|
|
30
30
|
api = new h("/", "");
|
|
31
|
-
transactions = [];
|
|
32
31
|
repeatingTransactions = [];
|
|
33
|
-
selectedDay;
|
|
34
|
-
dateRange = { start: S(c()), end: R(c()) };
|
|
35
32
|
isDataLoaded = !1;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
selectedDay;
|
|
34
|
+
dateRange = { start: y(i()), end: f(i()) };
|
|
35
|
+
constructor(t) {
|
|
36
|
+
this.globalStore = t, this.api = new h(
|
|
37
|
+
t.endpoint,
|
|
38
|
+
t.sessionToken,
|
|
39
|
+
t.onError
|
|
40
|
+
), R(this);
|
|
41
|
+
}
|
|
42
|
+
get detailedRepeatingTransactions() {
|
|
43
|
+
return u(
|
|
44
|
+
this.globalStore.accountStore.visibleAccounts,
|
|
45
|
+
this.repeatingTransactions,
|
|
46
|
+
this.globalStore.transactionStore.transactions
|
|
47
|
+
);
|
|
42
48
|
}
|
|
43
49
|
/**
|
|
44
50
|
* Returns all recurrences built from repeating transactions and filtered by accounts.
|
|
45
51
|
*/
|
|
46
52
|
get recurrences() {
|
|
47
|
-
const
|
|
48
|
-
return
|
|
53
|
+
const t = this.globalStore.accountStore.visibleAccounts;
|
|
54
|
+
return A(this.detailedRepeatingTransactions, this.dateRange).filter((e) => t.some((n) => n.guid === e.accountGuid && !n.is_excluded_from_accounts)).filter((e) => T(e.expectedDate, this.dateRange));
|
|
49
55
|
}
|
|
50
56
|
/**
|
|
51
57
|
* Returns all recurrences that have occurred in the past, including those that are paid or missed
|
|
52
58
|
*/
|
|
53
59
|
get pastRecurrences() {
|
|
54
60
|
return this.recurrences.filter(
|
|
55
|
-
(
|
|
61
|
+
(t) => t.status === r.Paid || t.status === r.Missed
|
|
56
62
|
);
|
|
57
63
|
}
|
|
58
64
|
/**
|
|
@@ -61,7 +67,7 @@ class C {
|
|
|
61
67
|
*/
|
|
62
68
|
get upcomingRecurrences() {
|
|
63
69
|
return this.recurrences.filter(
|
|
64
|
-
(
|
|
70
|
+
(t) => g(t.expectedDate, I(i(), 3)) && S(t.expectedDate, this.dateRange.end) && t.status === r.Upcoming
|
|
65
71
|
);
|
|
66
72
|
}
|
|
67
73
|
/**
|
|
@@ -69,7 +75,7 @@ class C {
|
|
|
69
75
|
*/
|
|
70
76
|
get expenses() {
|
|
71
77
|
return this.recurrences.filter(
|
|
72
|
-
(
|
|
78
|
+
(t) => t.type === d.Expense
|
|
73
79
|
);
|
|
74
80
|
}
|
|
75
81
|
/**
|
|
@@ -77,7 +83,7 @@ class C {
|
|
|
77
83
|
*/
|
|
78
84
|
get upcomingExpenses() {
|
|
79
85
|
return this.expenses.filter(
|
|
80
|
-
(
|
|
86
|
+
(t) => t.status === r.Upcoming
|
|
81
87
|
);
|
|
82
88
|
}
|
|
83
89
|
/**
|
|
@@ -85,7 +91,7 @@ class C {
|
|
|
85
91
|
*/
|
|
86
92
|
get income() {
|
|
87
93
|
return this.recurrences.filter(
|
|
88
|
-
(
|
|
94
|
+
(t) => t.type === d.Income
|
|
89
95
|
);
|
|
90
96
|
}
|
|
91
97
|
/**
|
|
@@ -93,18 +99,18 @@ class C {
|
|
|
93
99
|
*/
|
|
94
100
|
get upcomingIncome() {
|
|
95
101
|
return this.income.filter(
|
|
96
|
-
(
|
|
102
|
+
(t) => t.status === r.Upcoming
|
|
97
103
|
);
|
|
98
104
|
}
|
|
99
105
|
get nextIncomeRecurrence() {
|
|
100
|
-
return this.upcomingIncome.find((
|
|
106
|
+
return this.upcomingIncome.find((t) => g(t.expectedDate, i()));
|
|
101
107
|
}
|
|
102
108
|
/**
|
|
103
109
|
* Returns the expense recurrences for the current month.
|
|
104
110
|
*/
|
|
105
111
|
get currentMonthExpenses() {
|
|
106
112
|
return this.expenses.filter(
|
|
107
|
-
(
|
|
113
|
+
(t) => l(this.dateRange, t)
|
|
108
114
|
);
|
|
109
115
|
}
|
|
110
116
|
/**
|
|
@@ -112,7 +118,7 @@ class C {
|
|
|
112
118
|
*/
|
|
113
119
|
get currentMonthIncome() {
|
|
114
120
|
return this.income.filter(
|
|
115
|
-
(
|
|
121
|
+
(t) => l(this.dateRange, t)
|
|
116
122
|
);
|
|
117
123
|
}
|
|
118
124
|
/**
|
|
@@ -125,19 +131,19 @@ class C {
|
|
|
125
131
|
* Calculates the total amount of all paid expenses for the current month.
|
|
126
132
|
*/
|
|
127
133
|
get paidExpenseTotal() {
|
|
128
|
-
return this.currentMonthExpenses.filter((
|
|
134
|
+
return this.currentMonthExpenses.filter((t) => t.status === r.Paid).reduce(s, 0);
|
|
129
135
|
}
|
|
130
136
|
/**
|
|
131
137
|
* Calculates the total amount of all missed expenses for the current month.
|
|
132
138
|
*/
|
|
133
139
|
get missedExpenseTotal() {
|
|
134
|
-
return this.currentMonthExpenses.filter((
|
|
140
|
+
return this.currentMonthExpenses.filter((t) => t.status === r.Missed).reduce(s, 0);
|
|
135
141
|
}
|
|
136
142
|
/**
|
|
137
143
|
* Calculates the total amount of all upcoming expenses for the current month.
|
|
138
144
|
*/
|
|
139
145
|
get upcomingExpenseTotal() {
|
|
140
|
-
return this.currentMonthExpenses.filter((
|
|
146
|
+
return this.currentMonthExpenses.filter((t) => t.status === r.Upcoming).reduce(s, 0);
|
|
141
147
|
}
|
|
142
148
|
/**
|
|
143
149
|
* Calculates the total amount of all income for the current month.
|
|
@@ -149,49 +155,53 @@ class C {
|
|
|
149
155
|
* Calculates the total amount of all paid income for the current month.
|
|
150
156
|
*/
|
|
151
157
|
get paidIncomeTotal() {
|
|
152
|
-
return this.currentMonthIncome.filter((
|
|
158
|
+
return this.currentMonthIncome.filter((t) => t.status === r.Paid).reduce(s, 0);
|
|
153
159
|
}
|
|
154
160
|
/**
|
|
155
161
|
* Calculates the total amount of all upcoming income for the current month.
|
|
156
162
|
*/
|
|
157
163
|
get upcomingIncomeTotal() {
|
|
158
|
-
return this.currentMonthIncome.filter((
|
|
164
|
+
return this.currentMonthIncome.filter((t) => t.status === r.Upcoming).reduce(s, 0);
|
|
159
165
|
}
|
|
160
166
|
/**
|
|
161
167
|
* Get the recurrences for the currently selected day.
|
|
162
168
|
*/
|
|
163
169
|
get selectedDayRecurrences() {
|
|
164
170
|
return this.selectedDay && this.recurrences.filter(
|
|
165
|
-
(
|
|
171
|
+
(t) => this.selectedDay && p(t.occurredOnDate || t.expectedDate, this.selectedDay)
|
|
166
172
|
);
|
|
167
173
|
}
|
|
174
|
+
setRepeatingTransactions = (t) => {
|
|
175
|
+
this.repeatingTransactions = t, this.isDataLoaded = !0;
|
|
176
|
+
};
|
|
168
177
|
/**
|
|
169
178
|
* Set the date range for filtering recurrences.
|
|
170
179
|
* @param dateRange - The date range to set.
|
|
171
180
|
*/
|
|
172
|
-
setDateRange = (
|
|
181
|
+
setDateRange = (t) => this.dateRange = t;
|
|
173
182
|
/**
|
|
174
183
|
* Set the currently selected day.
|
|
175
184
|
* @param day - The day to select.
|
|
176
185
|
*/
|
|
177
|
-
setSelectedDay = (
|
|
178
|
-
this.selectedDay = this.selectedDay &&
|
|
186
|
+
setSelectedDay = (t) => {
|
|
187
|
+
this.selectedDay = this.selectedDay && p(t, this.selectedDay) ? void 0 : t;
|
|
188
|
+
};
|
|
189
|
+
loadRepeatingTransactionData = async () => {
|
|
190
|
+
await Promise.all([
|
|
191
|
+
this.globalStore.accountStore.loadAccountData(),
|
|
192
|
+
this.globalStore.categoryStore.loadCategories(),
|
|
193
|
+
this.globalStore.transactionStore.loadTransactionData()
|
|
194
|
+
]), await this.loadRepeatingTransactions();
|
|
179
195
|
};
|
|
180
196
|
/**
|
|
181
197
|
* Load repeating transactions and augment them with additional data.
|
|
182
198
|
*/
|
|
183
199
|
loadRepeatingTransactions = async () => {
|
|
184
200
|
try {
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
e,
|
|
190
|
-
this.globalStore.transactionStore.transactions
|
|
191
|
-
), this.isDataLoaded = !0;
|
|
192
|
-
});
|
|
193
|
-
} catch (e) {
|
|
194
|
-
console.error(`Error occurred while getting repeating transactions: ${e}`);
|
|
201
|
+
const t = await this.api.getRepeatingTransactions();
|
|
202
|
+
this.setRepeatingTransactions(t);
|
|
203
|
+
} catch (t) {
|
|
204
|
+
console.error(`Error occurred while getting repeating transactions: ${t}`);
|
|
195
205
|
}
|
|
196
206
|
};
|
|
197
207
|
/**
|
|
@@ -199,13 +209,13 @@ class C {
|
|
|
199
209
|
* @param repeatingTransaction - The repeating transaction to add.
|
|
200
210
|
* @param transaction - The transaction associated with the repeating transaction.
|
|
201
211
|
*/
|
|
202
|
-
addRepeatingTransaction = async (
|
|
212
|
+
addRepeatingTransaction = async (t, e) => {
|
|
203
213
|
try {
|
|
204
|
-
const n = await this.api.addRepeatingTransaction(
|
|
214
|
+
const n = await this.api.addRepeatingTransaction(t);
|
|
205
215
|
await this.globalStore.transactionStore.updateTransaction({
|
|
206
|
-
...
|
|
216
|
+
...e,
|
|
207
217
|
repeating_transaction_guid: n.guid
|
|
208
|
-
}),
|
|
218
|
+
}), c(() => {
|
|
209
219
|
this.repeatingTransactions = [
|
|
210
220
|
...this.repeatingTransactions,
|
|
211
221
|
...u(
|
|
@@ -223,45 +233,45 @@ class C {
|
|
|
223
233
|
* Delete a repeating transaction by its GUID.
|
|
224
234
|
* @param guid - The GUID of the repeating transaction to delete.
|
|
225
235
|
*/
|
|
226
|
-
deleteRepeatingTransaction = async (
|
|
236
|
+
deleteRepeatingTransaction = async (t) => {
|
|
227
237
|
try {
|
|
228
|
-
await this.api.deleteRepeatingTransaction(
|
|
238
|
+
await this.api.deleteRepeatingTransaction(t), c(() => {
|
|
229
239
|
this.repeatingTransactions = [
|
|
230
|
-
...this.repeatingTransactions.filter((
|
|
240
|
+
...this.repeatingTransactions.filter((e) => e.guid !== t)
|
|
231
241
|
];
|
|
232
242
|
});
|
|
233
|
-
} catch (
|
|
234
|
-
console.error(`Error occurred while deleting repeating transaction: ${
|
|
243
|
+
} catch (e) {
|
|
244
|
+
console.error(`Error occurred while deleting repeating transaction: ${e}`);
|
|
235
245
|
}
|
|
236
246
|
};
|
|
237
247
|
/**
|
|
238
248
|
* Update an existing repeating transaction.
|
|
239
249
|
* @param transaction - The repeating transaction to update.
|
|
240
250
|
*/
|
|
241
|
-
updateRepeatingTransaction = async (
|
|
251
|
+
updateRepeatingTransaction = async (t) => {
|
|
242
252
|
try {
|
|
243
|
-
const
|
|
244
|
-
(
|
|
253
|
+
const e = await this.api.updateRepeatingTransaction(t), n = this.repeatingTransactions.findIndex(
|
|
254
|
+
(m) => m.guid === e.guid
|
|
245
255
|
);
|
|
246
256
|
if (n < 0) return;
|
|
247
|
-
|
|
257
|
+
c(() => {
|
|
248
258
|
this.repeatingTransactions = [
|
|
249
259
|
...this.repeatingTransactions.slice(0, n),
|
|
250
260
|
...u(
|
|
251
261
|
this.globalStore.accountStore.visibleAccounts,
|
|
252
|
-
[
|
|
262
|
+
[e],
|
|
253
263
|
this.globalStore.transactionStore.transactions
|
|
254
264
|
),
|
|
255
265
|
...this.repeatingTransactions.slice(n + 1)
|
|
256
266
|
];
|
|
257
267
|
});
|
|
258
|
-
} catch (
|
|
259
|
-
console.error(`Error occurred while updating repeating transaction: ${
|
|
268
|
+
} catch (e) {
|
|
269
|
+
console.error(`Error occurred while updating repeating transaction: ${e}`);
|
|
260
270
|
}
|
|
261
271
|
};
|
|
262
272
|
}
|
|
263
273
|
export {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
274
|
+
U as R,
|
|
275
|
+
E as S,
|
|
276
|
+
G as T
|
|
267
277
|
};
|
|
@@ -33,7 +33,6 @@ import { g as R, a as ee, b as te, c as re, d as oe, e as ae, f as ne } from "./
|
|
|
33
33
|
import { b as W } from "./NumberFormatting-DjTD0t3W.mjs";
|
|
34
34
|
import { f as v, D as k } from "./Dialog-B4PI-_bL.mjs";
|
|
35
35
|
import { b as l } from "./Localization-2MODESHW.mjs";
|
|
36
|
-
var s = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EveryWeek = 1] = "EveryWeek", e[e.EveryOtherWeek = 2] = "EveryOtherWeek", e[e.EveryMonth = 3] = "EveryMonth", e[e.EveryOtherMonth = 4] = "EveryOtherMonth", e[e.EveryQuarter = 5] = "EveryQuarter", e[e.EveryOtherQuarter = 6] = "EveryOtherQuarter", e[e.EveryYear = 7] = "EveryYear", e[e.TwiceAMonth = 8] = "TwiceAMonth", e))(s || {}), p = /* @__PURE__ */ ((e) => (e[e.Paid = 0] = "Paid", e[e.Missed = 1] = "Missed", e[e.Upcoming = 2] = "Upcoming", e))(p || {}), O = /* @__PURE__ */ ((e) => (e[e.Expense = 0] = "Expense", e[e.Income = 1] = "Income", e))(O || {}), Y = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e[e.Income = 3] = "Income", e[e.Transfer = 4] = "Transfer", e))(Y || {});
|
|
37
36
|
const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
|
|
38
37
|
const o = /* @__PURE__ */ M(B, { children: [
|
|
39
38
|
/* @__PURE__ */ d(L, { children: /* @__PURE__ */ d(P, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ d(I, { name: e, sx: { color: "text.primary" }, weight: S.Dark }) }) }),
|
|
@@ -277,15 +276,16 @@ const se = ({ iconName: e, label: a, onClick: t, value: n }) => {
|
|
|
277
276
|
}
|
|
278
277
|
return t;
|
|
279
278
|
};
|
|
279
|
+
var s = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.EveryWeek = 1] = "EveryWeek", e[e.EveryOtherWeek = 2] = "EveryOtherWeek", e[e.EveryMonth = 3] = "EveryMonth", e[e.EveryOtherMonth = 4] = "EveryOtherMonth", e[e.EveryQuarter = 5] = "EveryQuarter", e[e.EveryOtherQuarter = 6] = "EveryOtherQuarter", e[e.EveryYear = 7] = "EveryYear", e[e.TwiceAMonth = 8] = "TwiceAMonth", e))(s || {}), p = /* @__PURE__ */ ((e) => (e[e.Paid = 0] = "Paid", e[e.Missed = 1] = "Missed", e[e.Upcoming = 2] = "Upcoming", e))(p || {}), O = /* @__PURE__ */ ((e) => (e[e.Expense = 0] = "Expense", e[e.Income = 1] = "Income", e))(O || {}), Y = /* @__PURE__ */ ((e) => (e[e.Unknown = 0] = "Unknown", e[e.Subscription = 1] = "Subscription", e[e.Bill = 2] = "Bill", e[e.Income = 3] = "Income", e[e.Transfer = 4] = "Transfer", e))(Y || {});
|
|
280
280
|
export {
|
|
281
281
|
Fe as D,
|
|
282
282
|
s as F,
|
|
283
283
|
Y as R,
|
|
284
284
|
Re as S,
|
|
285
|
-
|
|
285
|
+
tt as a,
|
|
286
286
|
et as b,
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
p as c,
|
|
288
|
+
O as d,
|
|
289
289
|
at as e,
|
|
290
290
|
rt as f,
|
|
291
291
|
ot as g
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { makeAutoObservable as N, runInAction as l } from "mobx";
|
|
2
2
|
import { F as D, A as r } from "./Fetch-DecPFeGU.mjs";
|
|
3
|
-
import { B as f, A as n, I as i } from "./
|
|
3
|
+
import { B as f, A as n, I as i } from "./Notification-Bs1fdbzI.mjs";
|
|
4
4
|
import { T as m } from "./TransactionApi-CjBoLleL.mjs";
|
|
5
5
|
class y {
|
|
6
6
|
fetchInstance;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import t from "@mui/material/Stack";
|
|
3
|
+
import i from "@mui/material/Skeleton";
|
|
4
|
+
const g = ({ sx: e = {}, variant: h = "list" }) => /* @__PURE__ */ d(t, { sx: [...Array.isArray(e) ? e : [e]], children: [
|
|
5
|
+
h === "list" && /* @__PURE__ */ d(t, { gap: 24, children: [
|
|
6
|
+
/* @__PURE__ */ r(i, { height: 25, variant: "rounded", width: 150 }),
|
|
7
|
+
/* @__PURE__ */ r(i, { height: 50, variant: "rounded" }),
|
|
8
|
+
/* @__PURE__ */ r(i, { height: 50, variant: "rounded" }),
|
|
9
|
+
/* @__PURE__ */ r(i, { height: 50, variant: "rounded" })
|
|
10
|
+
] }),
|
|
11
|
+
h === "card" && /* @__PURE__ */ d(t, { gap: 24, children: [
|
|
12
|
+
/* @__PURE__ */ r(i, { height: 50, variant: "rounded" }),
|
|
13
|
+
/* @__PURE__ */ d(t, { direction: "row", gap: 24, children: [
|
|
14
|
+
/* @__PURE__ */ r(i, { height: 300, variant: "rounded", width: "20%" }),
|
|
15
|
+
/* @__PURE__ */ r(i, { height: 300, variant: "rounded", width: "80%" })
|
|
16
|
+
] })
|
|
17
|
+
] }),
|
|
18
|
+
h === "dashboard" && /* @__PURE__ */ d(t, { gap: 24, children: [
|
|
19
|
+
/* @__PURE__ */ r(i, { height: 75, variant: "rounded" }),
|
|
20
|
+
/* @__PURE__ */ d(t, { gap: 24, children: [
|
|
21
|
+
/* @__PURE__ */ d(t, { direction: "row", gap: 24, children: [
|
|
22
|
+
/* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "75%" }),
|
|
23
|
+
/* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "25%" })
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ d(t, { direction: "row", gap: 24, children: [
|
|
26
|
+
/* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "75%" }),
|
|
27
|
+
/* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "25%" })
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ d(t, { direction: "row", gap: 24, children: [
|
|
30
|
+
/* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "75%" }),
|
|
31
|
+
/* @__PURE__ */ r(i, { height: 250, variant: "rounded", width: "25%" })
|
|
32
|
+
] })
|
|
33
|
+
] })
|
|
34
|
+
] })
|
|
35
|
+
] });
|
|
36
|
+
export {
|
|
37
|
+
g as S
|
|
38
|
+
};
|