- API PATCH …/fiche, POST/DELETE …/enfants/:enfantId, GET avec amChildren - Table enfants_assistantes_maternelles (option D, 1 garde active/enfant) - Statuts enfant: garde/sans_garde remplacent actif (inscription → sans_garde) - BDD.sql canonique réécrit; migration pour BDD existantes - Seed test: hash bcrypt corrigé pour mot de passe « password » Co-authored-by: Cursor <cursoragent@cursor.com>
98 lines
1.9 KiB
TypeScript
98 lines
1.9 KiB
TypeScript
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
import {
|
|
IsBoolean,
|
|
IsEmail,
|
|
IsEnum,
|
|
IsInt,
|
|
IsOptional,
|
|
IsString,
|
|
Max,
|
|
MaxLength,
|
|
Min,
|
|
} from 'class-validator';
|
|
import { StatutUtilisateurType } from 'src/entities/users.entity';
|
|
|
|
/** Mise à jour fiche AM par admin/gestionnaire (doc 28 §6.1, ticket #131). */
|
|
export class UpdateAmFicheAdminDto {
|
|
@ApiPropertyOptional({ example: 'MARTIN' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(100)
|
|
nom?: string;
|
|
|
|
@ApiPropertyOptional({ example: 'Claire' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(100)
|
|
prenom?: string;
|
|
|
|
@ApiPropertyOptional({ example: 'claire@example.com' })
|
|
@IsOptional()
|
|
@IsEmail()
|
|
email?: string;
|
|
|
|
@ApiPropertyOptional({ example: '0612345678' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(20)
|
|
telephone?: string;
|
|
|
|
@ApiPropertyOptional({ example: '5 place Bellecour' })
|
|
@IsOptional()
|
|
@IsString()
|
|
adresse?: string;
|
|
|
|
@ApiPropertyOptional({ example: 'Lyon' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(150)
|
|
ville?: string;
|
|
|
|
@ApiPropertyOptional({ example: '69002' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(10)
|
|
code_postal?: string;
|
|
|
|
@ApiPropertyOptional({ enum: StatutUtilisateurType })
|
|
@IsOptional()
|
|
@IsEnum(StatutUtilisateurType)
|
|
statut?: StatutUtilisateurType;
|
|
|
|
@ApiPropertyOptional({ example: 'AGR-2024-12345' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(50)
|
|
approval_number?: string;
|
|
|
|
@ApiPropertyOptional({ example: 'Lyon' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(100)
|
|
residence_city?: string;
|
|
|
|
@ApiPropertyOptional({ example: 4 })
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(10)
|
|
max_children?: number;
|
|
|
|
@ApiPropertyOptional({ example: 2 })
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(0)
|
|
@Max(10)
|
|
places_available?: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
biography?: string;
|
|
|
|
@ApiPropertyOptional({ example: true })
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
available?: boolean;
|
|
}
|