Skip to content

Commit 4e0b6f9

Browse files
committed
Implement Chris' new savings policy
Fixes #557.
1 parent 41752d8 commit 4e0b6f9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

ansible/roles/munin-node/templates/plugins/lovelace/lovering_inheritance.py.j2

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,29 @@ accrued_interest = 0
3939
for _ in range(days_griefed):
4040
accrued_interest += interest_per_day * (savings + accrued_interest)
4141

42+
savings_policy_v1_start = datetime.date(2025, 3, 1)
43+
savings_policy_v1_standard_savings_per_month = 50
44+
savings_policy_v1_savings_per_month = {
45+
# Roses are red,
46+
# violets are blue,
47+
# running heat pumps in winter
48+
# makes Chris Lovering poor
49+
12: savings_policy_v1_standard_savings_per_month - 10,
50+
1: savings_policy_v1_standard_savings_per_month - 20,
51+
2: savings_policy_v1_standard_savings_per_month - 10,
52+
}
53+
savings_policy_cursor = datetime.date(2025, 3, 1)
54+
while savings_policy_cursor <= today:
55+
# Chris thinks about saving every day, but he only manages to actually put
56+
# money into his bank account on the 1st of every month due to a "tax
57+
# advisor suggestion".
58+
if savings_policy_cursor.day == 1:
59+
savings += savings_policy_v1_savings_per_month.get(
60+
savings_policy_cursor.month,
61+
savings_policy_v1_standard_savings_per_month
62+
)
63+
savings_policy_cursor += datetime.timedelta(days=1)
64+
4265
inherited_money = 0
4366

4467
if days_griefed > 10:

0 commit comments

Comments
 (0)