@mx-cartographer/experiences 9.4.30 → 9.4.32
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 +8 -0
- package/dist/budgets/BubbleBudgetsMiniWidget.es.js +43 -42
- package/dist/budgets/BubbleBudgetsMiniWidget.es.js.map +1 -1
- package/dist/common/components/MiniWidgetContainer.d.ts +11 -0
- package/dist/common/components/MiniWidgetContainer.es.js +89 -63
- package/dist/common/components/MiniWidgetContainer.es.js.map +1 -1
- package/dist/core/api/AccountApi.d.ts +3 -2
- package/dist/core/api/AccountApi.es.js +1 -0
- package/dist/core/api/AccountApi.es.js.map +1 -1
- package/dist/core/stores/NetWorthStore.d.ts +3 -0
- package/dist/core/stores/NetWorthStore.es.js +30 -18
- package/dist/core/stores/NetWorthStore.es.js.map +1 -1
- package/dist/core/types/Account.d.ts +10 -0
- package/dist/core/types/Account.es.js.map +1 -1
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/utils/NetWorthUtils.d.ts +2 -1
- package/dist/core/utils/NetWorthUtils.es.js +58 -46
- package/dist/core/utils/NetWorthUtils.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [9.4.32] - 09-18-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Historical account balances to net worth widget
|
|
4
|
+
|
|
5
|
+
## [9.4.31] - 09-18-2026
|
|
6
|
+
|
|
7
|
+
- **FIXED** - Mini widget containers now expose a labelled `region` landmark, so screen readers announce the widget name (and a short summary, for Budgets) when the browse cursor lands on it instead of staying silent (MEW-3709)
|
|
8
|
+
|
|
1
9
|
## [9.4.30] - 09-17-2026
|
|
2
10
|
|
|
3
11
|
- **FIXED** - Budgets bubble tooltip is hidden from assistive tech so it is no longer announced out of focus order or left undismissable by mobile screen readers (MEW-3715)
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { useBudgetsStore as
|
|
2
|
-
import { useWidgetLoadTimer as
|
|
3
|
-
import
|
|
4
|
-
import { ANALYTICS_EVENTS as
|
|
5
|
-
import { formatCurrency as
|
|
6
|
-
import { getBudgetDifference as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { AddBudgets as
|
|
10
|
-
import { BubbleBudgets as
|
|
1
|
+
import { useBudgetsStore as S, useCategoryStore as x, useEvent as E, useGlobalCopyStore as L, useGlobalUiStore as T, useWidgetContainerProvider as W } from "../common/context/hooks.es.js";
|
|
2
|
+
import { useWidgetLoadTimer as w } from "../common/hooks/useWidgetLoadTimer.es.js";
|
|
3
|
+
import O from "../common/components/drawer/Drawer.es.js";
|
|
4
|
+
import { ANALYTICS_EVENTS as R } from "../common/constants/Analytics.es.js";
|
|
5
|
+
import { formatCurrency as p } from "../core/utils/NumberFormatting.es.js";
|
|
6
|
+
import { getBudgetDifference as H } from "../core/utils/BudgetUtil.es.js";
|
|
7
|
+
import I from "../common/components/MiniWidgetContainer.es.js";
|
|
8
|
+
import j from "../common/components/Loader.es.js";
|
|
9
|
+
import { AddBudgets as k } from "./components/AddBudgets.es.js";
|
|
10
|
+
import { BubbleBudgets as G } from "./components/BubbleBudgets.es.js";
|
|
11
11
|
import o from "react";
|
|
12
|
-
import { observer as
|
|
13
|
-
import
|
|
14
|
-
import { Text as
|
|
12
|
+
import { observer as N } from "mobx-react-lite";
|
|
13
|
+
import $ from "@mui/material/Stack";
|
|
14
|
+
import { Text as b } from "@mxenabled/mxui";
|
|
15
15
|
import { endOfMonth as U } from "date-fns/endOfMonth";
|
|
16
16
|
import { startOfMonth as z } from "date-fns/startOfMonth";
|
|
17
|
-
import { jsx as r, jsxs as
|
|
17
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
18
18
|
import { useTheme as K } from "@mui/material/styles";
|
|
19
19
|
import P from "@mui/material/Box";
|
|
20
20
|
var V = ({ budgetsCopy: n, difference: i, handleAddClick: l, shouldShowZeroState: a }) => {
|
|
21
|
-
const { availableHeight: e = 0 } =
|
|
21
|
+
const { availableHeight: e = 0 } = W(), s = o.useRef(null);
|
|
22
22
|
o.useEffect(() => {
|
|
23
23
|
e > 0 && s.current === null && (s.current = e);
|
|
24
24
|
}, [e]);
|
|
@@ -26,77 +26,78 @@ var V = ({ budgetsCopy: n, difference: i, handleAddClick: l, shouldShowZeroState
|
|
|
26
26
|
const t = s.current ?? e;
|
|
27
27
|
return t > 0 ? Math.round(Math.max(120, Math.min(450, t * 0.8))) - 40 : 450;
|
|
28
28
|
}, [e]);
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ h($, {
|
|
30
30
|
sx: {
|
|
31
31
|
height: "100%",
|
|
32
32
|
justifyContent: "space-between"
|
|
33
33
|
},
|
|
34
|
-
children: [/* @__PURE__ */ r(
|
|
34
|
+
children: [/* @__PURE__ */ r(G, {
|
|
35
35
|
createBudgetOnClick: l,
|
|
36
36
|
height: u,
|
|
37
37
|
isMiniWidget: !0,
|
|
38
38
|
shouldShowZeroState: a
|
|
39
|
-
}), !a && /* @__PURE__ */
|
|
39
|
+
}), !a && /* @__PURE__ */ h(P, {
|
|
40
40
|
ml: 16,
|
|
41
|
-
children: [/* @__PURE__ */ r(
|
|
41
|
+
children: [/* @__PURE__ */ r(b, {
|
|
42
42
|
bold: !0,
|
|
43
43
|
color: i < 0 ? "error.main" : "success.main",
|
|
44
|
-
children:
|
|
45
|
-
}), /* @__PURE__ */ r(
|
|
44
|
+
children: p(Math.abs(i), "0,0")
|
|
45
|
+
}), /* @__PURE__ */ r(b, { children: i < 0 ? n.overspent_in_budgets : n.left_in_budgets })]
|
|
46
46
|
})]
|
|
47
47
|
});
|
|
48
48
|
}, Y = (n) => {
|
|
49
|
-
const i = K(), { onEvent: l } =
|
|
49
|
+
const i = K(), { onEvent: l } = E(), { detailedBudgets: a, isDataLoaded: e, loadBudgetData: s, setTheme: u } = S(), { budgets: t, common: B } = L(), { isInitialized: m, selectedAccounts: c } = T(), { loadDateRangeCategoryTotals: _, loadMonthlyCategoryTotals: C } = x(), f = H(a), [y, d] = o.useState(!1);
|
|
50
50
|
o.useEffect(() => {
|
|
51
51
|
e || s().finally();
|
|
52
52
|
}, []), o.useEffect(() => {
|
|
53
53
|
u(i);
|
|
54
54
|
}, [i]), o.useEffect(() => {
|
|
55
|
-
|
|
55
|
+
m && !e && (_(c, z(/* @__PURE__ */ new Date()), U(/* @__PURE__ */ new Date())).finally(), C(c).finally());
|
|
56
56
|
}, [
|
|
57
|
-
c,
|
|
58
57
|
m,
|
|
58
|
+
c,
|
|
59
59
|
e
|
|
60
60
|
]);
|
|
61
|
-
const
|
|
62
|
-
d(!0), l(
|
|
63
|
-
},
|
|
61
|
+
const M = () => {
|
|
62
|
+
d(!0), l(R.BUDGETS_CLICK_ADD);
|
|
63
|
+
}, A = () => {
|
|
64
64
|
d(!1);
|
|
65
|
-
},
|
|
66
|
-
if (
|
|
65
|
+
}, v = () => d(!1);
|
|
66
|
+
if (w({
|
|
67
67
|
widgetName: "BubbleBudgetsMiniWidget",
|
|
68
68
|
isLoaded: e
|
|
69
|
-
}), !
|
|
70
|
-
const g = a.length === 0
|
|
71
|
-
return /* @__PURE__ */
|
|
69
|
+
}), !m || !e) return /* @__PURE__ */ r(j, {});
|
|
70
|
+
const g = a.length === 0, D = g ? void 0 : `${p(Math.abs(f), "0,0")} ${f < 0 ? t.overspent_in_budgets : t.left_in_budgets}`;
|
|
71
|
+
return /* @__PURE__ */ h(I, {
|
|
72
72
|
contentStyles: {
|
|
73
73
|
height: "calc(100% - 66px)",
|
|
74
74
|
":last-child": { pb: 0 }
|
|
75
75
|
},
|
|
76
76
|
primaryCtaLabel: g ? t.get_started_cta : t.details_cta,
|
|
77
77
|
primaryCtaLabelAria: t.details_cta_aria,
|
|
78
|
+
summaryAria: D,
|
|
78
79
|
sx: { height: "100%" },
|
|
79
80
|
title: t.budgets_title,
|
|
80
81
|
...n,
|
|
81
82
|
children: [/* @__PURE__ */ r(V, {
|
|
82
83
|
budgetsCopy: t,
|
|
83
|
-
difference:
|
|
84
|
-
handleAddClick:
|
|
84
|
+
difference: f,
|
|
85
|
+
handleAddClick: M,
|
|
85
86
|
shouldShowZeroState: g
|
|
86
|
-
}), /* @__PURE__ */ r(
|
|
87
|
-
ariaLabelClose:
|
|
88
|
-
isOpen:
|
|
87
|
+
}), /* @__PURE__ */ r(O, {
|
|
88
|
+
ariaLabelClose: B.close_aria,
|
|
89
|
+
isOpen: y,
|
|
89
90
|
onClose: () => d(!1),
|
|
90
91
|
title: t.add_new_title,
|
|
91
|
-
children: /* @__PURE__ */ r(
|
|
92
|
-
onAddBudget:
|
|
93
|
-
onRecalculateBudgets:
|
|
92
|
+
children: /* @__PURE__ */ r(k, {
|
|
93
|
+
onAddBudget: A,
|
|
94
|
+
onRecalculateBudgets: v
|
|
94
95
|
})
|
|
95
96
|
})]
|
|
96
97
|
});
|
|
97
|
-
},
|
|
98
|
+
}, fe = N(Y);
|
|
98
99
|
export {
|
|
99
|
-
|
|
100
|
+
fe as default
|
|
100
101
|
};
|
|
101
102
|
|
|
102
103
|
//# sourceMappingURL=BubbleBudgetsMiniWidget.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleBudgetsMiniWidget.es.js","names":[],"sources":["../../src/budgets/BubbleBudgetsMiniWidget.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport {\n ANALYTICS_EVENTS,\n Drawer,\n Loader,\n MiniWidgetContainer,\n useBudgetsStore,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useWidgetContainerProvider,\n useWidgetLoadTimer,\n} from '../common'\nimport { type BudgetsCopy, type MiniWidgetProps } from '../core'\n\nimport { AddBudgets } from './components/AddBudgets'\nimport { BubbleBudgets } from './components/BubbleBudgets'\nimport { getBudgetDifference } from '../core/utils/BudgetUtil'\nimport { formatCurrency } from '../core/utils/NumberFormatting'\n\ninterface BubbleBudgetsContentProps {\n budgetsCopy: BudgetsCopy\n difference: number\n handleAddClick: () => void\n shouldShowZeroState: boolean\n}\n\nconst BubbleBudgetsContent: React.FC<BubbleBudgetsContentProps> = ({\n budgetsCopy,\n difference,\n handleAddClick,\n shouldShowZeroState,\n}) => {\n const { availableHeight = 0 } = useWidgetContainerProvider()\n const initialHeightRef = React.useRef<number | null>(null)\n\n React.useEffect(() => {\n if (availableHeight > 0 && initialHeightRef.current === null) {\n initialHeightRef.current = availableHeight\n }\n }, [availableHeight])\n\n const bubbleHeight = React.useMemo(() => {\n const baseHeight = initialHeightRef.current ?? availableHeight\n\n if (baseHeight > 0) return Math.round(Math.max(120, Math.min(450, baseHeight * 0.8))) - 40\n\n return 450\n }, [availableHeight])\n\n return (\n <Stack sx={{ height: '100%', justifyContent: 'space-between' }}>\n <BubbleBudgets\n createBudgetOnClick={handleAddClick}\n height={bubbleHeight}\n isMiniWidget={true}\n shouldShowZeroState={shouldShowZeroState}\n />\n\n {!shouldShowZeroState && (\n <Box ml={16}>\n <Text bold={true} color={difference < 0 ? 'error.main' : 'success.main'}>\n {formatCurrency(Math.abs(difference), '0,0')}\n </Text>\n <Text>\n {difference < 0 ? budgetsCopy.overspent_in_budgets : budgetsCopy.left_in_budgets}\n </Text>\n </Box>\n )}\n </Stack>\n )\n}\n\nconst BubbleBudgetsMiniWidget = (props: MiniWidgetProps) => {\n const theme = useTheme()\n\n const { onEvent } = useEvent()\n const { detailedBudgets: budgets, isDataLoaded, loadBudgetData, setTheme } = useBudgetsStore()\n const { budgets: budgetsCopy, common: commonCopy } = useGlobalCopyStore()\n const { isInitialized, selectedAccounts } = useGlobalUiStore()\n const { loadDateRangeCategoryTotals, loadMonthlyCategoryTotals } = useCategoryStore()\n const difference = getBudgetDifference(budgets)\n\n const [isAddOpen, setIsAddOpen] = React.useState(false)\n\n React.useEffect(() => {\n if (!isDataLoaded) {\n loadBudgetData().finally()\n }\n }, [])\n\n React.useEffect(() => {\n setTheme(theme)\n }, [theme])\n\n React.useEffect(() => {\n if (isInitialized && !isDataLoaded) {\n loadDateRangeCategoryTotals(\n selectedAccounts,\n startOfMonth(new Date()),\n endOfMonth(new Date()),\n ).finally()\n loadMonthlyCategoryTotals(selectedAccounts).finally()\n }\n }, [isInitialized, selectedAccounts, isDataLoaded])\n\n const handleAddClick = () => {\n setIsAddOpen(true)\n onEvent(ANALYTICS_EVENTS.BUDGETS_CLICK_ADD)\n }\n\n const handleBudgetAdded = () => {\n setIsAddOpen(false)\n }\n\n const handleBudgetsRecalculated = () => setIsAddOpen(false)\n\n useWidgetLoadTimer({\n widgetName: 'BubbleBudgetsMiniWidget',\n isLoaded: isDataLoaded,\n })\n\n if (!isInitialized || !isDataLoaded) return <Loader />\n\n const shouldShowZeroState = budgets.length === 0\n\n return (\n <MiniWidgetContainer\n contentStyles={{ height: 'calc(100% - 66px)', ':last-child': { pb: 0 } }}\n primaryCtaLabel={shouldShowZeroState ? budgetsCopy.get_started_cta : budgetsCopy.details_cta}\n primaryCtaLabelAria={budgetsCopy.details_cta_aria}\n sx={{ height: '100%' }}\n title={budgetsCopy.budgets_title}\n {...props}\n >\n <BubbleBudgetsContent\n budgetsCopy={budgetsCopy}\n difference={difference}\n handleAddClick={handleAddClick}\n shouldShowZeroState={shouldShowZeroState}\n />\n\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isAddOpen}\n onClose={() => setIsAddOpen(false)}\n title={budgetsCopy.add_new_title}\n >\n <AddBudgets\n onAddBudget={handleBudgetAdded}\n onRecalculateBudgets={handleBudgetsRecalculated}\n />\n </Drawer>\n </MiniWidgetContainer>\n )\n}\n\nexport default observer(BubbleBudgetsMiniWidget)\n"],"mappings":";;;;;;;;;;;;;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AAA,GAAgB,UAAA,EAAA,IAAa,EAAgB,GACvF,EAAE,SAAS,GAAa,QAAQ,EAAA,IAAe,EAAmB,GAClE,EAAE,eAAA,GAAe,kBAAA,EAAA,IAAqB,EAAiB,GACvD,EAAE,6BAAA,GAA6B,2BAAA,EAAA,IAA8B,EAAiB,GAC9E,IAAa,EAAoB,CAAO,GAExC,CAAC,GAAW,CAAA,IAAgB,EAAM,SAAS,EAAK;AAEtD,EAAA,EAAM,UAAA,MAAgB;AACpB,IAAK,KACH,EAAe,EAAE,QAAQ;AAAA,EAE7B,GAAG,CAAC,CAAC,GAEL,EAAM,UAAA,MAAgB;AACpB,IAAA,EAAS,CAAK;AAAA,EAChB,GAAG,CAAC,CAAK,CAAC,GAEV,EAAM,UAAA,MAAgB;AACpB,IAAI,KAAiB,CAAC,MACpB,EACE,GACA,EAAa,oBAAI,KAAK,CAAC,GACvB,EAAW,oBAAI,KAAK,CAAC,CACvB,EAAE,QAAQ,GACV,EAA0B,CAAgB,EAAE,QAAQ;AAAA,EAExD,GAAG;AAAA,IAAC;AAAA,IAAe;AAAA,IAAkB;AAAA,EAAY,CAAC;AAElD,QAAM,IAAA,MAAuB;AAC3B,IAAA,EAAa,EAAI,GACjB,EAAQ,EAAiB,iBAAiB;AAAA,EAC5C,GAEM,IAAA,MAA0B;AAC9B,IAAA,EAAa,EAAK;AAAA,EACpB,GAEM,IAAA,MAAkC,EAAa,EAAK;AAO1D,MALA,EAAmB;AAAA,IACjB,YAAY;AAAA,IACZ,UAAU;AAAA,EACZ,CAAC,GAEG,CAAC,KAAiB,CAAC,EAAc,QAAO,gBAAA,EAAC,GAAD,CAAS,CAAA;AAErD,QAAM,IAAsB,EAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"BubbleBudgetsMiniWidget.es.js","names":[],"sources":["../../src/budgets/BubbleBudgetsMiniWidget.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { startOfMonth } from 'date-fns/startOfMonth'\n\nimport Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport {\n ANALYTICS_EVENTS,\n Drawer,\n Loader,\n MiniWidgetContainer,\n useBudgetsStore,\n useCategoryStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalUiStore,\n useWidgetContainerProvider,\n useWidgetLoadTimer,\n} from '../common'\nimport { type BudgetsCopy, type MiniWidgetProps } from '../core'\n\nimport { AddBudgets } from './components/AddBudgets'\nimport { BubbleBudgets } from './components/BubbleBudgets'\nimport { getBudgetDifference } from '../core/utils/BudgetUtil'\nimport { formatCurrency } from '../core/utils/NumberFormatting'\n\ninterface BubbleBudgetsContentProps {\n budgetsCopy: BudgetsCopy\n difference: number\n handleAddClick: () => void\n shouldShowZeroState: boolean\n}\n\nconst BubbleBudgetsContent: React.FC<BubbleBudgetsContentProps> = ({\n budgetsCopy,\n difference,\n handleAddClick,\n shouldShowZeroState,\n}) => {\n const { availableHeight = 0 } = useWidgetContainerProvider()\n const initialHeightRef = React.useRef<number | null>(null)\n\n React.useEffect(() => {\n if (availableHeight > 0 && initialHeightRef.current === null) {\n initialHeightRef.current = availableHeight\n }\n }, [availableHeight])\n\n const bubbleHeight = React.useMemo(() => {\n const baseHeight = initialHeightRef.current ?? availableHeight\n\n if (baseHeight > 0) return Math.round(Math.max(120, Math.min(450, baseHeight * 0.8))) - 40\n\n return 450\n }, [availableHeight])\n\n return (\n <Stack sx={{ height: '100%', justifyContent: 'space-between' }}>\n <BubbleBudgets\n createBudgetOnClick={handleAddClick}\n height={bubbleHeight}\n isMiniWidget={true}\n shouldShowZeroState={shouldShowZeroState}\n />\n\n {!shouldShowZeroState && (\n <Box ml={16}>\n <Text bold={true} color={difference < 0 ? 'error.main' : 'success.main'}>\n {formatCurrency(Math.abs(difference), '0,0')}\n </Text>\n <Text>\n {difference < 0 ? budgetsCopy.overspent_in_budgets : budgetsCopy.left_in_budgets}\n </Text>\n </Box>\n )}\n </Stack>\n )\n}\n\nconst BubbleBudgetsMiniWidget = (props: MiniWidgetProps) => {\n const theme = useTheme()\n\n const { onEvent } = useEvent()\n const { detailedBudgets: budgets, isDataLoaded, loadBudgetData, setTheme } = useBudgetsStore()\n const { budgets: budgetsCopy, common: commonCopy } = useGlobalCopyStore()\n const { isInitialized, selectedAccounts } = useGlobalUiStore()\n const { loadDateRangeCategoryTotals, loadMonthlyCategoryTotals } = useCategoryStore()\n const difference = getBudgetDifference(budgets)\n\n const [isAddOpen, setIsAddOpen] = React.useState(false)\n\n React.useEffect(() => {\n if (!isDataLoaded) {\n loadBudgetData().finally()\n }\n }, [])\n\n React.useEffect(() => {\n setTheme(theme)\n }, [theme])\n\n React.useEffect(() => {\n if (isInitialized && !isDataLoaded) {\n loadDateRangeCategoryTotals(\n selectedAccounts,\n startOfMonth(new Date()),\n endOfMonth(new Date()),\n ).finally()\n loadMonthlyCategoryTotals(selectedAccounts).finally()\n }\n }, [isInitialized, selectedAccounts, isDataLoaded])\n\n const handleAddClick = () => {\n setIsAddOpen(true)\n onEvent(ANALYTICS_EVENTS.BUDGETS_CLICK_ADD)\n }\n\n const handleBudgetAdded = () => {\n setIsAddOpen(false)\n }\n\n const handleBudgetsRecalculated = () => setIsAddOpen(false)\n\n useWidgetLoadTimer({\n widgetName: 'BubbleBudgetsMiniWidget',\n isLoaded: isDataLoaded,\n })\n\n if (!isInitialized || !isDataLoaded) return <Loader />\n\n const shouldShowZeroState = budgets.length === 0\n\n const summaryAria = shouldShowZeroState\n ? undefined\n : `${formatCurrency(Math.abs(difference), '0,0')} ${\n difference < 0 ? budgetsCopy.overspent_in_budgets : budgetsCopy.left_in_budgets\n }`\n\n return (\n <MiniWidgetContainer\n contentStyles={{ height: 'calc(100% - 66px)', ':last-child': { pb: 0 } }}\n primaryCtaLabel={shouldShowZeroState ? budgetsCopy.get_started_cta : budgetsCopy.details_cta}\n primaryCtaLabelAria={budgetsCopy.details_cta_aria}\n summaryAria={summaryAria}\n sx={{ height: '100%' }}\n title={budgetsCopy.budgets_title}\n {...props}\n >\n <BubbleBudgetsContent\n budgetsCopy={budgetsCopy}\n difference={difference}\n handleAddClick={handleAddClick}\n shouldShowZeroState={shouldShowZeroState}\n />\n\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isAddOpen}\n onClose={() => setIsAddOpen(false)}\n title={budgetsCopy.add_new_title}\n >\n <AddBudgets\n onAddBudget={handleBudgetAdded}\n onRecalculateBudgets={handleBudgetsRecalculated}\n />\n </Drawer>\n </MiniWidgetContainer>\n )\n}\n\nexport default observer(BubbleBudgetsMiniWidget)\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,IAAM,IAAA,CAA6D,EACjE,aAAA,GACA,YAAA,GACA,gBAAA,GACA,qBAAA,EAAA,MACI;AACJ,QAAM,EAAE,iBAAA,IAAkB,EAAA,IAAM,EAA2B,GACrD,IAAmB,EAAM,OAAsB,IAAI;AAEzD,EAAA,EAAM,UAAA,MAAgB;AACpB,IAAI,IAAkB,KAAK,EAAiB,YAAY,SACtD,EAAiB,UAAU;AAAA,EAE/B,GAAG,CAAC,CAAe,CAAC;AAEpB,QAAM,IAAe,EAAM,QAAA,MAAc;AACvC,UAAM,IAAa,EAAiB,WAAW;AAE/C,WAAI,IAAa,IAAU,KAAK,MAAM,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,IAAa,GAAG,CAAC,CAAC,IAAI,KAEjF;AAAA,EACT,GAAG,CAAC,CAAe,CAAC;AAEpB,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,QAAQ;AAAA,MAAQ,gBAAgB;AAAA,IAAgB;AAAA,IAA7D,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,qBAAqB;AAAA,MACrB,QAAQ;AAAA,MACR,cAAc;AAAA,MACO,qBAAA;AAAA,IACtB,CAAA,GAEA,CAAC,KACA,gBAAA,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Accessible name for the widget region when no visible `title` is rendered.
|
|
16
|
+
* When `title` is present, the region is labelled by the title text instead.
|
|
17
|
+
*/
|
|
18
|
+
titleAria?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Extra summary read after the title when the screen-reader cursor lands on
|
|
21
|
+
* the region (e.g. "$240 left in budgets"). Appended to the region's
|
|
22
|
+
* accessible name via a visually-hidden node so it is announced but not shown.
|
|
23
|
+
*/
|
|
24
|
+
summaryAria?: string;
|
|
14
25
|
}
|
|
15
26
|
declare const MiniWidgetContainer: React.FC<React.PropsWithChildren<CardContainerProps>>;
|
|
16
27
|
export default MiniWidgetContainer;
|
|
@@ -1,77 +1,103 @@
|
|
|
1
|
-
import { WidgetContainerProvider as
|
|
2
|
-
import { useDimensions as
|
|
3
|
-
import "react";
|
|
4
|
-
import { H3 as
|
|
5
|
-
import
|
|
6
|
-
import { ChevronRight as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
var
|
|
14
|
-
const [
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
|
|
1
|
+
import { WidgetContainerProvider as j } from "../context/WidgetContainerProvider.es.js";
|
|
2
|
+
import { useDimensions as z } from "../hooks/useDimensions.es.js";
|
|
3
|
+
import m from "react";
|
|
4
|
+
import { H3 as H, P as y, Text as R } from "@mxenabled/mxui";
|
|
5
|
+
import W from "@mui/material/Button";
|
|
6
|
+
import { ChevronRight as F, Icon as P } from "@mxenabled/mx-icons";
|
|
7
|
+
import { Fragment as S, jsx as i, jsxs as r } from "react/jsx-runtime";
|
|
8
|
+
import s from "@mui/material/Box";
|
|
9
|
+
import T from "@mui/material/IconButton";
|
|
10
|
+
import $ from "@mui/material/Card";
|
|
11
|
+
import k from "@mui/material/CardContent";
|
|
12
|
+
import D from "@mui/material/CardHeader";
|
|
13
|
+
var X = ({ children: p, className: h = "mx-cmn-mini-widget", closeLabel: f, contentStyles: x, onClose: t, onPrimaryCtaClick: n, primaryCtaLabel: g = "", primaryCtaLabelAria: b = "", subTitle: a = "", sx: u = {}, title: o = "", titleAria: v, summaryAria: e }) => {
|
|
14
|
+
const [I, { height: B, width: C }] = z(), l = m.useId(), d = m.useId(), c = !!o, w = c ? [l, e && d].filter(Boolean).join(" ") : void 0;
|
|
15
|
+
return /* @__PURE__ */ r($, {
|
|
16
|
+
"aria-label": c ? void 0 : [v, e].filter(Boolean).join(", ") || void 0,
|
|
17
|
+
"aria-labelledby": w,
|
|
18
|
+
className: h,
|
|
19
|
+
component: "section",
|
|
17
20
|
sx: {
|
|
18
21
|
touchAction: "manipulation",
|
|
19
|
-
...
|
|
22
|
+
...u
|
|
20
23
|
},
|
|
21
|
-
children: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
children: [
|
|
25
|
+
e && /* @__PURE__ */ i(s, {
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
id: d,
|
|
24
28
|
sx: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
position: "absolute",
|
|
30
|
+
width: "1px",
|
|
31
|
+
height: "1px",
|
|
32
|
+
padding: 0,
|
|
33
|
+
margin: "-1px",
|
|
34
|
+
overflow: "hidden",
|
|
35
|
+
clip: "rect(0 0 0 0)",
|
|
36
|
+
clipPath: "inset(50%)",
|
|
37
|
+
whiteSpace: "nowrap",
|
|
38
|
+
border: 0
|
|
30
39
|
},
|
|
31
|
-
children:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
children: e
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ i(D, {
|
|
43
|
+
sx: { pb: 8 },
|
|
44
|
+
title: /* @__PURE__ */ r(S, { children: [/* @__PURE__ */ r(s, {
|
|
45
|
+
sx: {
|
|
46
|
+
alignItems: "center",
|
|
47
|
+
display: "grid",
|
|
48
|
+
gap: 2,
|
|
49
|
+
gridTemplateColumns: "1fr auto",
|
|
50
|
+
pb: 4
|
|
51
|
+
},
|
|
52
|
+
children: [o && /* @__PURE__ */ i(H, {
|
|
53
|
+
id: l,
|
|
54
|
+
children: o
|
|
55
|
+
}), t ? /* @__PURE__ */ i(T, {
|
|
56
|
+
"aria-label": f,
|
|
57
|
+
onClick: t,
|
|
58
|
+
size: "small",
|
|
59
|
+
children: /* @__PURE__ */ i(P, {
|
|
60
|
+
name: "close",
|
|
61
|
+
size: 24
|
|
62
|
+
})
|
|
63
|
+
}) : n && /* @__PURE__ */ i(W, {
|
|
64
|
+
"aria-label": b,
|
|
65
|
+
endIcon: /* @__PURE__ */ i(F, {}),
|
|
66
|
+
onClick: n,
|
|
67
|
+
size: "small",
|
|
68
|
+
children: /* @__PURE__ */ i(R, {
|
|
69
|
+
bold: !0,
|
|
70
|
+
variant: "body2",
|
|
71
|
+
children: g
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
}), a && /* @__PURE__ */ i(y, {
|
|
75
|
+
color: "text.secondary",
|
|
76
|
+
sx: {
|
|
77
|
+
fontSize: 15,
|
|
78
|
+
lineHeight: "20px"
|
|
79
|
+
},
|
|
80
|
+
variant: "body2",
|
|
81
|
+
children: a
|
|
82
|
+
})] })
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ i(k, {
|
|
85
|
+
ref: I,
|
|
52
86
|
sx: {
|
|
53
|
-
|
|
54
|
-
|
|
87
|
+
p: 0,
|
|
88
|
+
...x
|
|
55
89
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
sx: {
|
|
62
|
-
p: 0,
|
|
63
|
-
...d
|
|
64
|
-
},
|
|
65
|
-
children: /* @__PURE__ */ r(x, {
|
|
66
|
-
availableHeight: f,
|
|
67
|
-
availableWidth: g,
|
|
68
|
-
children: a
|
|
90
|
+
children: /* @__PURE__ */ i(j, {
|
|
91
|
+
availableHeight: B,
|
|
92
|
+
availableWidth: C,
|
|
93
|
+
children: p
|
|
94
|
+
})
|
|
69
95
|
})
|
|
70
|
-
|
|
96
|
+
]
|
|
71
97
|
});
|
|
72
98
|
};
|
|
73
99
|
export {
|
|
74
|
-
|
|
100
|
+
X as default
|
|
75
101
|
};
|
|
76
102
|
|
|
77
103
|
//# sourceMappingURL=MiniWidgetContainer.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MiniWidgetContainer.es.js","names":[],"sources":["../../../src/common/components/MiniWidgetContainer.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport CardHeader from '@mui/material/CardHeader'\nimport CardContent from '@mui/material/CardContent'\nimport IconButton from '@mui/material/IconButton'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { ChevronRight } from '@mxenabled/mx-icons'\n\nimport { H3, P, Text } from '@mxenabled/mxui'\n\nimport { WidgetContainerProvider } from '../context'\nimport { useDimensions } from '../hooks/useDimensions'\n\ninterface CardContainerProps {\n className?: string\n closeLabel?: string\n contentStyles?: SxProps\n onClose?: () => void\n onPrimaryCtaClick?: () => void\n primaryCtaLabel?: string\n primaryCtaLabelAria?: string\n subTitle?: string\n sx?: SxProps\n title?: string\n}\n\nconst MiniWidgetContainer: React.FC<React.PropsWithChildren<CardContainerProps>> = ({\n children,\n className = 'mx-cmn-mini-widget',\n closeLabel,\n contentStyles,\n onClose,\n onPrimaryCtaClick,\n primaryCtaLabel = '',\n primaryCtaLabelAria = '',\n subTitle = '',\n sx = {},\n title = '',\n}) => {\n const [containerRef, { height, width }] = useDimensions()\n\n return (\n <Card className={className}
|
|
1
|
+
{"version":3,"file":"MiniWidgetContainer.es.js","names":[],"sources":["../../../src/common/components/MiniWidgetContainer.tsx"],"sourcesContent":["import React from 'react'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport CardHeader from '@mui/material/CardHeader'\nimport CardContent from '@mui/material/CardContent'\nimport IconButton from '@mui/material/IconButton'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Icon } from '@mxenabled/mx-icons'\nimport { ChevronRight } from '@mxenabled/mx-icons'\n\nimport { H3, P, Text } from '@mxenabled/mxui'\n\nimport { WidgetContainerProvider } from '../context'\nimport { useDimensions } from '../hooks/useDimensions'\n\ninterface CardContainerProps {\n className?: string\n closeLabel?: string\n contentStyles?: SxProps\n onClose?: () => void\n onPrimaryCtaClick?: () => void\n primaryCtaLabel?: string\n primaryCtaLabelAria?: string\n subTitle?: string\n sx?: SxProps\n title?: string\n /**\n * Accessible name for the widget region when no visible `title` is rendered.\n * When `title` is present, the region is labelled by the title text instead.\n */\n titleAria?: string\n /**\n * Extra summary read after the title when the screen-reader cursor lands on\n * the region (e.g. \"$240 left in budgets\"). Appended to the region's\n * accessible name via a visually-hidden node so it is announced but not shown.\n */\n summaryAria?: string\n}\n\nconst MiniWidgetContainer: React.FC<React.PropsWithChildren<CardContainerProps>> = ({\n children,\n className = 'mx-cmn-mini-widget',\n closeLabel,\n contentStyles,\n onClose,\n onPrimaryCtaClick,\n primaryCtaLabel = '',\n primaryCtaLabelAria = '',\n subTitle = '',\n sx = {},\n title = '',\n titleAria,\n summaryAria,\n}) => {\n const [containerRef, { height, width }] = useDimensions()\n const titleId = React.useId()\n const summaryId = React.useId()\n const hasVisibleTitle = Boolean(title)\n\n // aria-labelledby wins when a title is visible (name = title [+ summary]);\n // otherwise fall back to a plain aria-label.\n const labelledBy = hasVisibleTitle\n ? [titleId, summaryAria && summaryId].filter(Boolean).join(' ')\n : undefined\n\n return (\n <Card\n aria-label={\n hasVisibleTitle\n ? undefined\n : [titleAria, summaryAria].filter(Boolean).join(', ') || undefined\n }\n aria-labelledby={labelledBy}\n className={className}\n component=\"section\"\n sx={{ touchAction: 'manipulation', ...sx }}\n >\n {summaryAria && (\n // aria-hidden keeps this out of the browse cursor as a standalone stop;\n // aria-labelledby still pulls the text into the region's accessible name.\n <Box\n aria-hidden=\"true\"\n id={summaryId}\n sx={{\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: 0,\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n border: 0,\n }}\n >\n {summaryAria}\n </Box>\n )}\n <CardHeader\n sx={{ pb: 8 }}\n title={\n <>\n <Box\n sx={{\n alignItems: 'center',\n display: 'grid',\n gap: 2,\n gridTemplateColumns: '1fr auto',\n pb: 4,\n }}\n >\n {title && <H3 id={titleId}>{title}</H3>}\n\n {onClose ? (\n <IconButton aria-label={closeLabel} onClick={onClose} size=\"small\">\n <Icon name=\"close\" size={24} />\n </IconButton>\n ) : (\n onPrimaryCtaClick && (\n <Button\n aria-label={primaryCtaLabelAria}\n endIcon={<ChevronRight />}\n onClick={onPrimaryCtaClick}\n size=\"small\"\n >\n <Text bold={true} variant=\"body2\">\n {primaryCtaLabel}\n </Text>\n </Button>\n )\n )}\n </Box>\n\n {subTitle && (\n <P color=\"text.secondary\" sx={{ fontSize: 15, lineHeight: '20px' }} variant=\"body2\">\n {subTitle}\n </P>\n )}\n </>\n }\n />\n\n <CardContent ref={containerRef} sx={{ p: 0, ...contentStyles }}>\n <WidgetContainerProvider availableHeight={height} availableWidth={width}>\n {children}\n </WidgetContainerProvider>\n </CardContent>\n </Card>\n )\n}\n\nexport default MiniWidgetContainer\n"],"mappings":";;;;;;;;;;;;AA0CA,IAAM,IAAA,CAA8E,EAClF,UAAA,GACA,WAAA,IAAY,sBACZ,YAAA,GACA,eAAA,GACA,SAAA,GACA,mBA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AAAA,YAAI,IAAI;AAAA,YAAU,UAAA;AAAA,UAAU,CAAA,GAErC,IACC,gBAAA,EAAC,GAAD;AAAA,YAAY,cAAY;AAAA,YAAY,SAAS;AAAA,YAAS,MAAK;AAAA,YACzD,UAAA,gBAAA,EAAC,GAAD;AAAA,cAAM,MAAK;AAAA,cAAQ,MAAM;AAAA,YAAK,CAAA;AAAA,UACpB,CAAA,IAEZ,KACE,gBAAA,EAAC,GAAD;AAAA,YACE,cAAY;AAAA,YACZ,SAAS,gBAAA,EAAC,GAAD,CAAe,CAAA;AAAA,YACxB,SAAS;AAAA,YACT,MAAK;AAAA,YAEL,UAAA,gBAAA,EAAC,GAAD;AAAA,cAAM,MAAM;AAAA,cAAM,SAAQ;AAAA,cACvB,UAAA;AAAA,YACG,CAAA;AAAA,UACA,CAAA,CAGT;AAAA,QAEJ,CAAA,GAAA,KACC,gBAAA,EAAC,GAAD;AAAA,UAAG,OAAM;AAAA,UAAiB,IAAI;AAAA,YAAE,UAAU;AAAA,YAAI,YAAY;AAAA,UAAO;AAAA,UAAG,SAAQ;AAAA,UACzE,UAAA;AAAA,QACA,CAAA,CAEL,EAAA,CAAA;AAAA,MAEL,CAAA;AAAA,MAED,gBAAA,EAAC,GAAD;AAAA,QAAa,KAAK;AAAA,QAAc,IAAI;AAAA,UAAE,GAAG;AAAA,UAAG,GAAG;AAAA,QAAc;AAAA,QAC3D,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAyB,iBAAiB;AAAA,UAAQ,gBAAgB;AAAA,UAC/D,UAAA;AAAA,QACsB,CAAA;AAAA,MACd,CAAA;AAAA,IACT;AAAA;AAEV"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fetch } from '../utils';
|
|
2
|
-
import { Account, GlobalErrorHandler } from '..';
|
|
2
|
+
import { Account, GlobalErrorHandler, HistoricalAccountBalance, MonthlyAccountBalance } from '..';
|
|
3
3
|
export declare class AccountApi {
|
|
4
4
|
fetchInstance: Fetch;
|
|
5
5
|
constructor(endpoint: string, token: string, onError?: GlobalErrorHandler);
|
|
@@ -8,7 +8,8 @@ export declare class AccountApi {
|
|
|
8
8
|
getAccounts: () => Promise<any>;
|
|
9
9
|
getInstitutions: () => Promise<any>;
|
|
10
10
|
getMembers: () => Promise<any>;
|
|
11
|
-
|
|
11
|
+
getHistoricalAccountBalances: (guid: string) => Promise<HistoricalAccountBalance[]>;
|
|
12
|
+
getMonthlyAccountBalances: (guid: string) => Promise<MonthlyAccountBalance[]>;
|
|
12
13
|
mergeAccounts: (accountGuids: string[]) => Promise<any>;
|
|
13
14
|
refreshAllMembers: () => Promise<any>;
|
|
14
15
|
updateAccount: (account: Account) => Promise<any>;
|
|
@@ -10,6 +10,7 @@ var h = class {
|
|
|
10
10
|
getAccounts = async () => this.fetchInstance.get(n.ACCOUNTS).then((t) => t.accounts);
|
|
11
11
|
getInstitutions = async () => this.fetchInstance.get(n.INSTITUTIONS).then((t) => t);
|
|
12
12
|
getMembers = async () => this.fetchInstance.get(n.MEMBERS).then((t) => t.members);
|
|
13
|
+
getHistoricalAccountBalances = async (t) => this.fetchInstance.get(`${n.ACCOUNTS}/${t}/historical_account_balances`).then((e) => e.historical_account_balances);
|
|
13
14
|
getMonthlyAccountBalances = async (t) => this.fetchInstance.get(`${n.ACCOUNTS}/${t}/monthly_account_balances`).then((e) => e.monthly_account_balances);
|
|
14
15
|
mergeAccounts = async (t) => this.fetchInstance.put(`${n.ACCOUNTS}/merge`, { accounts: t }).then((e) => e);
|
|
15
16
|
refreshAllMembers = async () => this.fetchInstance.get(`${n.MEMBERS}/refresh_all`).then((t) => t);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountApi.es.js","names":[],"sources":["../../../src/core/api/AccountApi.ts"],"sourcesContent":["import { Fetch } from '../utils'\nimport { ApiEndpoints } from '../constants'\nimport type {
|
|
1
|
+
{"version":3,"file":"AccountApi.es.js","names":[],"sources":["../../../src/core/api/AccountApi.ts"],"sourcesContent":["import { Fetch } from '../utils'\nimport { ApiEndpoints } from '../constants'\nimport type {\n Account,\n GlobalErrorHandler,\n HistoricalAccountBalance,\n MonthlyAccountBalance,\n} from '..'\n\nexport class AccountApi {\n fetchInstance: Fetch\n\n constructor(endpoint: string, token: string, onError?: GlobalErrorHandler) {\n this.fetchInstance = new Fetch(endpoint, token, undefined, onError)\n }\n\n createAccount = async (account: Account) => {\n return this.fetchInstance.post(ApiEndpoints.ACCOUNTS, account).then((data) => data.account)\n }\n\n deleteAccount = async (accountGuid: string) => {\n return this.fetchInstance.delete(`${ApiEndpoints.ACCOUNTS}/${accountGuid}`)\n }\n\n getAccounts = async () => {\n return this.fetchInstance.get(ApiEndpoints.ACCOUNTS).then((data) => data.accounts)\n }\n\n getInstitutions = async () => {\n return this.fetchInstance.get(ApiEndpoints.INSTITUTIONS).then((data) => data)\n }\n\n getMembers = async () => {\n return this.fetchInstance.get(ApiEndpoints.MEMBERS).then((data) => data.members)\n }\n\n getHistoricalAccountBalances = async (guid: string): Promise<HistoricalAccountBalance[]> => {\n return this.fetchInstance\n .get(`${ApiEndpoints.ACCOUNTS}/${guid}/historical_account_balances`)\n .then((data) => data.historical_account_balances)\n }\n\n getMonthlyAccountBalances = async (guid: string): Promise<MonthlyAccountBalance[]> => {\n return this.fetchInstance\n .get(`${ApiEndpoints.ACCOUNTS}/${guid}/monthly_account_balances`)\n .then((data) => data.monthly_account_balances)\n }\n\n mergeAccounts = async (accountGuids: string[]) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.ACCOUNTS}/merge`, { accounts: accountGuids })\n .then((data) => data)\n }\n\n refreshAllMembers = async () => {\n return this.fetchInstance.get(`${ApiEndpoints.MEMBERS}/refresh_all`).then((data) => data)\n }\n\n updateAccount = async (account: Account) => {\n return this.fetchInstance\n .put(`${ApiEndpoints.ACCOUNTS}/${account.guid}`, account)\n .then((data) => data.account)\n }\n}\n"],"mappings":";;AASA,IAAa,IAAb,MAAwB;AAAA,EACtB;AAAA,EAEA,YAAY,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../api';
|
|
2
2
|
import { AssetsLiabilities, DetailedAccount, GainsLosses, MonthlyAccountBalance, NetWorth, NetWorthData } from '../types';
|
|
3
3
|
import { GlobalStore } from './GlobalStore';
|
|
4
|
+
export declare const HISTORICAL_ACCOUNT_BALANCES = "Historical account balances";
|
|
4
5
|
export declare class NetWorthStore {
|
|
5
6
|
globalStore: GlobalStore;
|
|
6
7
|
accountsApi: AccountApi;
|
|
@@ -17,9 +18,11 @@ export declare class NetWorthStore {
|
|
|
17
18
|
get selectedData(): NetWorth | undefined;
|
|
18
19
|
get hoveredData(): NetWorth | undefined;
|
|
19
20
|
get gainsLosses(): GainsLosses;
|
|
21
|
+
get isHistoricalBalancesEnabled(): boolean;
|
|
20
22
|
get assetsLiabilities(): AssetsLiabilities;
|
|
21
23
|
loadNetWorthData: () => Promise<void>;
|
|
22
24
|
getMonthlyAccountBalances: (accountGuid: string) => Promise<MonthlyAccountBalance[]>;
|
|
25
|
+
getHistoricalAccountBalances: (accountGuid: string) => Promise<MonthlyAccountBalance[]>;
|
|
23
26
|
setHoveredIndex: (index: number) => number;
|
|
24
27
|
setMonthlyAccountBalances: (balances: MonthlyAccountBalance[]) => void;
|
|
25
28
|
setSelectedIndex: (index: number) => number;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { AccountApi as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { AccountApi as o } from "../api/AccountApi.es.js";
|
|
2
|
+
import { isFeatureEnabled as c } from "../utils/UserUtils.es.js";
|
|
3
|
+
import { buildAssetsLiabilities as n, buildChartData as i, buildGainsLosses as l, filterAccounts as h, flattenBalances as u, getLatestNetWorthData as s, sortByYearMonthAscending as d, toMonthlyAccountBalance as A } from "../utils/NetWorthUtils.es.js";
|
|
4
|
+
import { makeAutoObservable as g } from "mobx";
|
|
5
|
+
var m = "Historical account balances", W = class {
|
|
5
6
|
globalStore;
|
|
6
|
-
accountsApi = new
|
|
7
|
+
accountsApi = new o("/", "");
|
|
7
8
|
monthlyAccountBalances = [];
|
|
8
9
|
monthlyAccountBalancesLoaded = !1;
|
|
9
10
|
hoveredIndex = -1;
|
|
10
11
|
selectedIndex = -1;
|
|
11
12
|
timeframe = 6;
|
|
12
13
|
constructor(t) {
|
|
13
|
-
this.globalStore = t, this.accountsApi = new
|
|
14
|
+
this.globalStore = t, this.accountsApi = new o(t.endpoint, t.sessionToken, t.onError), g(this);
|
|
14
15
|
}
|
|
15
16
|
get isNetWorthDataLoaded() {
|
|
16
17
|
return this.globalStore.accountStore.isAccountDataLoaded && this.monthlyAccountBalancesLoaded;
|
|
17
18
|
}
|
|
18
19
|
get netWorthAccounts() {
|
|
19
|
-
return
|
|
20
|
+
return h(this.globalStore.globalUiStore.selectedAccounts, this.globalStore.accountStore.members);
|
|
20
21
|
}
|
|
21
22
|
get netWorthData() {
|
|
22
23
|
return {
|
|
@@ -25,32 +26,35 @@ var y = class {
|
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
get netWorthChartData() {
|
|
28
|
-
return
|
|
29
|
+
return i(this.netWorthAccounts, this.monthlyAccountBalances, this.timeframe);
|
|
29
30
|
}
|
|
30
31
|
get selectedData() {
|
|
31
32
|
if (!(!this.netWorthChartData || this.netWorthChartData.length === 0))
|
|
32
|
-
return this.selectedIndex === -1 ?
|
|
33
|
+
return this.selectedIndex === -1 ? s(this.netWorthChartData) : this.netWorthChartData[this.selectedIndex];
|
|
33
34
|
}
|
|
34
35
|
get hoveredData() {
|
|
35
36
|
return this.hoveredIndex >= 0 ? this.netWorthChartData[this.hoveredIndex] : void 0;
|
|
36
37
|
}
|
|
37
38
|
get gainsLosses() {
|
|
38
|
-
return
|
|
39
|
+
return l(this.selectedData);
|
|
40
|
+
}
|
|
41
|
+
get isHistoricalBalancesEnabled() {
|
|
42
|
+
return c(this.globalStore.userStore.userFeatures, m);
|
|
39
43
|
}
|
|
40
44
|
get assetsLiabilities() {
|
|
41
|
-
const { assets: t, liabilities: e, totalAssets:
|
|
45
|
+
const { assets: t, liabilities: e, totalAssets: a, totalLiabilities: r } = n(this.netWorthData.accounts);
|
|
42
46
|
return {
|
|
43
|
-
netWorth:
|
|
47
|
+
netWorth: s(this.netWorthChartData),
|
|
44
48
|
assets: t,
|
|
45
49
|
liabilities: e,
|
|
46
|
-
totalAssets:
|
|
47
|
-
totalLiabilities:
|
|
50
|
+
totalAssets: a,
|
|
51
|
+
totalLiabilities: r
|
|
48
52
|
};
|
|
49
53
|
}
|
|
50
54
|
loadNetWorthData = async () => {
|
|
51
|
-
this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData();
|
|
52
|
-
const t = (await Promise.all(this.netWorthAccounts.map((
|
|
53
|
-
this.setMonthlyAccountBalances(
|
|
55
|
+
this.globalStore.accountStore.isAccountDataLoaded || await this.globalStore.accountStore.loadAccountData(), this.globalStore.userStore.userFeaturesLoaded || await this.globalStore.userStore.loadUserFeatures();
|
|
56
|
+
const t = this.isHistoricalBalancesEnabled ? (a) => this.getHistoricalAccountBalances(a) : (a) => this.getMonthlyAccountBalances(a), e = (await Promise.all(this.netWorthAccounts.map((a) => t(a.guid)))).reduce(u, []).sort(d);
|
|
57
|
+
this.setMonthlyAccountBalances(e);
|
|
54
58
|
};
|
|
55
59
|
getMonthlyAccountBalances = async (t) => {
|
|
56
60
|
try {
|
|
@@ -59,6 +63,13 @@ var y = class {
|
|
|
59
63
|
return console.error("Error occurred while fetching monthly account balances:", e), this.globalStore.captureException(e, { store: "NetWorthStore" }), [];
|
|
60
64
|
}
|
|
61
65
|
};
|
|
66
|
+
getHistoricalAccountBalances = async (t) => {
|
|
67
|
+
try {
|
|
68
|
+
return (await this.accountsApi.getHistoricalAccountBalances(t)).map(A);
|
|
69
|
+
} catch (e) {
|
|
70
|
+
return console.error("Error occurred while fetching historical account balances:", e), this.globalStore.captureException(e, { store: "NetWorthStore" }), [];
|
|
71
|
+
}
|
|
72
|
+
};
|
|
62
73
|
setHoveredIndex = (t) => this.hoveredIndex = t;
|
|
63
74
|
setMonthlyAccountBalances = (t) => {
|
|
64
75
|
this.monthlyAccountBalances = t, this.monthlyAccountBalancesLoaded = !0;
|
|
@@ -67,7 +78,8 @@ var y = class {
|
|
|
67
78
|
setTimeframe = (t) => this.timeframe = t;
|
|
68
79
|
};
|
|
69
80
|
export {
|
|
70
|
-
|
|
81
|
+
m as HISTORICAL_ACCOUNT_BALANCES,
|
|
82
|
+
W as NetWorthStore
|
|
71
83
|
};
|
|
72
84
|
|
|
73
85
|
//# sourceMappingURL=NetWorthStore.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetWorthStore.es.js","names":[],"sources":["../../../src/core/stores/NetWorthStore.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\n\nimport { AccountApi } from '../api'\nimport type {\n Account,\n AssetsLiabilities,\n DetailedAccount,\n GainsLosses,\n MonthlyAccountBalance,\n NetWorth,\n NetWorthData,\n} from '../types'\nimport {\n filterAccounts,\n flattenBalances,\n buildAssetsLiabilities,\n buildChartData,\n buildGainsLosses,\n getLatestNetWorthData,\n sortByYearMonthAscending,\n} from '../utils/NetWorthUtils'\n\nimport { GlobalStore } from './GlobalStore'\n\nexport class NetWorthStore {\n globalStore: GlobalStore\n accountsApi: AccountApi = new AccountApi('/', '')\n\n monthlyAccountBalances: MonthlyAccountBalance[] = []\n monthlyAccountBalancesLoaded: boolean = false\n hoveredIndex: number = -1\n selectedIndex: number = -1\n timeframe: number = 6 // default timeframe is 6 months\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.accountsApi = new AccountApi(\n globalStore.endpoint,\n globalStore.sessionToken,\n globalStore.onError,\n )\n makeAutoObservable(this)\n }\n\n get isNetWorthDataLoaded(): boolean {\n return this.globalStore.accountStore.isAccountDataLoaded && this.monthlyAccountBalancesLoaded\n }\n\n get netWorthAccounts(): DetailedAccount[] {\n return filterAccounts(\n this.globalStore.globalUiStore.selectedAccounts,\n this.globalStore.accountStore.members,\n )\n }\n\n get netWorthData(): NetWorthData {\n return {\n accounts: this.netWorthAccounts,\n monthlyAccountBalances: this.monthlyAccountBalances,\n }\n }\n\n get netWorthChartData(): NetWorth[] {\n return buildChartData(this.netWorthAccounts, this.monthlyAccountBalances, this.timeframe)\n }\n\n get selectedData(): NetWorth | undefined {\n if (!this.netWorthChartData || this.netWorthChartData.length === 0) return undefined\n return this.selectedIndex === -1\n ? getLatestNetWorthData(this.netWorthChartData)\n : this.netWorthChartData[this.selectedIndex]\n }\n\n get hoveredData(): NetWorth | undefined {\n return this.hoveredIndex >= 0 ? this.netWorthChartData[this.hoveredIndex] : undefined\n }\n\n get gainsLosses(): GainsLosses {\n return buildGainsLosses(this.selectedData)\n }\n\n get assetsLiabilities(): AssetsLiabilities {\n const { assets, liabilities, totalAssets, totalLiabilities } = buildAssetsLiabilities(\n this.netWorthData.accounts,\n )\n return {\n netWorth: getLatestNetWorthData(this.netWorthChartData),\n assets,\n liabilities,\n totalAssets,\n totalLiabilities,\n }\n }\n\n loadNetWorthData = async () => {\n if (!this.globalStore.accountStore.isAccountDataLoaded) {\n await this.globalStore.accountStore.loadAccountData()\n }\n\n const accountBalances = await Promise.all(\n this.netWorthAccounts.map((account: Account) =>
|
|
1
|
+
{"version":3,"file":"NetWorthStore.es.js","names":[],"sources":["../../../src/core/stores/NetWorthStore.ts"],"sourcesContent":["import { makeAutoObservable } from 'mobx'\n\nimport { AccountApi } from '../api'\nimport type {\n Account,\n AssetsLiabilities,\n DetailedAccount,\n GainsLosses,\n HistoricalAccountBalance,\n MonthlyAccountBalance,\n NetWorth,\n NetWorthData,\n} from '../types'\nimport {\n filterAccounts,\n flattenBalances,\n buildAssetsLiabilities,\n buildChartData,\n buildGainsLosses,\n getLatestNetWorthData,\n sortByYearMonthAscending,\n toMonthlyAccountBalance,\n} from '../utils/NetWorthUtils'\nimport { isFeatureEnabled } from '../utils/UserUtils'\n\nimport { GlobalStore } from './GlobalStore'\n\n// Looks wrong next to the MD_* flags, but isn't: this is the seeded feature_name. Do not rename.\nexport const HISTORICAL_ACCOUNT_BALANCES = 'Historical account balances'\n\nexport class NetWorthStore {\n globalStore: GlobalStore\n accountsApi: AccountApi = new AccountApi('/', '')\n\n monthlyAccountBalances: MonthlyAccountBalance[] = []\n monthlyAccountBalancesLoaded: boolean = false\n hoveredIndex: number = -1\n selectedIndex: number = -1\n timeframe: number = 6 // default timeframe is 6 months\n\n constructor(globalStore: GlobalStore) {\n this.globalStore = globalStore\n this.accountsApi = new AccountApi(\n globalStore.endpoint,\n globalStore.sessionToken,\n globalStore.onError,\n )\n makeAutoObservable(this)\n }\n\n get isNetWorthDataLoaded(): boolean {\n return this.globalStore.accountStore.isAccountDataLoaded && this.monthlyAccountBalancesLoaded\n }\n\n get netWorthAccounts(): DetailedAccount[] {\n return filterAccounts(\n this.globalStore.globalUiStore.selectedAccounts,\n this.globalStore.accountStore.members,\n )\n }\n\n get netWorthData(): NetWorthData {\n return {\n accounts: this.netWorthAccounts,\n monthlyAccountBalances: this.monthlyAccountBalances,\n }\n }\n\n get netWorthChartData(): NetWorth[] {\n return buildChartData(this.netWorthAccounts, this.monthlyAccountBalances, this.timeframe)\n }\n\n get selectedData(): NetWorth | undefined {\n if (!this.netWorthChartData || this.netWorthChartData.length === 0) return undefined\n return this.selectedIndex === -1\n ? getLatestNetWorthData(this.netWorthChartData)\n : this.netWorthChartData[this.selectedIndex]\n }\n\n get hoveredData(): NetWorth | undefined {\n return this.hoveredIndex >= 0 ? this.netWorthChartData[this.hoveredIndex] : undefined\n }\n\n get gainsLosses(): GainsLosses {\n return buildGainsLosses(this.selectedData)\n }\n\n get isHistoricalBalancesEnabled(): boolean {\n return isFeatureEnabled(this.globalStore.userStore.userFeatures, HISTORICAL_ACCOUNT_BALANCES)\n }\n\n get assetsLiabilities(): AssetsLiabilities {\n const { assets, liabilities, totalAssets, totalLiabilities } = buildAssetsLiabilities(\n this.netWorthData.accounts,\n )\n return {\n netWorth: getLatestNetWorthData(this.netWorthChartData),\n assets,\n liabilities,\n totalAssets,\n totalLiabilities,\n }\n }\n\n loadNetWorthData = async () => {\n if (!this.globalStore.accountStore.isAccountDataLoaded) {\n await this.globalStore.accountStore.loadAccountData()\n }\n\n if (!this.globalStore.userStore.userFeaturesLoaded) {\n await this.globalStore.userStore.loadUserFeatures()\n }\n\n const fetchBalances = this.isHistoricalBalancesEnabled\n ? (guid: string) => this.getHistoricalAccountBalances(guid)\n : (guid: string) => this.getMonthlyAccountBalances(guid)\n\n const accountBalances = await Promise.all(\n this.netWorthAccounts.map((account: Account) => fetchBalances(account.guid)),\n )\n\n const monthlyAccountBalances = accountBalances\n .reduce(flattenBalances, [])\n .sort(sortByYearMonthAscending)\n\n this.setMonthlyAccountBalances(monthlyAccountBalances)\n }\n\n getMonthlyAccountBalances = async (accountGuid: string) => {\n try {\n const balances = await this.accountsApi.getMonthlyAccountBalances(accountGuid)\n return balances as MonthlyAccountBalance[]\n } catch (error) {\n console.error('Error occurred while fetching monthly account balances:', error)\n this.globalStore.captureException(error, { store: 'NetWorthStore' })\n return []\n }\n }\n\n getHistoricalAccountBalances = async (accountGuid: string): Promise<MonthlyAccountBalance[]> => {\n try {\n const balances: HistoricalAccountBalance[] =\n await this.accountsApi.getHistoricalAccountBalances(accountGuid)\n return balances.map(toMonthlyAccountBalance)\n } catch (error) {\n console.error('Error occurred while fetching historical account balances:', error)\n this.globalStore.captureException(error, { store: 'NetWorthStore' })\n return []\n }\n }\n\n setHoveredIndex = (index: number) => (this.hoveredIndex = index)\n\n setMonthlyAccountBalances = (balances: MonthlyAccountBalance[]) => {\n this.monthlyAccountBalances = balances\n this.monthlyAccountBalancesLoaded = true\n }\n\n setSelectedIndex = (index: number) => (this.selectedIndex = index)\n setTimeframe = (months: number) => (this.timeframe = months)\n}\n"],"mappings":";;;;AA4BA,IAAa,IAA8B,+BAE9B,IAAb,MAA2B;AAAA,EACzB;AAAA,EACA,cAA0B,IAAI,EAAW,KAAK,EAAE;AAAA,EAEhD,y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A,CAAoB,MAAmB,KAAK,gBAAgB;AAAA,EAC5D,eAAA,CAAgB,MAAoB,KAAK,YAAY;AACvD"}
|
|
@@ -115,6 +115,16 @@ export interface MonthlyAccountBalance {
|
|
|
115
115
|
year: number;
|
|
116
116
|
year_month: number;
|
|
117
117
|
}
|
|
118
|
+
export interface HistoricalAccountBalance {
|
|
119
|
+
account_guid: string;
|
|
120
|
+
balance: number;
|
|
121
|
+
guid: string;
|
|
122
|
+
month: number;
|
|
123
|
+
transaction_total: number | null;
|
|
124
|
+
user_guid: string;
|
|
125
|
+
year: number;
|
|
126
|
+
year_month: number;
|
|
127
|
+
}
|
|
118
128
|
export declare enum AccountType {
|
|
119
129
|
ANY = 0,
|
|
120
130
|
CHECKING = 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.es.js","names":[],"sources":["../../../src/core/types/Account.ts"],"sourcesContent":["import { type Institution } from './Institution'\n\nexport interface Account {\n account_number?: string\n account_subtype?: AccountSubType\n account_type: AccountType\n apr?: number\n apy?: number\n available_balance?: number\n balance?: number\n balance_updated_at?: number\n cash_balance?: number\n credit_limit?: number\n current_balance?: number\n currency_code?: string\n day_payment_is_due?: number\n display_order?: number\n external_guid?: string\n feed_account_type?: number\n feed_apr?: number\n feed_apy?: number\n feed_credit_limit?: number\n feed_day_payment_is_due?: number\n feed_interest_rate?: number\n feed_is_closed?: boolean\n feed_localized_name?: string\n feed_name?: string\n feed_nickname?: string\n feed_original_balance?: number\n flags?: number\n guid: string\n institution_guid?: string\n interest_rate?: number\n interest_rate_set_by?: number\n interestRate?: number\n is_closed: boolean\n is_deleted: boolean\n is_excluded_from_accounts: boolean\n is_excluded_from_budgets: boolean\n is_excluded_from_cash_flow: boolean\n is_excluded_from_debts: boolean\n is_excluded_from_goals: boolean\n is_excluded_from_investments: boolean\n is_excluded_from_net_worth: boolean\n is_excluded_from_spending: boolean\n is_excluded_from_transactions: boolean\n is_excluded_from_trends: boolean\n is_hidden: boolean\n is_manual: boolean\n is_personal: boolean\n localized_name?: string\n member_guid?: string\n member_is_managed_by_user: boolean\n metadata?: string\n minimum_payment?: number\n name?: string\n nickname?: string\n original_balance?: number\n payment_due_at?: number\n pending_balance?: number\n property_type?: PropertyType\n revision?: number\n updated_at?: number\n user_guid?: string\n user_name?: string\n\n // TODO: STORE_REFACTOR Remove fields after switch to Detailed Accounts\n memberName?: string\n connectionStatus?: ConnectionStatus\n displayName?: string\n trucatedDisplayName?: string\n institutionName?: string\n}\n\nexport interface DetailedAccount extends Account {\n connectionStatus?: ConnectionStatus\n displayName?: string\n institutionName?: string // TODO: STORE_REFACTOR - Remove after all move to displayName\n member?: Member\n monthlyBalances?: MonthlyAccountBalance[]\n institution?: Institution\n}\n\nexport interface Member {\n aggregation_status: number\n connection_status: ConnectionStatusEnums\n guid: string\n institution_guid: string\n institution_name?: string\n institution_url?: string\n is_being_aggregated: boolean\n is_manual: boolean\n is_managed_by_user: boolean\n is_oauth: boolean\n last_job_guid?: string\n last_job_status?: string\n last_update_time?: number\n metadata?: string\n mfa: any\n most_recent_job_guid?: string\n needs_updated_credentials: boolean\n name: string\n process_status?: number\n revision: number\n user_guid: string\n oauth_window_uri?: string\n verification_is_enabled: boolean\n tax_statement_is_enabled: boolean\n successfully_aggregated_at?: number\n}\n\nexport interface MonthlyAccountBalance {\n account_guid: string\n balance: number\n credit_transaction_total: number\n debit_transaction_total: number\n id: string\n month: number\n transaction_total: number\n user_guid: string\n year: number\n year_month: number\n}\n\nexport enum AccountType {\n ANY = 0,\n CHECKING = 1,\n SAVINGS = 2,\n LOAN = 3,\n CREDIT_CARD = 4,\n INVESTMENT = 5,\n LINE_OF_CREDIT = 6,\n MORTGAGE = 7,\n PROPERTY = 8,\n CASH = 9,\n INSURANCE = 10,\n PREPAID = 11,\n CHECKING_LINE_OF_CREDIT = 12,\n DIGITAL_WALLET = 13,\n}\n\nexport enum AccountSubType {\n NONE = 0,\n MONEY_MARKET = 1,\n CERTIFICATE_OF_DEPOSIT = 2,\n AUTO = 3,\n STUDENT = 4,\n SMALL_BUSINESS = 5,\n PERSONAL = 6,\n PERSONAL_WITH_COLLATERAL = 7,\n HOME_EQUITY = 8,\n PLAN_401_K = 9,\n PLAN_403_B = 10,\n PLAN_529 = 11,\n IRA = 12,\n ROLLOVER_IRA = 13,\n ROTH_IRA = 14,\n TAXABLE = 15,\n NON_TAXABLE = 16,\n BROKERAGE = 17,\n TRUST = 18,\n UNIFORM_GIFTS_TO_MINORS_ACT = 19,\n PLAN_457 = 20,\n PENSION = 21,\n EMPLOYEE_STOCK_OWNERSHIP_PLAN = 22,\n SIMPLIFIED_EMPLOYEE_PENSION = 23,\n SIMPLE_IRA = 24,\n BOAT = 25,\n POWERSPORTS = 26,\n RV = 27,\n HELOC = 28,\n PLAN_ROTH_401_K = 29,\n FIXED_ANNUITY = 30,\n VARIABLE_ANNUITY = 31,\n VEHICLE_INSURANCE = 32,\n DISABILITY = 33,\n HEALTH = 34,\n LONG_TERM_CARE = 35,\n PROPERTY_AND_CASUALTY = 36,\n UNIVERSAL_LIFE = 37,\n TERM_LIFE = 38,\n WHOLE_LIFE = 39,\n ACCIDENTAL_DEATH_AND_DISMEMBERMENT = 40,\n VARIABLE_UNIVERSAL_LIFE = 41,\n HSA = 42,\n TAX_FREE_SAVINGS_ACCOUNT = 43,\n INDIVIDUAL = 44,\n REGISTERED_RETIREMENT_INCOME_FUND = 45,\n CASH_MANAGEMENT_ACCOUNT = 46,\n EMPLOYEE_STOCK_PURCHASE_PLAN = 47,\n REGISTERED_EDUCATION_SAVINGS_PLAN = 48,\n PROFIT_SHARING_PLAN = 49,\n UNIFORM_TRANSFER_TO_MINORS_ACT = 50,\n PLAN_401_A = 51,\n SARSEP_IRA = 52,\n FIXED_ANNUITY_TRADITIONAL_IRA = 53,\n VARIABLE_ANNUITY_TRADITIONAL_IRA = 54,\n SEPP_IRA = 55,\n INHERITED_TRADITIONAL_IRA = 56,\n FIXED_ANNUITY_ROTH_IRA = 57,\n VARIABLE_ANNUITY_ROTH_IRA = 58,\n INHERITED_ROTH_IRA = 59,\n COVERDELL = 60,\n ADVISORY_ACCOUNT = 61,\n BROKERAGE_MARGIN = 62,\n CHARITABLE_GIFT_ACCOUNT = 63,\n CHURCH_ACCOUNT = 64,\n CONSERVATORSHIP = 65,\n CUSTODIAL = 66,\n DEFINED_BENEFIT_PLAN = 67,\n DEFINED_CONTRIBUTION_PLAN = 68,\n EDUCATIONAL = 69,\n ESTATE = 70,\n EXECUTOR = 71,\n GROUP_RETIREMENT_SAVINGS_PLAN = 72,\n GUARANTEED_INVESTMENT_CERTIFICATE = 73,\n HRA = 74,\n INDEXED_ANNUITY = 75,\n INVESTMENT_CLUB = 76,\n IRREVOCABLE_TRUST = 77,\n JOINT_TENANTS_BY_ENTIRITY = 78,\n JOINT_TENANTS_COMMUNITY_PROPERTY = 79,\n JOINT_TENANTS_IN_COMMON = 80,\n JOINT_TENANTS_WITH_RIGHTS_OF_SURVIVORSHIP = 81,\n KEOUGH_PLAN = 82,\n LIFE_INCOME_FUND = 83,\n LIVING_TRUST = 84,\n LOCKED_IN_RETIREMENT_ACCOUNT = 85,\n LOCKED_IN_RETIREMENT_INVESTMENT_FUND = 86,\n LOCKED_IN_RETIREMENT_SAVINGS_ACCOUNT = 87,\n MONEY_PURCHASE_PLAN = 88,\n PARTNERSHIP = 89,\n PLAN_409_A = 90,\n PLAN_ROTH_403_B = 91,\n REGISTERED_DISABILITY_SAVINGS_PLAN = 92,\n REGISTERED_LOCKED_IN_SAVINGS_PLAN = 93,\n REGISTERED_PENSION_PLAN = 94,\n REGISTERED_RETIREMENT_SAVINGS_PLAN = 95,\n REVOCABLE_TRUST = 96,\n ROTH_CONVERSION = 97,\n SOLE_PROPRIETORSHIP = 98,\n SPOUSAL_IRA = 99,\n SPOUSAL_ROTH_IRA = 100,\n TESTAMENTARY_TRUST = 101,\n THRIFT_SAVINGS_PLAN = 102,\n INHERITED_ANNUITY = 103,\n CORPORATE_ACCOUNT = 104,\n LIMITED_LIABILITY_ACCOUNT = 105,\n HSA_SAVINGS = 106,\n HSA_CHECKING = 107,\n}\n\nexport enum PropertyType {\n REAL_ESTATE = 0,\n VEHICLE = 1,\n ART = 2,\n JEWELRY = 3,\n FURNITURE = 4,\n APPLIANCES = 5,\n COMPUTER = 6,\n ELECTRONICS = 7,\n SPORTS_EQUIPMENT = 8,\n MISCELLANEOUS = 9,\n}\n\nexport enum ConnectionStatusEnums {\n CREATED = 0, // The member is new and has not aggregated yet\n PREVENTED = 1, // MX preventing aggregation until credentials are updated\n DENIED = 2, // Invalid credentials\n CHALLENGED = 3, // MFA presented\n REJECTED = 4, // MFA answered incorrectly\n LOCKED = 5, // Institution is preventing authentication, user must contact FI\n CONNECTED = 6, // Successfully authenticated and aggregating data\n IMPEDED = 7, // User attention is needed in online banking (marketing message, terms and conditions etc.)\n RECONNECTED = 8, // The connection has been migrated, we will not aggregate until user interacts with UI\n DEGRADED = 9, // Aggregation has failed for a short period with a minimum number of attempts\n DISCONNECTED = 10, // Aggregation has failed for an extended period of time with a minimum number of attempts\n DISCONTINUED = 11, // The connection to this institution is no longer available\n CLOSED = 12, // The user, MX, the client or partner have marked the account as closed\n DELAYED = 13, // Aggregation has taken longer than expected without being CONNECTED\n FAILED = 14, // Aggregation failed without being CONNECTED\n UPDATED = 15, // Credenitals have been updated, but the member has not yet been CONNECTED\n DISABLED = 16, // Aggregation has been momentarily paused, but the member is still CONNECTED\n IMPORTED = 17, // Member was imported from another provider using the MDX Migration API\n RESUMED = 18, // MFA has been answered and has not yet been CONNECTED\n EXPIRED = 19, // MFA has not been answered before job timed out\n IMPAIRED = 20, // Memeber is missing some or all credentials needed to connect\n PENDING = 21, // OAuth member created but waiting for authentication redirect // Not visible to user\n}\n\nexport const ProcessingStatuses = [\n ConnectionStatusEnums.CREATED,\n ConnectionStatusEnums.UPDATED,\n ConnectionStatusEnums.RESUMED,\n]\n\nexport const MfaStatuses = [ConnectionStatusEnums.CHALLENGED, ConnectionStatusEnums.REJECTED]\n\nexport const ErrorStatuses = [\n ConnectionStatusEnums.PREVENTED,\n ConnectionStatusEnums.DENIED,\n ConnectionStatusEnums.LOCKED,\n ConnectionStatusEnums.IMPEDED,\n ConnectionStatusEnums.DEGRADED,\n ConnectionStatusEnums.DISCONNECTED,\n ConnectionStatusEnums.DISCONTINUED,\n ConnectionStatusEnums.CLOSED,\n ConnectionStatusEnums.DELAYED,\n ConnectionStatusEnums.FAILED,\n ConnectionStatusEnums.DISABLED,\n ConnectionStatusEnums.IMPORTED,\n ConnectionStatusEnums.EXPIRED,\n ConnectionStatusEnums.IMPAIRED,\n]\n\nexport const NonConnectedStatuses = [...ErrorStatuses, ...MfaStatuses]\n\nexport enum ConnectionStatus {\n Connected = 'Connected',\n Error = 'Error',\n Processing = 'Processing',\n RequiresMfa = 'RequiresMfa',\n}\n\nexport const StatusName: any = {\n [ConnectionStatusEnums.CHALLENGED]: 'Challenged',\n [ConnectionStatusEnums.CLOSED]: 'Closed',\n [ConnectionStatusEnums.DEGRADED]: 'Degraded',\n [ConnectionStatusEnums.DELAYED]: 'Delayed',\n [ConnectionStatusEnums.DENIED]: 'Denied',\n [ConnectionStatusEnums.DISABLED]: 'Disabled',\n [ConnectionStatusEnums.DISCONNECTED]: 'Disconnected',\n [ConnectionStatusEnums.DISCONTINUED]: 'Discontinued',\n [ConnectionStatusEnums.EXPIRED]: 'Expired',\n [ConnectionStatusEnums.FAILED]: 'Failed',\n [ConnectionStatusEnums.IMPAIRED]: 'Impaired',\n [ConnectionStatusEnums.IMPEDED]: 'Impeded',\n [ConnectionStatusEnums.IMPORTED]: 'Imported',\n [ConnectionStatusEnums.LOCKED]: 'Locked',\n [ConnectionStatusEnums.PREVENTED]: 'Prevented',\n [ConnectionStatusEnums.REJECTED]: 'Rejected',\n}\n\nexport const AccountTypeName: any = {\n [AccountType.ANY]: 'Any',\n [AccountType.CASH]: 'Cash',\n [AccountType.CHECKING]: 'Checking',\n [AccountType.CHECKING_LINE_OF_CREDIT]: 'Checking Line of Credit',\n [AccountType.CREDIT_CARD]: 'Credit Card',\n [AccountType.DIGITAL_WALLET]: 'Digital Wallet',\n [AccountType.INSURANCE]: 'Insurance',\n [AccountType.INVESTMENT]: 'Investment',\n [AccountType.LINE_OF_CREDIT]: 'Line of Credit',\n [AccountType.LOAN]: 'Loan',\n [AccountType.MORTGAGE]: 'Mortgage',\n [AccountType.PREPAID]: 'Prepaid',\n [AccountType.PROPERTY]: 'Property',\n [AccountType.SAVINGS]: 'Savings',\n}\n\nexport const AccountIcon: any = {\n [AccountType.ANY]: 'account_balance',\n [AccountType.CASH]: 'monetization_on',\n [AccountType.CHECKING]: 'checkbook',\n [AccountType.CHECKING_LINE_OF_CREDIT]: 'checkbook', // Checking line of credit has the same icon as checking\n [AccountType.CREDIT_CARD]: 'credit_card',\n [AccountType.DIGITAL_WALLET]: 'wallet',\n [AccountType.INSURANCE]: 'monitor_heart',\n [AccountType.INVESTMENT]: 'trending_up',\n [AccountType.LINE_OF_CREDIT]: 'add_credit',\n [AccountType.LOAN]: 'loans',\n [AccountType.MORTGAGE]: 'house',\n [AccountType.PREPAID]: 'credit_card',\n [AccountType.PROPERTY]: 'key',\n [AccountType.SAVINGS]: 'savings',\n}\n\nexport const AccountIconVariants: any = {\n [AccountType.INVESTMENT]: 'bid_landscape',\n}\n\nexport const PropertyTypeName: any = {\n [PropertyType.REAL_ESTATE]: 'Real Estate',\n [PropertyType.VEHICLE]: 'Vehicle',\n [PropertyType.ART]: 'Art',\n [PropertyType.JEWELRY]: 'Jewelry',\n [PropertyType.FURNITURE]: 'Furniture',\n [PropertyType.APPLIANCES]: 'Appliances',\n [PropertyType.COMPUTER]: 'Computer',\n [PropertyType.ELECTRONICS]: 'Electronics',\n [PropertyType.SPORTS_EQUIPMENT]: 'Sports Equipment',\n [PropertyType.MISCELLANEOUS]: 'Miscellaneous',\n}\n\nexport const PropertyIcon: any = {\n [PropertyType.REAL_ESTATE]: 'home_work',\n [PropertyType.VEHICLE]: 'directions_car',\n [PropertyType.ART]: 'insert_photo',\n [PropertyType.JEWELRY]: 'diamond',\n [PropertyType.FURNITURE]: 'chair',\n [PropertyType.APPLIANCES]: 'kitchen',\n [PropertyType.COMPUTER]: 'computer',\n [PropertyType.ELECTRONICS]: 'camera_alt',\n [PropertyType.SPORTS_EQUIPMENT]: 'sports_baseball',\n [PropertyType.MISCELLANEOUS]: 'monetization_on',\n}\n"],"mappings":"AA4HA,IAAY,IAAL,0BAAA,GAAA;AACL,SAAA,EAAA,EAAA,MAAA,CAAA,IAAA,OACA,EAAA,EAAA,WAAA,CAAA,IAAA,YACA,EAAA,EAAA,UAAA,CAAA,IAAA,WACA,EAAA,EAAA,OAAA,CAAA,IAAA,QACA,EAAA,EAAA,cAAA,CAAA,IAAA,eACA,EAAA,EAAA,aAAA,CAAA,IAAA,cACA,EAAA,EAAA,iBAAA,CAAA,IAAA,kBACA,EAAA,EAAA,WAAA,CAAA,IAAA,YACA,EAAA,EAAA,WAAA,CAAA,IAAA,YACA,EAAA,EAAA,OAAA,CAAA,IAAA,QACA,EAAA,EAAA,YAAA,EAAA,IAAA,aACA,EAAA,EAAA,UAAA,EAAA,IAAA,WACA,EAAA,EAAA,0BAAA,EAAA,IAAA,2BACA,EAAA,EAAA,iBAAA,EAAA,IAAA;AACF,GAAA,CAAA,CAAA,GAEY,IAAL,0BAAA,GAAA;AACL,SAAA,EAAA,EAAA,OAAA,CAAA,IAAA,QACA,EAAA,EAAA,eAAA,CAAA,IAAA,gBACA,EAAA,EAAA,yBAAA,CAAA,IAAA,0BACA,EAAA,EAAA,OAAA,CAAA,IAAA,QACA,EAAA,EAAA,UAAA,CAAA,IAAA,WACA,EAAA,EAAA,iBAAA,CAAA,IAAA,kBACA,EAAA,EAAA,WAAA,CAAA,IAAA,YACA,EAAA,EAAA,2BAAA,CAAA,IAAA,4BACA,EAAA,EAAA,cAAA,CAAA,IAAA,eACA,EAAA,EAAA,aAAA,CAAA,IAAA,cACA,EAAA,EAAA,aAAA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AAAA,EACI,GAAA;AAAA,EACE,GAAA;AAAA,EACC,GAAA;AAAA,EACF,GAAA;AAAA,EACG,GAAA;AAAA,EACK,GAAA;AAAA,EACH,GAAA;AAChC"}
|
|
1
|
+
{"version":3,"file":"Account.es.js","names":[],"sources":["../../../src/core/types/Account.ts"],"sourcesContent":["import { type Institution } from './Institution'\n\nexport interface Account {\n account_number?: string\n account_subtype?: AccountSubType\n account_type: AccountType\n apr?: number\n apy?: number\n available_balance?: number\n balance?: number\n balance_updated_at?: number\n cash_balance?: number\n credit_limit?: number\n current_balance?: number\n currency_code?: string\n day_payment_is_due?: number\n display_order?: number\n external_guid?: string\n feed_account_type?: number\n feed_apr?: number\n feed_apy?: number\n feed_credit_limit?: number\n feed_day_payment_is_due?: number\n feed_interest_rate?: number\n feed_is_closed?: boolean\n feed_localized_name?: string\n feed_name?: string\n feed_nickname?: string\n feed_original_balance?: number\n flags?: number\n guid: string\n institution_guid?: string\n interest_rate?: number\n interest_rate_set_by?: number\n interestRate?: number\n is_closed: boolean\n is_deleted: boolean\n is_excluded_from_accounts: boolean\n is_excluded_from_budgets: boolean\n is_excluded_from_cash_flow: boolean\n is_excluded_from_debts: boolean\n is_excluded_from_goals: boolean\n is_excluded_from_investments: boolean\n is_excluded_from_net_worth: boolean\n is_excluded_from_spending: boolean\n is_excluded_from_transactions: boolean\n is_excluded_from_trends: boolean\n is_hidden: boolean\n is_manual: boolean\n is_personal: boolean\n localized_name?: string\n member_guid?: string\n member_is_managed_by_user: boolean\n metadata?: string\n minimum_payment?: number\n name?: string\n nickname?: string\n original_balance?: number\n payment_due_at?: number\n pending_balance?: number\n property_type?: PropertyType\n revision?: number\n updated_at?: number\n user_guid?: string\n user_name?: string\n\n // TODO: STORE_REFACTOR Remove fields after switch to Detailed Accounts\n memberName?: string\n connectionStatus?: ConnectionStatus\n displayName?: string\n trucatedDisplayName?: string\n institutionName?: string\n}\n\nexport interface DetailedAccount extends Account {\n connectionStatus?: ConnectionStatus\n displayName?: string\n institutionName?: string // TODO: STORE_REFACTOR - Remove after all move to displayName\n member?: Member\n monthlyBalances?: MonthlyAccountBalance[]\n institution?: Institution\n}\n\nexport interface Member {\n aggregation_status: number\n connection_status: ConnectionStatusEnums\n guid: string\n institution_guid: string\n institution_name?: string\n institution_url?: string\n is_being_aggregated: boolean\n is_manual: boolean\n is_managed_by_user: boolean\n is_oauth: boolean\n last_job_guid?: string\n last_job_status?: string\n last_update_time?: number\n metadata?: string\n mfa: any\n most_recent_job_guid?: string\n needs_updated_credentials: boolean\n name: string\n process_status?: number\n revision: number\n user_guid: string\n oauth_window_uri?: string\n verification_is_enabled: boolean\n tax_statement_is_enabled: boolean\n successfully_aggregated_at?: number\n}\n\nexport interface MonthlyAccountBalance {\n account_guid: string\n balance: number\n credit_transaction_total: number\n debit_transaction_total: number\n id: string\n month: number\n transaction_total: number\n user_guid: string\n year: number\n year_month: number\n}\n\nexport interface HistoricalAccountBalance {\n account_guid: string\n balance: number\n guid: string\n month: number\n transaction_total: number | null\n user_guid: string\n year: number\n year_month: number\n}\n\nexport enum AccountType {\n ANY = 0,\n CHECKING = 1,\n SAVINGS = 2,\n LOAN = 3,\n CREDIT_CARD = 4,\n INVESTMENT = 5,\n LINE_OF_CREDIT = 6,\n MORTGAGE = 7,\n PROPERTY = 8,\n CASH = 9,\n INSURANCE = 10,\n PREPAID = 11,\n CHECKING_LINE_OF_CREDIT = 12,\n DIGITAL_WALLET = 13,\n}\n\nexport enum AccountSubType {\n NONE = 0,\n MONEY_MARKET = 1,\n CERTIFICATE_OF_DEPOSIT = 2,\n AUTO = 3,\n STUDENT = 4,\n SMALL_BUSINESS = 5,\n PERSONAL = 6,\n PERSONAL_WITH_COLLATERAL = 7,\n HOME_EQUITY = 8,\n PLAN_401_K = 9,\n PLAN_403_B = 10,\n PLAN_529 = 11,\n IRA = 12,\n ROLLOVER_IRA = 13,\n ROTH_IRA = 14,\n TAXABLE = 15,\n NON_TAXABLE = 16,\n BROKERAGE = 17,\n TRUST = 18,\n UNIFORM_GIFTS_TO_MINORS_ACT = 19,\n PLAN_457 = 20,\n PENSION = 21,\n EMPLOYEE_STOCK_OWNERSHIP_PLAN = 22,\n SIMPLIFIED_EMPLOYEE_PENSION = 23,\n SIMPLE_IRA = 24,\n BOAT = 25,\n POWERSPORTS = 26,\n RV = 27,\n HELOC = 28,\n PLAN_ROTH_401_K = 29,\n FIXED_ANNUITY = 30,\n VARIABLE_ANNUITY = 31,\n VEHICLE_INSURANCE = 32,\n DISABILITY = 33,\n HEALTH = 34,\n LONG_TERM_CARE = 35,\n PROPERTY_AND_CASUALTY = 36,\n UNIVERSAL_LIFE = 37,\n TERM_LIFE = 38,\n WHOLE_LIFE = 39,\n ACCIDENTAL_DEATH_AND_DISMEMBERMENT = 40,\n VARIABLE_UNIVERSAL_LIFE = 41,\n HSA = 42,\n TAX_FREE_SAVINGS_ACCOUNT = 43,\n INDIVIDUAL = 44,\n REGISTERED_RETIREMENT_INCOME_FUND = 45,\n CASH_MANAGEMENT_ACCOUNT = 46,\n EMPLOYEE_STOCK_PURCHASE_PLAN = 47,\n REGISTERED_EDUCATION_SAVINGS_PLAN = 48,\n PROFIT_SHARING_PLAN = 49,\n UNIFORM_TRANSFER_TO_MINORS_ACT = 50,\n PLAN_401_A = 51,\n SARSEP_IRA = 52,\n FIXED_ANNUITY_TRADITIONAL_IRA = 53,\n VARIABLE_ANNUITY_TRADITIONAL_IRA = 54,\n SEPP_IRA = 55,\n INHERITED_TRADITIONAL_IRA = 56,\n FIXED_ANNUITY_ROTH_IRA = 57,\n VARIABLE_ANNUITY_ROTH_IRA = 58,\n INHERITED_ROTH_IRA = 59,\n COVERDELL = 60,\n ADVISORY_ACCOUNT = 61,\n BROKERAGE_MARGIN = 62,\n CHARITABLE_GIFT_ACCOUNT = 63,\n CHURCH_ACCOUNT = 64,\n CONSERVATORSHIP = 65,\n CUSTODIAL = 66,\n DEFINED_BENEFIT_PLAN = 67,\n DEFINED_CONTRIBUTION_PLAN = 68,\n EDUCATIONAL = 69,\n ESTATE = 70,\n EXECUTOR = 71,\n GROUP_RETIREMENT_SAVINGS_PLAN = 72,\n GUARANTEED_INVESTMENT_CERTIFICATE = 73,\n HRA = 74,\n INDEXED_ANNUITY = 75,\n INVESTMENT_CLUB = 76,\n IRREVOCABLE_TRUST = 77,\n JOINT_TENANTS_BY_ENTIRITY = 78,\n JOINT_TENANTS_COMMUNITY_PROPERTY = 79,\n JOINT_TENANTS_IN_COMMON = 80,\n JOINT_TENANTS_WITH_RIGHTS_OF_SURVIVORSHIP = 81,\n KEOUGH_PLAN = 82,\n LIFE_INCOME_FUND = 83,\n LIVING_TRUST = 84,\n LOCKED_IN_RETIREMENT_ACCOUNT = 85,\n LOCKED_IN_RETIREMENT_INVESTMENT_FUND = 86,\n LOCKED_IN_RETIREMENT_SAVINGS_ACCOUNT = 87,\n MONEY_PURCHASE_PLAN = 88,\n PARTNERSHIP = 89,\n PLAN_409_A = 90,\n PLAN_ROTH_403_B = 91,\n REGISTERED_DISABILITY_SAVINGS_PLAN = 92,\n REGISTERED_LOCKED_IN_SAVINGS_PLAN = 93,\n REGISTERED_PENSION_PLAN = 94,\n REGISTERED_RETIREMENT_SAVINGS_PLAN = 95,\n REVOCABLE_TRUST = 96,\n ROTH_CONVERSION = 97,\n SOLE_PROPRIETORSHIP = 98,\n SPOUSAL_IRA = 99,\n SPOUSAL_ROTH_IRA = 100,\n TESTAMENTARY_TRUST = 101,\n THRIFT_SAVINGS_PLAN = 102,\n INHERITED_ANNUITY = 103,\n CORPORATE_ACCOUNT = 104,\n LIMITED_LIABILITY_ACCOUNT = 105,\n HSA_SAVINGS = 106,\n HSA_CHECKING = 107,\n}\n\nexport enum PropertyType {\n REAL_ESTATE = 0,\n VEHICLE = 1,\n ART = 2,\n JEWELRY = 3,\n FURNITURE = 4,\n APPLIANCES = 5,\n COMPUTER = 6,\n ELECTRONICS = 7,\n SPORTS_EQUIPMENT = 8,\n MISCELLANEOUS = 9,\n}\n\nexport enum ConnectionStatusEnums {\n CREATED = 0, // The member is new and has not aggregated yet\n PREVENTED = 1, // MX preventing aggregation until credentials are updated\n DENIED = 2, // Invalid credentials\n CHALLENGED = 3, // MFA presented\n REJECTED = 4, // MFA answered incorrectly\n LOCKED = 5, // Institution is preventing authentication, user must contact FI\n CONNECTED = 6, // Successfully authenticated and aggregating data\n IMPEDED = 7, // User attention is needed in online banking (marketing message, terms and conditions etc.)\n RECONNECTED = 8, // The connection has been migrated, we will not aggregate until user interacts with UI\n DEGRADED = 9, // Aggregation has failed for a short period with a minimum number of attempts\n DISCONNECTED = 10, // Aggregation has failed for an extended period of time with a minimum number of attempts\n DISCONTINUED = 11, // The connection to this institution is no longer available\n CLOSED = 12, // The user, MX, the client or partner have marked the account as closed\n DELAYED = 13, // Aggregation has taken longer than expected without being CONNECTED\n FAILED = 14, // Aggregation failed without being CONNECTED\n UPDATED = 15, // Credenitals have been updated, but the member has not yet been CONNECTED\n DISABLED = 16, // Aggregation has been momentarily paused, but the member is still CONNECTED\n IMPORTED = 17, // Member was imported from another provider using the MDX Migration API\n RESUMED = 18, // MFA has been answered and has not yet been CONNECTED\n EXPIRED = 19, // MFA has not been answered before job timed out\n IMPAIRED = 20, // Memeber is missing some or all credentials needed to connect\n PENDING = 21, // OAuth member created but waiting for authentication redirect // Not visible to user\n}\n\nexport const ProcessingStatuses = [\n ConnectionStatusEnums.CREATED,\n ConnectionStatusEnums.UPDATED,\n ConnectionStatusEnums.RESUMED,\n]\n\nexport const MfaStatuses = [ConnectionStatusEnums.CHALLENGED, ConnectionStatusEnums.REJECTED]\n\nexport const ErrorStatuses = [\n ConnectionStatusEnums.PREVENTED,\n ConnectionStatusEnums.DENIED,\n ConnectionStatusEnums.LOCKED,\n ConnectionStatusEnums.IMPEDED,\n ConnectionStatusEnums.DEGRADED,\n ConnectionStatusEnums.DISCONNECTED,\n ConnectionStatusEnums.DISCONTINUED,\n ConnectionStatusEnums.CLOSED,\n ConnectionStatusEnums.DELAYED,\n ConnectionStatusEnums.FAILED,\n ConnectionStatusEnums.DISABLED,\n ConnectionStatusEnums.IMPORTED,\n ConnectionStatusEnums.EXPIRED,\n ConnectionStatusEnums.IMPAIRED,\n]\n\nexport const NonConnectedStatuses = [...ErrorStatuses, ...MfaStatuses]\n\nexport enum ConnectionStatus {\n Connected = 'Connected',\n Error = 'Error',\n Processing = 'Processing',\n RequiresMfa = 'RequiresMfa',\n}\n\nexport const StatusName: any = {\n [ConnectionStatusEnums.CHALLENGED]: 'Challenged',\n [ConnectionStatusEnums.CLOSED]: 'Closed',\n [ConnectionStatusEnums.DEGRADED]: 'Degraded',\n [ConnectionStatusEnums.DELAYED]: 'Delayed',\n [ConnectionStatusEnums.DENIED]: 'Denied',\n [ConnectionStatusEnums.DISABLED]: 'Disabled',\n [ConnectionStatusEnums.DISCONNECTED]: 'Disconnected',\n [ConnectionStatusEnums.DISCONTINUED]: 'Discontinued',\n [ConnectionStatusEnums.EXPIRED]: 'Expired',\n [ConnectionStatusEnums.FAILED]: 'Failed',\n [ConnectionStatusEnums.IMPAIRED]: 'Impaired',\n [ConnectionStatusEnums.IMPEDED]: 'Impeded',\n [ConnectionStatusEnums.IMPORTED]: 'Imported',\n [ConnectionStatusEnums.LOCKED]: 'Locked',\n [ConnectionStatusEnums.PREVENTED]: 'Prevented',\n [ConnectionStatusEnums.REJECTED]: 'Rejected',\n}\n\nexport const AccountTypeName: any = {\n [AccountType.ANY]: 'Any',\n [AccountType.CASH]: 'Cash',\n [AccountType.CHECKING]: 'Checking',\n [AccountType.CHECKING_LINE_OF_CREDIT]: 'Checking Line of Credit',\n [AccountType.CREDIT_CARD]: 'Credit Card',\n [AccountType.DIGITAL_WALLET]: 'Digital Wallet',\n [AccountType.INSURANCE]: 'Insurance',\n [AccountType.INVESTMENT]: 'Investment',\n [AccountType.LINE_OF_CREDIT]: 'Line of Credit',\n [AccountType.LOAN]: 'Loan',\n [AccountType.MORTGAGE]: 'Mortgage',\n [AccountType.PREPAID]: 'Prepaid',\n [AccountType.PROPERTY]: 'Property',\n [AccountType.SAVINGS]: 'Savings',\n}\n\nexport const AccountIcon: any = {\n [AccountType.ANY]: 'account_balance',\n [AccountType.CASH]: 'monetization_on',\n [AccountType.CHECKING]: 'checkbook',\n [AccountType.CHECKING_LINE_OF_CREDIT]: 'checkbook', // Checking line of credit has the same icon as checking\n [AccountType.CREDIT_CARD]: 'credit_card',\n [AccountType.DIGITAL_WALLET]: 'wallet',\n [AccountType.INSURANCE]: 'monitor_heart',\n [AccountType.INVESTMENT]: 'trending_up',\n [AccountType.LINE_OF_CREDIT]: 'add_credit',\n [AccountType.LOAN]: 'loans',\n [AccountType.MORTGAGE]: 'house',\n [AccountType.PREPAID]: 'credit_card',\n [AccountType.PROPERTY]: 'key',\n [AccountType.SAVINGS]: 'savings',\n}\n\nexport const AccountIconVariants: any = {\n [AccountType.INVESTMENT]: 'bid_landscape',\n}\n\nexport const PropertyTypeName: any = {\n [PropertyType.REAL_ESTATE]: 'Real Estate',\n [PropertyType.VEHICLE]: 'Vehicle',\n [PropertyType.ART]: 'Art',\n [PropertyType.JEWELRY]: 'Jewelry',\n [PropertyType.FURNITURE]: 'Furniture',\n [PropertyType.APPLIANCES]: 'Appliances',\n [PropertyType.COMPUTER]: 'Computer',\n [PropertyType.ELECTRONICS]: 'Electronics',\n [PropertyType.SPORTS_EQUIPMENT]: 'Sports Equipment',\n [PropertyType.MISCELLANEOUS]: 'Miscellaneous',\n}\n\nexport const PropertyIcon: any = {\n [PropertyType.REAL_ESTATE]: 'home_work',\n [PropertyType.VEHICLE]: 'directions_car',\n [PropertyType.ART]: 'insert_photo',\n [PropertyType.JEWELRY]: 'diamond',\n [PropertyType.FURNITURE]: 'chair',\n [PropertyType.APPLIANCES]: 'kitchen',\n [PropertyType.COMPUTER]: 'computer',\n [PropertyType.ELECTRONICS]: 'camera_alt',\n [PropertyType.SPORTS_EQUIPMENT]: 'sports_baseball',\n [PropertyType.MISCELLANEOUS]: 'monetization_on',\n}\n"],"mappings":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,IAAA;AAAA,EACA,IAAA;AAAA,EACL,IAAA;AAAA,EACD,IAAA;AAAA,EACE,IAAA;AAAA,EACD,GAAA;AAAA,EACC,IAAA;AAAA,EACF,GAAA;AAAA,EACG,GAAA;AAAA,EACD,GAAA;AACpC,GAEa,IAAuB;AAAA,EACf,GAAA;AAAA,EACC,GAAA;AAAA,EACI,GAAA;AAAA,EACe,IAAA;AAAA,EACZ,GAAA;AAAA,EACG,IAAA;AAAA,EACL,IAAA;AAAA,EACC,GAAA;AAAA,EACI,GAAA;AAAA,EACV,GAAA;AAAA,EACI,GAAA;AAAA,EACD,IAAA;AAAA,EACC,GAAA;AAAA,EACD,GAAA;AACzB,GAEa,IAAmB;AAAA,EACX,GAAA;AAAA,EACC,GAAA;AAAA,EACI,GAAA;AAAA,EACe,IAAA;AAAA,EACZ,GAAA;AAAA,EACG,IAAA;AAAA,EACL,IAAA;AAAA,EACC,GAAA;AAAA,EACI,GAAA;AAAA,EACV,GAAA;AAAA,EACI,GAAA;AAAA,EACD,IAAA;AAAA,EACC,GAAA;AAAA,EACD,GAAA;AACzB,GAEa,IAA2B,EAAA,GACZ,gBAC5B,GAEa,IAAwB;AAAA,EACP,GAAA;AAAA,EACJ,GAAA;AAAA,EACJ,GAAA;AAAA,EACI,GAAA;AAAA,EACE,GAAA;AAAA,EACC,GAAA;AAAA,EACF,GAAA;AAAA,EACG,GAAA;AAAA,EACK,GAAA;AAAA,EACH,GAAA;AAChC,GAEa,IAAoB;AAAA,EACH,GAAA;AAAA,EACJ,GAAA;AAAA,EACJ,GAAA;AAAA,EACI,GAAA;AAAA,EACE,GAAA;AAAA,EACC,GAAA;AAAA,EACF,GAAA;AAAA,EACG,GAAA;AAAA,EACK,GAAA;AAAA,EACH,GAAA;AAChC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Account, DetailedAccount, Member, MonthlyAccountBalance } from './Account';
|
|
1
|
+
export type { Account, DetailedAccount, HistoricalAccountBalance, Member, MonthlyAccountBalance, } from './Account';
|
|
2
2
|
export { AccountIcon, AccountIconVariants, AccountSubType, AccountType, AccountTypeName, ConnectionStatus, ConnectionStatusEnums, ErrorStatuses, MfaStatuses, NonConnectedStatuses, ProcessingStatuses, PropertyType, PropertyTypeName, StatusName, } from './Account';
|
|
3
3
|
export type { AnalyticsEvent, AnalyticsPageview, BasicAnalyticsEvent, BasicAnalyticsPageview, AnalyticsSession, AnalyticEventFunction, AnalyticPageviewFunction, AnalyticsSessionInstance, } from './Analytics';
|
|
4
4
|
export type { AppConfig, AppData, Banner, ClientConfig, Config, Options, StyleConfig, } from './AppData';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, AccountGroup, FinancialAccount, Member, MonthlyAccountBalance, NetWorth } from '../types';
|
|
1
|
+
import { Account, AccountGroup, FinancialAccount, HistoricalAccountBalance, Member, MonthlyAccountBalance, NetWorth } from '../types';
|
|
2
2
|
export declare const filterAccounts: (accounts: Account[], members: Member[]) => Account[];
|
|
3
3
|
export declare const flattenBalances: (allBalances: MonthlyAccountBalance[], currentBalances: MonthlyAccountBalance[]) => MonthlyAccountBalance[];
|
|
4
4
|
export declare const getLatestNetWorthData: (chartData: NetWorth[]) => NetWorth | undefined;
|
|
@@ -23,4 +23,5 @@ export declare const buildAssetsLiabilities: (accounts: Account[]) => {
|
|
|
23
23
|
totalAssets: number;
|
|
24
24
|
totalLiabilities: number;
|
|
25
25
|
};
|
|
26
|
+
export declare const toMonthlyAccountBalance: (hab: HistoricalAccountBalance) => MonthlyAccountBalance;
|
|
26
27
|
export declare const groupAccounts: (accounts: FinancialAccount[]) => AccountGroup[];
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { AccountIcon as
|
|
2
|
-
import { isAccountLiability as
|
|
3
|
-
import { format as
|
|
1
|
+
import { AccountIcon as _, AccountIconVariants as p, AccountTypeName as y } from "../types/Account.es.js";
|
|
2
|
+
import { isAccountLiability as d } from "./AccountUtils.es.js";
|
|
3
|
+
import { format as b } from "date-fns/format";
|
|
4
4
|
import { startOfMonth as v } from "date-fns/startOfMonth";
|
|
5
5
|
import { subMonths as A } from "date-fns/subMonths";
|
|
6
6
|
import { fromUnixTime as M } from "date-fns/fromUnixTime";
|
|
7
|
-
var
|
|
8
|
-
const { is_closed: a, is_deleted: s, is_hidden:
|
|
9
|
-
return a || s ||
|
|
7
|
+
var h = 13, W = (e, r) => e.filter((n) => {
|
|
8
|
+
const { is_closed: a, is_deleted: s, is_hidden: t, is_manual: o } = n;
|
|
9
|
+
return a || s || t ? !1 : o || !n.guid ? !0 : r.some((g) => e.some((c) => g.guid === c.member_guid));
|
|
10
10
|
}), G = (e, r) => [...e, ...r], R = (e) => {
|
|
11
11
|
if (e && e.length > 0) return e[e.length - 1];
|
|
12
|
-
}, U = (e, r) => e.year_month - r.year_month, N = () => Array.from({ length:
|
|
13
|
-
const
|
|
14
|
-
const l =
|
|
12
|
+
}, U = (e, r) => e.year_month - r.year_month, N = () => Array.from({ length: h }, (e, r) => Math.floor(v(A(/* @__PURE__ */ new Date(), r)).getTime() / 1e3)).sort(), j = (e, r, n) => !e.length || !r.length ? [] : N().reduceRight((a, s) => {
|
|
13
|
+
const t = r.filter(({ year_month: i }) => i === parseInt(b(M(s), "yyyyMM"))), o = e.map((i) => {
|
|
14
|
+
const l = t.find((u) => u.account_guid === i.guid), m = {
|
|
15
15
|
change: 0,
|
|
16
16
|
guid: i.guid,
|
|
17
17
|
name: i.name,
|
|
18
18
|
type: i.account_type,
|
|
19
19
|
balance: 0
|
|
20
20
|
};
|
|
21
|
-
if (!l && a.length === 0 && !i.balance) return
|
|
21
|
+
if (!l && a.length === 0 && !i.balance) return m;
|
|
22
22
|
if (!l && a.length === 0) return {
|
|
23
|
-
...
|
|
24
|
-
value:
|
|
23
|
+
...m,
|
|
24
|
+
value: d(i) ? -(i.balance ?? 0) : i.balance ?? 0
|
|
25
25
|
};
|
|
26
26
|
if (!l) {
|
|
27
|
-
const u = a[0].accounts.find((
|
|
28
|
-
return u ||
|
|
27
|
+
const u = a[0].accounts.find((f) => f.guid === i.guid);
|
|
28
|
+
return u || m;
|
|
29
29
|
}
|
|
30
30
|
return {
|
|
31
31
|
change: l.transaction_total,
|
|
@@ -34,7 +34,7 @@ var c = 13, W = (e, r) => e.filter((t) => {
|
|
|
34
34
|
type: i.account_type,
|
|
35
35
|
value: l.balance
|
|
36
36
|
};
|
|
37
|
-
}), { y: g, change:
|
|
37
|
+
}), { y: g, change: c } = o.reduce((i, l) => ({
|
|
38
38
|
y: i.y + (l.value || 0),
|
|
39
39
|
change: i.change + (l.change || 0)
|
|
40
40
|
}), {
|
|
@@ -45,59 +45,70 @@ var c = 13, W = (e, r) => e.filter((t) => {
|
|
|
45
45
|
accounts: o,
|
|
46
46
|
x: s,
|
|
47
47
|
y: g,
|
|
48
|
-
change:
|
|
48
|
+
change: c
|
|
49
49
|
}, ...a];
|
|
50
|
-
}, []).slice(
|
|
51
|
-
const r = [],
|
|
50
|
+
}, []).slice(h - n), k = (e) => {
|
|
51
|
+
const r = [], n = [];
|
|
52
52
|
let a = 0, s = 0;
|
|
53
|
-
return e?.accounts.forEach((
|
|
54
|
-
|
|
55
|
-
accountName:
|
|
56
|
-
gain:
|
|
57
|
-
}), a +=
|
|
58
|
-
accountName:
|
|
59
|
-
loss:
|
|
60
|
-
}), s +=
|
|
53
|
+
return e?.accounts.forEach((t) => {
|
|
54
|
+
t.change > 0 && (r.push({
|
|
55
|
+
accountName: t.name,
|
|
56
|
+
gain: t.change
|
|
57
|
+
}), a += t.change), t.change < 0 && (n.push({
|
|
58
|
+
accountName: t.name,
|
|
59
|
+
loss: t.change
|
|
60
|
+
}), s += t.change);
|
|
61
61
|
}), {
|
|
62
62
|
netWorth: e,
|
|
63
63
|
gains: r,
|
|
64
|
-
losses:
|
|
64
|
+
losses: n,
|
|
65
65
|
totalGains: a,
|
|
66
66
|
totalLosses: s
|
|
67
67
|
};
|
|
68
68
|
}, w = (e) => {
|
|
69
|
-
const r = [],
|
|
69
|
+
const r = [], n = [];
|
|
70
70
|
let a = 0, s = 0;
|
|
71
|
-
return e.forEach((
|
|
72
|
-
if (
|
|
73
|
-
const o =
|
|
74
|
-
|
|
75
|
-
accountName:
|
|
76
|
-
accountType:
|
|
71
|
+
return e.forEach((t) => {
|
|
72
|
+
if (d(t)) {
|
|
73
|
+
const o = t.balance ?? 0;
|
|
74
|
+
n.push({
|
|
75
|
+
accountName: t.name,
|
|
76
|
+
accountType: t.account_type,
|
|
77
77
|
balance: o
|
|
78
78
|
}), s += o;
|
|
79
79
|
} else {
|
|
80
|
-
const o =
|
|
80
|
+
const o = t.balance ?? 0;
|
|
81
81
|
r.push({
|
|
82
|
-
accountName:
|
|
83
|
-
accountType:
|
|
82
|
+
accountName: t.name,
|
|
83
|
+
accountType: t.account_type,
|
|
84
84
|
balance: o
|
|
85
85
|
}), a += o;
|
|
86
86
|
}
|
|
87
87
|
}), {
|
|
88
88
|
assets: r,
|
|
89
|
-
liabilities:
|
|
89
|
+
liabilities: n,
|
|
90
90
|
totalAssets: a,
|
|
91
91
|
totalLiabilities: s
|
|
92
92
|
};
|
|
93
|
-
}, x = (e) => {
|
|
94
|
-
|
|
93
|
+
}, x = (e) => ({
|
|
94
|
+
account_guid: e.account_guid,
|
|
95
|
+
balance: e.balance,
|
|
96
|
+
credit_transaction_total: 0,
|
|
97
|
+
debit_transaction_total: 0,
|
|
98
|
+
id: e.guid,
|
|
99
|
+
month: e.month,
|
|
100
|
+
transaction_total: e.transaction_total ?? 0,
|
|
101
|
+
user_guid: e.user_guid,
|
|
102
|
+
year: e.year,
|
|
103
|
+
year_month: e.year_month
|
|
104
|
+
}), z = (e) => {
|
|
105
|
+
const r = e.reduce((n, a) => {
|
|
95
106
|
const s = a.accountType;
|
|
96
|
-
return
|
|
107
|
+
return n[s] || (n[s] = []), n[s].push(a), n;
|
|
97
108
|
}, {});
|
|
98
|
-
return Object.entries(r).map(([
|
|
99
|
-
icon:
|
|
100
|
-
name: y[+
|
|
109
|
+
return Object.entries(r).map(([n, a]) => ({
|
|
110
|
+
icon: p[+n] || _[+n],
|
|
111
|
+
name: y[+n],
|
|
101
112
|
accounts: a
|
|
102
113
|
}));
|
|
103
114
|
};
|
|
@@ -108,8 +119,9 @@ export {
|
|
|
108
119
|
W as filterAccounts,
|
|
109
120
|
G as flattenBalances,
|
|
110
121
|
R as getLatestNetWorthData,
|
|
111
|
-
|
|
112
|
-
U as sortByYearMonthAscending
|
|
122
|
+
z as groupAccounts,
|
|
123
|
+
U as sortByYearMonthAscending,
|
|
124
|
+
x as toMonthlyAccountBalance
|
|
113
125
|
};
|
|
114
126
|
|
|
115
127
|
//# sourceMappingURL=NetWorthUtils.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetWorthUtils.es.js","names":[],"sources":["../../../src/core/utils/NetWorthUtils.ts"],"sourcesContent":["import { format } from 'date-fns/format'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { subMonths } from 'date-fns/subMonths'\n\nimport type {\n Account,\n AccountGroup,\n FinancialAccount,\n Member,\n MonthlyAccountBalance,\n NetWorth,\n} from '../types'\nimport { AccountTypeName, AccountIcon, AccountIconVariants } from '../types'\nimport { isAccountLiability } from '../utils/AccountUtils'\n\nconst MAX_NUMBER_MONTHS = 13\n\nexport const filterAccounts = (accounts: Account[], members: Member[]) => {\n return accounts.filter((account) => {\n const { is_closed, is_deleted, is_hidden, is_manual } = account\n\n if (is_closed || is_deleted || is_hidden) return false\n if (is_manual || !account.guid) return true\n\n return members.some((member) => {\n return accounts.some((account) => {\n return member.guid === account.member_guid\n })\n })\n })\n}\n\nexport const flattenBalances = (\n allBalances: MonthlyAccountBalance[],\n currentBalances: MonthlyAccountBalance[],\n) => {\n return [...allBalances, ...currentBalances]\n}\n\nexport const getLatestNetWorthData = (chartData: NetWorth[]) => {\n if (chartData && chartData.length > 0) {\n return chartData[chartData.length - 1]\n } else return undefined\n}\n\nexport const sortByYearMonthAscending = (a: MonthlyAccountBalance, b: MonthlyAccountBalance) =>\n a.year_month - b.year_month\n\nconst buildDateTicks = () => {\n return Array.from({ length: MAX_NUMBER_MONTHS }, (_, count) => {\n return Math.floor(startOfMonth(subMonths(new Date(), count)).getTime() / 1000)\n }).sort()\n}\n\nexport const buildChartData = (\n accounts: Account[],\n monthlyAccountBalances: MonthlyAccountBalance[],\n numberOfMonths: number,\n) => {\n if (!accounts.length || !monthlyAccountBalances.length) return []\n const dateTicks = buildDateTicks()\n return dateTicks\n .reduceRight((result: any, x) => {\n const balances = monthlyAccountBalances.filter(\n ({ year_month }) => year_month === parseInt(format(fromUnixTime(x), 'yyyyMM')),\n )\n const accountsWithBalances = accounts.map((account) => {\n const balance = balances.find((balance) => balance.account_guid === account.guid)\n\n const zeroBalance = {\n change: 0,\n guid: account.guid,\n name: account.name,\n type: account.account_type,\n balance: 0,\n }\n\n if (!balance && result.length === 0 && !account.balance) return zeroBalance\n\n // The servers return the monthly account balances in Utah time. Frontend starts all the date calculations\n // in UTC. We get into overlaps for a few hours depending on the timezone with no monthly account balances\n // for all accounts.\n if (!balance && result.length === 0) {\n return {\n ...zeroBalance,\n value: isAccountLiability(account) ? -(account.balance ?? 0) : (account.balance ?? 0),\n }\n }\n\n if (!balance) {\n const lastBalance = result[0].accounts.find((acc: Account) => acc.guid === account.guid)\n\n return lastBalance ? lastBalance : zeroBalance\n }\n\n return {\n change: balance.transaction_total,\n guid: account.guid,\n name: account.name,\n type: account.account_type,\n value: balance.balance,\n }\n })\n\n const { y, change } = accountsWithBalances.reduce(\n (acc, current) => {\n return {\n y: acc.y + (current.value || 0),\n change: acc.change + (current.change || 0),\n }\n },\n { y: 0, change: 0 },\n )\n\n return [\n {\n accounts: accountsWithBalances,\n x,\n y,\n change,\n },\n ...result,\n ]\n }, [])\n .slice(MAX_NUMBER_MONTHS - numberOfMonths)\n}\n\nexport const buildGainsLosses = (selectedData?: NetWorth) => {\n const gains: { accountName: string; gain: number }[] = []\n const losses: { accountName: string; loss: number }[] = []\n let totalGains = 0\n let totalLosses = 0\n\n selectedData?.accounts.forEach((account) => {\n if (account.change > 0) {\n gains.push({ accountName: account.name, gain: account.change })\n totalGains += account.change\n }\n if (account.change < 0) {\n losses.push({ accountName: account.name, loss: account.change })\n totalLosses += account.change\n }\n })\n\n return { netWorth: selectedData, gains, losses, totalGains, totalLosses }\n}\n\nexport const buildAssetsLiabilities = (accounts: Account[]) => {\n const assets: FinancialAccount[] = []\n const liabilities: FinancialAccount[] = []\n let totalAssets = 0\n let totalLiabilities = 0\n\n accounts.forEach((account) => {\n if (isAccountLiability(account)) {\n const balance = account.balance ?? 0\n liabilities.push({ accountName: account.name, accountType: account.account_type, balance })\n totalLiabilities += balance\n } else {\n const balance = account.balance ?? 0\n assets.push({ accountName: account.name, accountType: account.account_type, balance })\n totalAssets += balance\n }\n })\n\n return { assets, liabilities, totalAssets, totalLiabilities }\n}\n// groups accounts by account type\n// returns array of account groups, each with an icon, name, and the grouped accounts\nexport const groupAccounts = (accounts: FinancialAccount[]): AccountGroup[] => {\n const groupedAccounts = accounts.reduce<{ [key: number]: FinancialAccount[] }>((acc, account) => {\n const accountType = account.accountType\n if (!acc[accountType]) {\n acc[accountType] = []\n }\n acc[accountType].push(account)\n return acc\n }, {})\n\n return Object.entries(groupedAccounts).map(([accountType, accounts]) => ({\n icon: AccountIconVariants[+accountType] || AccountIcon[+accountType],\n name: AccountTypeName[+accountType],\n accounts,\n }))\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"NetWorthUtils.es.js","names":[],"sources":["../../../src/core/utils/NetWorthUtils.ts"],"sourcesContent":["import { format } from 'date-fns/format'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { startOfMonth } from 'date-fns/startOfMonth'\nimport { subMonths } from 'date-fns/subMonths'\n\nimport type {\n Account,\n AccountGroup,\n FinancialAccount,\n HistoricalAccountBalance,\n Member,\n MonthlyAccountBalance,\n NetWorth,\n} from '../types'\nimport { AccountTypeName, AccountIcon, AccountIconVariants } from '../types'\nimport { isAccountLiability } from '../utils/AccountUtils'\n\nconst MAX_NUMBER_MONTHS = 13\n\nexport const filterAccounts = (accounts: Account[], members: Member[]) => {\n return accounts.filter((account) => {\n const { is_closed, is_deleted, is_hidden, is_manual } = account\n\n if (is_closed || is_deleted || is_hidden) return false\n if (is_manual || !account.guid) return true\n\n return members.some((member) => {\n return accounts.some((account) => {\n return member.guid === account.member_guid\n })\n })\n })\n}\n\nexport const flattenBalances = (\n allBalances: MonthlyAccountBalance[],\n currentBalances: MonthlyAccountBalance[],\n) => {\n return [...allBalances, ...currentBalances]\n}\n\nexport const getLatestNetWorthData = (chartData: NetWorth[]) => {\n if (chartData && chartData.length > 0) {\n return chartData[chartData.length - 1]\n } else return undefined\n}\n\nexport const sortByYearMonthAscending = (a: MonthlyAccountBalance, b: MonthlyAccountBalance) =>\n a.year_month - b.year_month\n\nconst buildDateTicks = () => {\n return Array.from({ length: MAX_NUMBER_MONTHS }, (_, count) => {\n return Math.floor(startOfMonth(subMonths(new Date(), count)).getTime() / 1000)\n }).sort()\n}\n\nexport const buildChartData = (\n accounts: Account[],\n monthlyAccountBalances: MonthlyAccountBalance[],\n numberOfMonths: number,\n) => {\n if (!accounts.length || !monthlyAccountBalances.length) return []\n const dateTicks = buildDateTicks()\n return dateTicks\n .reduceRight((result: any, x) => {\n const balances = monthlyAccountBalances.filter(\n ({ year_month }) => year_month === parseInt(format(fromUnixTime(x), 'yyyyMM')),\n )\n const accountsWithBalances = accounts.map((account) => {\n const balance = balances.find((balance) => balance.account_guid === account.guid)\n\n const zeroBalance = {\n change: 0,\n guid: account.guid,\n name: account.name,\n type: account.account_type,\n balance: 0,\n }\n\n if (!balance && result.length === 0 && !account.balance) return zeroBalance\n\n // The servers return the monthly account balances in Utah time. Frontend starts all the date calculations\n // in UTC. We get into overlaps for a few hours depending on the timezone with no monthly account balances\n // for all accounts.\n if (!balance && result.length === 0) {\n return {\n ...zeroBalance,\n value: isAccountLiability(account) ? -(account.balance ?? 0) : (account.balance ?? 0),\n }\n }\n\n if (!balance) {\n const lastBalance = result[0].accounts.find((acc: Account) => acc.guid === account.guid)\n\n return lastBalance ? lastBalance : zeroBalance\n }\n\n return {\n change: balance.transaction_total,\n guid: account.guid,\n name: account.name,\n type: account.account_type,\n value: balance.balance,\n }\n })\n\n const { y, change } = accountsWithBalances.reduce(\n (acc, current) => {\n return {\n y: acc.y + (current.value || 0),\n change: acc.change + (current.change || 0),\n }\n },\n { y: 0, change: 0 },\n )\n\n return [\n {\n accounts: accountsWithBalances,\n x,\n y,\n change,\n },\n ...result,\n ]\n }, [])\n .slice(MAX_NUMBER_MONTHS - numberOfMonths)\n}\n\nexport const buildGainsLosses = (selectedData?: NetWorth) => {\n const gains: { accountName: string; gain: number }[] = []\n const losses: { accountName: string; loss: number }[] = []\n let totalGains = 0\n let totalLosses = 0\n\n selectedData?.accounts.forEach((account) => {\n if (account.change > 0) {\n gains.push({ accountName: account.name, gain: account.change })\n totalGains += account.change\n }\n if (account.change < 0) {\n losses.push({ accountName: account.name, loss: account.change })\n totalLosses += account.change\n }\n })\n\n return { netWorth: selectedData, gains, losses, totalGains, totalLosses }\n}\n\nexport const buildAssetsLiabilities = (accounts: Account[]) => {\n const assets: FinancialAccount[] = []\n const liabilities: FinancialAccount[] = []\n let totalAssets = 0\n let totalLiabilities = 0\n\n accounts.forEach((account) => {\n if (isAccountLiability(account)) {\n const balance = account.balance ?? 0\n liabilities.push({ accountName: account.name, accountType: account.account_type, balance })\n totalLiabilities += balance\n } else {\n const balance = account.balance ?? 0\n assets.push({ accountName: account.name, accountType: account.account_type, balance })\n totalAssets += balance\n }\n })\n\n return { assets, liabilities, totalAssets, totalLiabilities }\n}\nexport const toMonthlyAccountBalance = (hab: HistoricalAccountBalance): MonthlyAccountBalance => ({\n account_guid: hab.account_guid,\n balance: hab.balance,\n credit_transaction_total: 0,\n debit_transaction_total: 0,\n id: hab.guid,\n month: hab.month,\n transaction_total: hab.transaction_total ?? 0,\n user_guid: hab.user_guid,\n year: hab.year,\n year_month: hab.year_month,\n})\n\n// groups accounts by account type\n// returns array of account groups, each with an icon, name, and the grouped accounts\nexport const groupAccounts = (accounts: FinancialAccount[]): AccountGroup[] => {\n const groupedAccounts = accounts.reduce<{ [key: number]: FinancialAccount[] }>((acc, account) => {\n const accountType = account.accountType\n if (!acc[accountType]) {\n acc[accountType] = []\n }\n acc[accountType].push(account)\n return acc\n }, {})\n\n return Object.entries(groupedAccounts).map(([accountType, accounts]) => ({\n icon: AccountIconVariants[+accountType] || AccountIcon[+accountType],\n name: AccountTypeName[+accountType],\n accounts,\n }))\n}\n"],"mappings":";;;;;;AAiBA,IAAM,IAAoB,IAEb,IAAA,CAAkB,GAAqB,MAC3C,EAAS,OAAA,CAAQ,MAAY;AAClC,QAAM,EAAE,WAAA,GAAW,YAAA,GAAY,WAAA,GAAW,WAAA,EAAA,IAAc;AAExD,SAAI,KAAa,KAAc,IAAkB,KAC7C,KAAa,CAAC,EAAQ,OAAa,KAEhC,EAAQ,KAAA,CAAM,MACZ,EAAS,KAAA,CAAM,MACb,EAAO,SAAS,EAAQ,WAChC,CACF;AACH,CAAC,GAGU,IAAA,CACX,GACA,MAEO,CAAC,GAAG,GAAa,GAAG,CAAe,GAG/B,IAAA,CAAyB,MAA0B;AAC9D,MAAI,KAAa,EAAU,SAAS,EAClC,QAAO,EAAU,EAAU,SAAS,CAAA;AAExC,GAEa,IAAA,CAA4B,GAA0B,MACjE,EAAE,aAAa,EAAE,YAEb,IAAA,MACG,MAAM,KAAK,EAAE,QAAQ,EAAkB,GAAA,CAAI,GAAG,MAC5C,KAAK,MAAM,EAAa,EAAU,oBAAI,KAAK,GAAG,CAAK,CAAC,EAAE,QAAQ,IAAI,GAAI,CAC9E,EAAE,KAAK,GAGG,IAAA,CACX,GACA,GACA,MAEI,CAAC,EAAS,UAAU,CAAC,EAAuB,SAAe,CAAC,IAC9C,EACX,EACJ,YAAA,CAAa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