[insight] Plans and statistics: category plans, categories of your own, one definition of spending, the month in numbers; v0.5.0

- category.planned (carries forward, zero removes it; spending categories only) and category.created
- fiscus-insight: spending (outflows, inflow, largest-remainder thousandths that add up to 1000), plan (the
  month against its plan with the pace, a suggested plan from the last three months), stats (pie slices, in,
  out, net, six months, same day last month, top merchants, subscriptions' share)
- docs/04_plans_stats.md; 11 new tests
This commit is contained in:
2026-11-06 13:02:39 +01:00
parent 4e8e80efb4
commit 03dc2061f9
13 changed files with 811 additions and 11 deletions
+11 -2
View File
@@ -1,6 +1,15 @@
//! The categories the app offers. A category is an id; the label is what the app shows.
pub const UNCATEGORISED: &str = "uncategorised";
/// Money between your own accounts: never spending.
pub const TRANSFERS: &str = "transfers";
pub const INCOME: &str = "income";
/// Categories a monthly plan cannot be for: money in, money moved, and money not yet sorted.
pub const NOT_PLANNABLE: [&str; 3] = [INCOME, TRANSFERS, UNCATEGORISED];
/// The most a category's monthly plan can be: 100 000 000 CZK, far from any sum overflowing.
pub const MAX_PLAN: crate::money::Haler = crate::money::Haler(10_000_000_000);
/// `(id, label)` in the order the app lists them.
pub const DEFAULT: &[(&str, &str)] = &[
@@ -16,8 +25,8 @@ pub const DEFAULT: &[(&str, &str)] = &[
("fun", "Fun"),
("travel", "Travel"),
("gifts", "Gifts"),
("income", "Income"),
("transfers", "Transfers"),
(INCOME, "Income"),
(TRANSFERS, "Transfers"),
("other", "Other"),
(UNCATEGORISED, "Uncategorised"),
];