feat(#275): documents-Modul mit Controller, Service, DTOs #311

Merged
admin-mrrm merged 1 commit from feat/275-documents-module into main 2026-05-16 15:16:50 +02:00
Owner

Summary

NestJS-Modul, das den PaperlessClient (#274) hinter REST-Endpoints freigibt und damit den API-Foundation-Block der Paperless-Integration abschließt.

Endpoints (/documents):

  • GET /documents — Liste mit Zod-validierter Query (query, tags als CSV, correspondent, documentType, page, pageSize, ordering)
  • GET /documents/tags · /correspondents · /document-types
  • GET /documents/:id — Details (ParseIntPipe)
  • GET /documents/:id/preview und /thumbnail — Stream via StreamableFile (Readable.fromWeb)
  • POST /documents — multipart Upload (FileInterceptor('document')) mit Zod-validierter Meta (Title, Tags, Correspondent, …)

Bausteine:

  • documents.service.ts — dünner Delegator vor PaperlessClient
  • documents.dto.ts — Zod-Schemas inkl. csvNumbers-Transform für tags=1,2,3
  • documents.module.ts registriert beim AppModule
  • ZodValidationPipe generisch auf ZodTypeAny umgestellt, damit Schemas mit .transform() (Output ≠ Input) korrekt typisieren

Tests: 28 grün (Service 4, Controller 7, PaperlessClient 17).

Test plan

  • CI grün (lint, typecheck, test)
  • Smoketest gegen Paperless-Dev (/documents, /documents/:id/preview, Upload) nach Deploy
## Summary NestJS-Modul, das den `PaperlessClient` (#274) hinter REST-Endpoints freigibt und damit den API-Foundation-Block der Paperless-Integration abschließt. **Endpoints (`/documents`):** - `GET /documents` — Liste mit Zod-validierter Query (`query`, `tags` als CSV, `correspondent`, `documentType`, `page`, `pageSize`, `ordering`) - `GET /documents/tags` · `/correspondents` · `/document-types` - `GET /documents/:id` — Details (`ParseIntPipe`) - `GET /documents/:id/preview` und `/thumbnail` — Stream via `StreamableFile` (`Readable.fromWeb`) - `POST /documents` — multipart Upload (`FileInterceptor('document')`) mit Zod-validierter Meta (Title, Tags, Correspondent, …) **Bausteine:** - `documents.service.ts` — dünner Delegator vor `PaperlessClient` - `documents.dto.ts` — Zod-Schemas inkl. `csvNumbers`-Transform für `tags=1,2,3` - `documents.module.ts` registriert beim `AppModule` - `ZodValidationPipe` generisch auf `ZodTypeAny` umgestellt, damit Schemas mit `.transform()` (Output ≠ Input) korrekt typisieren **Tests:** 28 grün (Service 4, Controller 7, PaperlessClient 17). ## Test plan - [ ] CI grün (lint, typecheck, test) - [ ] Smoketest gegen Paperless-Dev (`/documents`, `/documents/:id/preview`, Upload) nach Deploy
feat(#275): documents-Modul mit Controller, Service, DTOs
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2f1a873274
NestJS-Modul, das den PaperlessClient hinter REST-Endpoints
verfügbar macht:

- DocumentsService: dünner Delegator vor PaperlessClient
- DocumentsController:
  - GET /documents (Zod-validierte Query, csvNumbers für tags)
  - GET /documents/tags|correspondents|document-types
  - GET /documents/:id, :id/preview, :id/thumbnail (StreamableFile)
  - POST /documents (FileInterceptor + Buffer-Upload)
- documents.dto.ts: Zod-Schemas für Query- und Meta-Validierung
- DocumentsModule in AppModule registriert
- ZodValidationPipe generisch auf ZodTypeAny umgestellt, damit
  Schemas mit .transform() (z.B. csvNumbers) funktionieren

Tests: 28 grün (service, controller, paperless.client)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
admin-mrrm/mrrmlabapp!311
No description provided.