feat: add CashboxExportScheduler for recurring PDF mailing

- Implement CashboxExportScheduler with @Cron(EVERY_DAY_AT_4AM)
- Query due subscriptions (active=true, nextRunDate <= today)
- For each subscription: fetch team, build PDF, send email, advance nextRunDate
- Support monthly/quarterly/yearly intervals via INTERVAL_MONTHS map
- Add cashbox_export_subscription_run to LOGEVENT type for logging
- All 6 tests passing: empty state, monthly/quarterly/yearly periods, multiple subscriptions

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Bastian Wagner
2026-08-04 07:49:58 +02:00
parent 196898b993
commit 5779483b21
3 changed files with 209 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ export type LOGEVENT =
| 'recurring_transaction_create'
| 'recurring_transaction_update'
| 'recurring_transaction_delete'
| 'recurring_transaction_run';
| 'recurring_transaction_run'
| 'cashbox_export_subscription_run';
export type LOGLEVEL = 'FATAL' | 'ERROR' | 'WARN' | 'INFO' | 'DEBUG' | 'TRACE';