feat(api,ui): send-report, mobile fixes, admin month selector, data retention - #7
Merged
Conversation
- Add /api/send-report: HTML-to-PDF via puppeteer+chromium-min, Excel via SheetJS, email with both attachments via Resend, archive+clear transactions after send - Add /api/cron/monthly-report: last-day-of-month guard + CRON_SECRET verification; schedule 0 22 28-31 * * in vercel.json - Fix member flow mobile layout: item grid cols-3→responsive, member grid, FlowShell padding, start screen hero sizing, SuccessScreen scaling
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Add live Vercel screenshots for the member flow and admin views - Embed the key member and admin captures in the README screenshots section
…em fonts, grand total
…fix report page-top spacing; restore original section layout
- /api/send-report now requires x-admin-pin header matching ADMIN_PIN env var - /api/cron/monthly-report now checks Authorization: Bearer header (Vercel Cron standard) instead of the custom x-cron-secret header that never fired - AdminLogin stores adminPin in sessionStorage after successful PIN verify - AdminDashboard passes x-admin-pin header when triggering the report
PDF changes: - Gradient amber header with coffee cup SVG mark - Dark KPI strip (entries / total / consumers / companies) - Company overview table with dark header and amber total row - Amber section labels with accent pill - Amber-on-cream column headers inside each company block - Footer border is now 2px amber accent Excel changes: - Switch from xlsx to exceljs for full cell-style support - Amber header rows (white text) on all sheets - Alternating stone-50 row fill for readability - Amber total/subtotal rows on all sheets - Per-company sheet added (sheet 2) showing member breakdown with subtotals - All euro columns formatted with German locale number format - Tab colors: amber-600 / amber-700 / stone-500
UI:
- MonthSelector is now a real <select> showing the last 3 months
- AdminDashboard filters all data (summary cards, log, company table) by
the selected month; switching month clears log filters automatically
- handleSendReport passes the selected month in the POST body
- Modal text updated: no longer says "Tabelle zurückgesetzt" (data kept)
API:
- fetchAndEnrich() and runMonthlyReport() accept an optional forMonth param
("2026-05"); defaults to current calendar month if omitted
- send-report reads month from request body and forwards it
- pruneOldTransactions() deletes rows older than 3 months after each report
so the transactions table stays lean without losing current-period data
PDF:
- Column headers inside company blocks reverted from amber-cream to plain
stone-100 / stone-500 — the double amber band was visually heavy
- Gesamt row border restored to solid amber-600 (was amber-200)
PDF: remove dark KPI strip and gradient header; replace with flat amber-600 header and white KPI row matching the app's minimal aesthetic. Excel: switch from columns.header shortcut to explicit addRow() for headers so cells exist before styling; add bgColor to all fill definitions to prevent Excel repair warnings.
…/send-report-pdf-mobile)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/send-report— branded PDF (puppeteer) + Excel (exceljs) attachments via Resend; PIN-protected; acceptsmonthparam for historical reports/api/cron/monthly-report— Vercel Cron wrapper withAuthorization: Bearercheck and last-day-of-month guardtransactionstable;pruneOldTransactions()cleans anything older after each report sendsend-reportwas unprotected (added PIN header check); cron was checking wrong header (nowAuthorization: Bearer {CRON_SECRET})xlsx(no cell styling in community edition) toexceljs; header rows created explicitly so styling is applied correctly;bgColoradded to fills to prevent Excel repair dialogChecklist
npm run typecheckpasses)