- Création entité DocumentLegal - Création entité AcceptationDocument - Création DocumentsLegauxService avec méthodes: * getDocumentsActifs() * uploadNouvelleVersion() (avec hash SHA-256) * activerVersion() (transaction) * listerVersions() * telechargerDocument() * verifierIntegrite() * enregistrerAcceptation() * getAcceptationsUtilisateur() - Création DocumentsLegauxModule - Intégration dans AppModule - Ajout dépendances multer + @types/multer Réf: docs/22_DOCUMENTS-LEGAUX.md
45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
ManyToOne,
|
|
JoinColumn,
|
|
CreateDateColumn,
|
|
} from 'typeorm';
|
|
import { Users } from './users.entity';
|
|
|
|
@Entity('documents_legaux')
|
|
export class DocumentLegal {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ type: 'varchar', length: 50, nullable: false })
|
|
type: 'cgu' | 'privacy';
|
|
|
|
@Column({ type: 'integer', nullable: false })
|
|
version: number;
|
|
|
|
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
fichier_nom: string;
|
|
|
|
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
fichier_path: string;
|
|
|
|
@Column({ type: 'varchar', length: 64, nullable: false })
|
|
fichier_hash: string;
|
|
|
|
@Column({ type: 'boolean', default: false })
|
|
actif: boolean;
|
|
|
|
@ManyToOne(() => Users, { nullable: true })
|
|
@JoinColumn({ name: 'televerse_par' })
|
|
televersePar: Users | null;
|
|
|
|
@CreateDateColumn({ name: 'televerse_le', type: 'timestamptz' })
|
|
televerseLe: Date;
|
|
|
|
@Column({ name: 'active_le', type: 'timestamptz', nullable: true })
|
|
activeLe: Date | null;
|
|
}
|
|
|