whisper-money/app
Víctor Falcón 0b528b7902
feat: add Discord admin feed for daily stats and Stripe events (#458)
## What

Adds a private Discord admin feed with two flows, both posting through
one webhook (`DISCORD_WEBHOOK_URL`):

### 1. Daily stats — `stats:daily-report`
Scheduled **09:00 Europe/Madrid**. Posts an embed with:
- New users created **yesterday** (Madrid calendar day, converted to UTC
for the query)
- Total users
- Active/trialing counts + current & projected **MRR / ARR** per
currency

Reuses the #457 Stripe stats logic, extracted into
`SubscriptionStatsCollector` so the existing `stripe:subscription-stats`
command and this report share one source of truth.

### 2. Stripe events — `PostStripeEventToDiscord`
Queued listener on Cashier's `WebhookReceived`. Posts on:
- `customer.subscription.created` / `updated` / `deleted`
- `invoice.payment_succeeded` / `payment_failed`

## Setup
- `DISCORD_WEBHOOK_URL` — added to prod  (set locally to test)
- Stripe dashboard must send the 5 event types above to the existing
Cashier `/stripe/webhook` endpoint
- A queue worker must be running (listener is `ShouldQueue`)

## Tests
13 passing: Discord client (3), daily report (2), Stripe event listener
(4), plus the existing stats command (4) still green after the refactor.
2026-05-30 18:14:46 +02:00
..
Actions fix(categories): expose cashflow setting on create (#448) 2026-05-29 11:05:04 +02:00
Console/Commands feat: add Discord admin feed for daily stats and Stripe events (#458) 2026-05-30 18:14:46 +02:00
Contracts feat(banking): add banking:backfill-ibans command to populate missing IBANs (#221) 2026-03-12 10:58:55 +00:00
Enums feat(cashflow): add savings and period views (#424) 2026-05-25 16:41:00 +02:00
Events Add Budgeting Feature to Track and Manage Spending (#36) 2026-01-21 15:25:50 +01:00
Exceptions/Banking Handle transient EnableBanking sync failures (#358) 2026-05-06 09:24:05 +02:00
Features feat(import): calculate balances from transactions (#403) 2026-05-20 10:29:14 +01:00
Http feat(categorize): show debtor and creditor names (#454) 2026-05-30 12:27:59 +02:00
Jobs fix: batch automation rule application (#435) 2026-05-26 10:45:37 +02:00
Listeners feat: add Discord admin feed for daily stats and Stripe events (#458) 2026-05-30 18:14:46 +02:00
Mail feat(leads): add user lead re-invite campaign (#432) 2026-05-26 08:35:31 +02:00
Models feat(transactions): add counterparty fields (#440) 2026-05-27 16:20:55 +02:00
Notifications feat: selective retry of failed lead email jobs (#286) 2026-04-15 08:00:29 +01:00
Policies feat(accounts): add real estate asset tracking (#241) 2026-03-24 10:21:32 +00:00
Providers feat: add Discord admin feed for daily stats and Stripe events (#458) 2026-05-30 18:14:46 +02:00
Services feat: add Discord admin feed for daily stats and Stripe events (#458) 2026-05-30 18:14:46 +02:00