@hearthlog/module-finance 1.0.1 → 1.1.1
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/hearthlog.module.json +1 -1
- package/package.json +6 -6
- package/src/attention.ts +8 -1
package/hearthlog.module.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hearthlog/module-finance",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"kysely": "^0.29.6"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@hearthlog/contracts": ">=0.1.0 <0.2.0 || 0.2.0",
|
|
23
|
-
"@hearthlog/sdk": ">=0.1.0 <0.2.0 || 0.2.0"
|
|
22
|
+
"@hearthlog/contracts": ">=0.1.0 <0.2.0 || 0.2.0 || 0.3.1 || 0.4.0",
|
|
23
|
+
"@hearthlog/sdk": ">=0.1.0 <0.2.0 || 0.2.0 || 0.3.1 || 0.4.0"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"!**/*.test.ts"
|
|
37
37
|
],
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@hearthlog/contracts": ">=0.1.0 <0.2.0 || 0.2.0",
|
|
40
|
-
"@hearthlog/sdk": ">=0.1.0 <0.2.0 || 0.2.0",
|
|
41
|
-
"@hearthlog/tooling": ">=0.1.0 <0.2.0 || 0.2.0",
|
|
39
|
+
"@hearthlog/contracts": ">=0.1.0 <0.2.0 || 0.2.0 || 0.3.1 || 0.4.0",
|
|
40
|
+
"@hearthlog/sdk": ">=0.1.0 <0.2.0 || 0.2.0 || 0.3.1 || 0.4.0",
|
|
41
|
+
"@hearthlog/tooling": ">=0.1.0 <0.2.0 || 0.2.0 || 0.3.1 || 0.4.0",
|
|
42
42
|
"vitest": "^4.1.11"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
package/src/attention.ts
CHANGED
|
@@ -31,8 +31,15 @@ export function planReminders(days: readonly PlannedDay[]): AttentionReminder[]
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
/** Plans waiting for a decision remind on their day. */
|
|
34
|
+
/** Plans waiting for a decision remind on their day; the sidebar shows what is available now. */
|
|
35
35
|
export const attention: AttentionContribution = {
|
|
36
|
+
async figures({ today }) {
|
|
37
|
+
const outlook = await queryDatabase((repositories) => repositories.timeline.getOutlook({ today }));
|
|
38
|
+
// Nothing recorded yet: no figure rather than a zero.
|
|
39
|
+
if (outlook.available === 0) return [];
|
|
40
|
+
const money = formatMoney(outlook.available, { decimals: 'never' });
|
|
41
|
+
return [{ id: 'finance', text: money, label: `${money} available now` }];
|
|
42
|
+
},
|
|
36
43
|
async reminders({ today }) {
|
|
37
44
|
const days = await queryDatabase((repositories) =>
|
|
38
45
|
repositories.plannedDays.plannedDays(format(today, DAY), format(addDays(today, PLAN_HORIZON_DAYS), DAY), PLAN_HORIZON_DAYS + 1));
|