05/31 Phase 6

This commit is contained in:
2026-05-31 16:55:43 -04:00
parent b3d495e57c
commit 46a604a73a
8 changed files with 1172 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""
Cron script: save monthly net worth snapshot.
Run by systemd timer pfm-snapshot.timer on 1st of each month at 00:05.
"""
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from app import create_app
from app.services.report_service import take_net_worth_snapshot
app = create_app()
if __name__ == '__main__':
with app.app_context():
print('[snapshot] Saving net worth snapshot...')
snap = take_net_worth_snapshot()
print(f'[snapshot] Net worth on {snap.snapshot_date}: '
f'assets={snap.total_assets}, '
f'liabilities={snap.total_liabilities}, '
f'net={snap.net_worth}')