diff options
author | 2025-02-03 21:44:04 +0100 | |
---|---|---|
committer | 2025-02-03 21:52:34 +0100 | |
commit | 529c88163bf125718d6ba1b98f03e32029ba6ae6 (patch) | |
tree | 246c8676183f4e39eda0e97fd9d3c2a22fa0fcf4 | |
parent | Abolish entropy (diff) |
Implement Chris' new savings policy
Fixes #557.
-rw-r--r-- | ansible/roles/munin-node/templates/plugins/lovelace/lovering_inheritance.py.j2 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ansible/roles/munin-node/templates/plugins/lovelace/lovering_inheritance.py.j2 b/ansible/roles/munin-node/templates/plugins/lovelace/lovering_inheritance.py.j2 index b5b94c8..e896e4a 100644 --- a/ansible/roles/munin-node/templates/plugins/lovelace/lovering_inheritance.py.j2 +++ b/ansible/roles/munin-node/templates/plugins/lovelace/lovering_inheritance.py.j2 @@ -39,6 +39,29 @@ accrued_interest = 0 for _ in range(days_griefed): accrued_interest += interest_per_day * (savings + accrued_interest) +savings_policy_v1_start = datetime.date(2025, 3, 1) +savings_policy_v1_standard_savings_per_month = 50 +savings_policy_v1_savings_per_month = { + # Roses are red, + # violets are blue, + # running heat pumps in winter + # makes Chris Lovering poor + 12: savings_policy_v1_standard_savings_per_month - 10, + 1: savings_policy_v1_standard_savings_per_month - 20, + 2: savings_policy_v1_standard_savings_per_month - 10, +} +savings_policy_cursor = datetime.date(2025, 3, 1) +while savings_policy_cursor <= today: + # Chris thinks about saving every day, but he only manages to actually put + # money into his bank account on the 1st of every month due to a "tax + # advisor suggestion". + if savings_policy_cursor.day == 1: + savings += savings_policy_v1_savings_per_month.get( + savings_policy_cursor.month, + savings_policy_v1_standard_savings_per_month + ) + savings_policy_cursor += datetime.timedelta(days=1) + inherited_money = 0 if days_griefed > 10: |