feat: ajout du parcours complet d'inscription parent avec UI harmonisée et gestion centralisée des données
This commit is contained in:
@@ -1,73 +0,0 @@
|
||||
class Child {
|
||||
final String id;
|
||||
final String firstName;
|
||||
final String lastName;
|
||||
final DateTime? birthDate;
|
||||
final DateTime? expectedBirthDate;
|
||||
final String? photoUrl;
|
||||
final bool hasPhotoConsent;
|
||||
final DateTime? photoConsentDate;
|
||||
final String status; // 'unborn', 'active', 'schooled'
|
||||
final List<String> parentIds;
|
||||
final bool isMultipleBirth; // true pour jumeaux, triplés, etc.
|
||||
final DateTime createdAt;
|
||||
final DateTime updatedAt;
|
||||
|
||||
Child({
|
||||
required this.id,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
this.birthDate,
|
||||
this.expectedBirthDate,
|
||||
this.photoUrl,
|
||||
required this.hasPhotoConsent,
|
||||
this.photoConsentDate,
|
||||
required this.status,
|
||||
required this.parentIds,
|
||||
required this.isMultipleBirth,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
});
|
||||
|
||||
factory Child.fromJson(Map<String, dynamic> json) {
|
||||
return Child(
|
||||
id: json['id'],
|
||||
firstName: json['firstName'],
|
||||
lastName: json['lastName'],
|
||||
birthDate: json['birthDate'] != null
|
||||
? DateTime.parse(json['birthDate'])
|
||||
: null,
|
||||
expectedBirthDate: json['expectedBirthDate'] != null
|
||||
? DateTime.parse(json['expectedBirthDate'])
|
||||
: null,
|
||||
photoUrl: json['photoUrl'],
|
||||
hasPhotoConsent: json['hasPhotoConsent'] ?? false,
|
||||
photoConsentDate: json['photoConsentDate'] != null
|
||||
? DateTime.parse(json['photoConsentDate'])
|
||||
: null,
|
||||
status: json['status'] ?? 'unborn',
|
||||
parentIds: List<String>.from(json['parentIds'] ?? []),
|
||||
isMultipleBirth: json['isMultipleBirth'] ?? false,
|
||||
createdAt: DateTime.parse(json['createdAt']),
|
||||
updatedAt: DateTime.parse(json['updatedAt']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'firstName': firstName,
|
||||
'lastName': lastName,
|
||||
'birthDate': birthDate?.toIso8601String(),
|
||||
'expectedBirthDate': expectedBirthDate?.toIso8601String(),
|
||||
'photoUrl': photoUrl,
|
||||
'hasPhotoConsent': hasPhotoConsent,
|
||||
'photoConsentDate': photoConsentDate?.toIso8601String(),
|
||||
'status': status,
|
||||
'parentIds': parentIds,
|
||||
'isMultipleBirth': isMultipleBirth,
|
||||
'createdAt': createdAt.toIso8601String(),
|
||||
'updatedAt': updatedAt.toIso8601String(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
class Parent {
|
||||
final String id;
|
||||
final String userId;
|
||||
final String firstName;
|
||||
final String lastName;
|
||||
final String email;
|
||||
final String phoneNumber;
|
||||
final String address;
|
||||
final String city;
|
||||
final String postalCode;
|
||||
final List<String> childrenIds;
|
||||
final DateTime createdAt;
|
||||
final DateTime updatedAt;
|
||||
|
||||
Parent({
|
||||
required this.id,
|
||||
required this.userId,
|
||||
required this.firstName,
|
||||
required this.lastName,
|
||||
required this.email,
|
||||
required this.phoneNumber,
|
||||
required this.address,
|
||||
required this.city,
|
||||
required this.postalCode,
|
||||
required this.childrenIds,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
});
|
||||
|
||||
factory Parent.fromJson(Map<String, dynamic> json) {
|
||||
return Parent(
|
||||
id: json['id'],
|
||||
userId: json['userId'],
|
||||
firstName: json['firstName'],
|
||||
lastName: json['lastName'],
|
||||
email: json['email'],
|
||||
phoneNumber: json['phoneNumber'],
|
||||
address: json['address'],
|
||||
city: json['city'],
|
||||
postalCode: json['postalCode'],
|
||||
childrenIds: List<String>.from(json['childrenIds']),
|
||||
createdAt: DateTime.parse(json['createdAt']),
|
||||
updatedAt: DateTime.parse(json['updatedAt']),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'userId': userId,
|
||||
'firstName': firstName,
|
||||
'lastName': lastName,
|
||||
'email': email,
|
||||
'phoneNumber': phoneNumber,
|
||||
'address': address,
|
||||
'city': city,
|
||||
'postalCode': postalCode,
|
||||
'childrenIds': childrenIds,
|
||||
'createdAt': createdAt.toIso8601String(),
|
||||
'updatedAt': updatedAt.toIso8601String(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user