> ## Documentation Index
> Fetch the complete documentation index at: https://whalescorp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Критично (P0 — обязательно до production billing)

| Пробел | Последствие | Решение |
| :- | :- | :- |
| Нет генерации PDF | Нельзя отправлять профессиональные invoices | Реализовать через `pdfmake`, <br />lazy-loaded в <br />`api/lib/pdf-invoice.ts` |
| Нет действия `mark_invoice_paid` | `payment_status` <br />никогда не переходит в `paid` | Добавить action + колонки <br />`paid_at`, `solana_tx_sig` |
| Нет отправки invoices по email | Invoices видны только в admin UI | Отправлять email при `finalize_invoice` <br />через существующий MS Graph |
| `billing_period` = `NULL` <br />у старых записей | Invoices могут пропустить комиссии до migration 035 | Миграция `038`: backfill из <br />`DATE_TRUNC('month', created_at)` |
| Distribution model <br />не реализована | Settlement statements и <br />rebates не существуют | Миграции `042–044` + <br />новые API actions |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.