feat(backend): API documents légaux #31

- Création DTOs (UploadDocumentDto, DocumentsActifsResponseDto, DocumentVersionDto)
- Création DocumentsLegauxController avec 6 endpoints:
  * GET /documents-legaux/actifs (public)
  * GET /documents-legaux/:type/versions (admin)
  * POST /documents-legaux (upload, admin)
  * PATCH /documents-legaux/:id/activer (admin)
  * GET /documents-legaux/:id/download (public)
  * GET /documents-legaux/:id/verifier-integrite (admin)
- Support upload multipart/form-data avec FileInterceptor
- Validation des types (cgu/privacy)
- Stream PDF pour téléchargement
- Intégration dans DocumentsLegauxModule
- Compilation OK

TODO: Ajouter guards auth (JwtAuthGuard, RolesGuard)

Réf: docs/22_DOCUMENTS-LEGAUX.md
This commit is contained in:
2025-11-30 16:00:12 +01:00
parent 98082187b5
commit f53fd903e5
5 changed files with 239 additions and 0 deletions
@@ -3,10 +3,12 @@ import { TypeOrmModule } from '@nestjs/typeorm';
import { DocumentLegal } from '../../entities/document-legal.entity';
import { AcceptationDocument } from '../../entities/acceptation-document.entity';
import { DocumentsLegauxService } from './documents-legaux.service';
import { DocumentsLegauxController } from './documents-legaux.controller';
@Module({
imports: [TypeOrmModule.forFeature([DocumentLegal, AcceptationDocument])],
providers: [DocumentsLegauxService],
controllers: [DocumentsLegauxController],
exports: [DocumentsLegauxService],
})
export class DocumentsLegauxModule {}