Commit Graph

11 Commits

Author SHA1 Message Date
hwinkel c3e7a97c8a fix: update login rate limit to allow 15 attempts within 3 minutes
Build and Push Docker Image / build (push) Successful in 1m30s
2026-05-02 21:44:12 +02:00
hwinkel fab53fc76e feat: add receipt upload functionality for Einnahmen and Beleg routes
Build and Push Docker Image / build (push) Successful in 1m34s
- Implemented upload and retrieval of receipts (Belege) associated with Einnahmen entries.
- Added new API routes for uploading and deleting receipts.
- Updated the Einnahmen model to include a `belegUrl` field for storing receipt references.
- Enhanced the Einnahmen page to support file uploads and display existing receipts.
- Introduced drag-and-drop functionality for file uploads and improved user feedback during uploads.
- Added necessary validation for file types and sizes during uploads.
2026-04-29 20:49:57 +02:00
hwinkel f10a79471e Refactor: centralize Zod schemas and fully integrate into API routes
Improvements #1-3 deepening:

1. Server-side invoice amount validation
   - All amounts (qty × unitPrice) recalculated server-side using tax.ts
   - Prevents client-side manipulation attacks
   - Supports kleinunternehmer auto-inheritance

2. Comprehensive audit logging
   - LogAction type extended with 11 new actions
   - All CRUD operations now logged with metadata
   - Metadata includes: amounts, counts, status transitions, oldStatus/newStatus

3. Advanced Zod validation (centralized)
   - New file: app/lib/schemas.ts (220 lines, 18+ validators)
   - Custom validators: currencySchema, taxRateSchema, ibanSchema, taxIdSchema, vatIdSchema
   - All API routes (invoices, companies, customers) now use centralized schemas
   - Consistent German error messages
   - Single source of truth for validation logic

Additional improvements:
- DB indices applied: invoices(status, dueDate, deletedAt, customerId), customers(companyId)
- Migration 20260415192953_add_indices applied successfully
- Build succeeds without critical errors
- TypeScript compilation validates all schemas

Files modified:
- app/lib/schemas.ts (NEW)
- app/routes/api.invoices.ts (uses centralized schemas)
- app/routes/api.invoices.$id.ts (status transition validation)
- app/routes/api.companies.ts, api.companies.$id.ts
- app/routes/api.customers.ts, api.customers.$id.ts
- app/lib/logger.server.ts (metadata support)
- prisma/schema.prisma (indices)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-15 21:34:38 +02:00
hwinkel 9e7c85c2b3 feat: add Einnahmen Kategorien management page with CRUD functionality
- Implemented a new route for managing Einnahmen Kategorien.
- Added auto-seeding of default Einnahmen Kategorien if none exist.
- Integrated category usage tracking to prevent deletion of in-use categories.
- Enhanced Einnahmen page to link to the new Kategorien management.
- Updated Prisma schema and seed script to include default categories.
- Added a modal for detailed view of Einnahmen by category and month.
- Refactored existing Einnahmen page to accommodate new category structure.
- Introduced PostCSS configuration for Tailwind CSS support.
- Created a new migration to update existing category labels in the database.
- Added TypeScript configuration for stricter type checking.
- Set up Vite configuration for improved development experience with React Router.
2026-03-24 22:43:09 +01:00
hwinkel 6d8c4b615f ADD: added einnahmen, ausgaben and bilanz 2026-03-24 14:48:32 +01:00
hwinkel c6dc22c859 ADD: fixed e rechnung 2026-03-15 20:58:24 +01:00
hwinkel 40a2764dd0 ADD: added some quiality of life features 2026-03-15 19:53:11 +01:00
hwinkel f5b259cae2 ADD: prisma fix 2026-03-13 14:20:07 +01:00
hwinkel 3a2a94ec19 ADD: added admin panel and archiv mandates 2026-03-13 10:58:44 +01:00
hwinkel b8e981eaf3 ADD: adden rechnungne ohne ust id und logout button 2026-03-11 23:23:24 +01:00
hwinkel 4bc57b2c4e ADD: changed to rect router 2026-03-10 21:49:01 +01:00