feat: Intégration du backend NestJS depuis YNOV
- Framework: NestJS avec TypeORM - Authentification: JWT (access + refresh tokens) - Gestion utilisateurs: CRUD complet avec validation - Routes: auth, users, parents, assistantes maternelles - Dockerfile pour conteneurisation
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
import {
|
||||
Entity, PrimaryGeneratedColumn, Column,
|
||||
ManyToOne, OneToMany, CreateDateColumn, UpdateDateColumn, JoinColumn
|
||||
} from 'typeorm';
|
||||
import { Parents } from './parents.entity';
|
||||
import { Children } from './children.entity';
|
||||
import { Message } from './messages.entity';
|
||||
|
||||
export enum StatutDossierType {
|
||||
ENVOYE = 'envoye',
|
||||
ACCEPTE = 'accepte',
|
||||
REFUSE = 'refuse',
|
||||
CLOTURE = 'cloture',
|
||||
}
|
||||
|
||||
@Entity('dossiers')
|
||||
export class Dossier {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => Parents, p => p.dossiers, { onDelete: 'CASCADE', nullable: false })
|
||||
@JoinColumn({ name: 'id_parent', referencedColumnName: 'user_id' })
|
||||
parent: Parents;
|
||||
|
||||
@ManyToOne(() => Children, c => c.dossiers, { onDelete: 'CASCADE', nullable: false })
|
||||
@JoinColumn({ name: 'id_enfant', referencedColumnName: 'id' })
|
||||
child: Children;
|
||||
|
||||
@Column({ type: 'text', nullable: true, name: 'presentation' })
|
||||
presentation?: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 50, nullable: true, name: 'type_contrat' })
|
||||
type_contrat?: string;
|
||||
|
||||
@Column({ type: 'boolean', default: false, name: 'repas' })
|
||||
meals: boolean;
|
||||
|
||||
@Column({ type: 'numeric', precision: 10, scale: 2, nullable: true, name: 'budget' })
|
||||
budget?: number;
|
||||
|
||||
@Column({ type: 'jsonb', nullable: true, name: 'planning_souhaite' })
|
||||
desired_schedule?: any;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: StatutDossierType,
|
||||
enumName: 'statut_dossier_type',
|
||||
default: StatutDossierType.ENVOYE,
|
||||
name: 'statut'
|
||||
})
|
||||
status: StatutDossierType;
|
||||
|
||||
@CreateDateColumn({ name: 'cree_le', type: 'timestamptz' })
|
||||
created_at: Date;
|
||||
|
||||
@UpdateDateColumn({ name: 'modifie_le', type: 'timestamptz' })
|
||||
updated_at: Date;
|
||||
|
||||
@OneToMany(() => Message, m => m.dossier)
|
||||
messages: Message[];
|
||||
}
|
||||
Reference in New Issue
Block a user