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,74 @@
|
||||
import {
|
||||
Entity, PrimaryGeneratedColumn, Column,
|
||||
OneToMany, ManyToMany, CreateDateColumn, JoinTable
|
||||
} from 'typeorm';
|
||||
import { Parents } from './parents.entity';
|
||||
import { ParentsChildren } from './parents_children.entity';
|
||||
import { Dossier } from './dossiers.entity';
|
||||
|
||||
export enum StatutEnfantType {
|
||||
A_NAITRE = 'a_naitre',
|
||||
ACTIF = 'actif',
|
||||
SCOLARISE = 'scolarise',
|
||||
}
|
||||
|
||||
export enum GenreType {
|
||||
H = 'H',
|
||||
F = 'F',
|
||||
AUTRE = 'Autre',
|
||||
}
|
||||
|
||||
@Entity('enfants')
|
||||
export class Children {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: StatutEnfantType,
|
||||
enumName: 'statut_enfant_type',
|
||||
name: 'statut'
|
||||
})
|
||||
status: StatutEnfantType;
|
||||
|
||||
@Column({ name: 'prenom', length: 100, nullable: true })
|
||||
first_name?: string;
|
||||
|
||||
@Column({ name: 'nom', length: 100, nullable: true })
|
||||
last_name?: string;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: GenreType,
|
||||
enumName: 'genre_type',
|
||||
nullable: true,
|
||||
name: 'genre'
|
||||
})
|
||||
gender?: GenreType;
|
||||
|
||||
@Column({ type: 'date', nullable: true, name: 'date_naissance' })
|
||||
birth_date?: Date;
|
||||
|
||||
@Column({ type: 'date', nullable: true, name: 'date_prevue_naissance' })
|
||||
due_date?: Date;
|
||||
|
||||
@Column({ nullable: true, name: 'photo_url', type: 'text' })
|
||||
photo_url?: string;
|
||||
|
||||
@Column({ default: false, name: 'consentement_photo', type: 'boolean' })
|
||||
consent_photo: boolean;
|
||||
|
||||
@Column({ type: 'timestamptz', nullable: true, name: 'date_consentement_photo' })
|
||||
consent_photo_at?: Date;
|
||||
|
||||
@Column({ default: false, name: 'est_multiple', type: 'boolean' })
|
||||
is_multiple: boolean;
|
||||
|
||||
// Lien via table de jointure enfants_parents
|
||||
@OneToMany(() => ParentsChildren, pc => pc.child)
|
||||
parentLinks: ParentsChildren[];
|
||||
|
||||
// Relation avec Dossier
|
||||
@OneToMany(() => Dossier, d => d.child)
|
||||
dossiers: Dossier[];
|
||||
}
|
||||
Reference in New Issue
Block a user