- Framework: Flutter web - Pages: Login, inscription, dashboards - Services: API client, authentification, gestion d'état - Intégration avec backend NestJS - Dockerfile pour déploiement web
51 lines
1.3 KiB
Dart
51 lines
1.3 KiB
Dart
class AssistantModel {
|
|
final String id;
|
|
final String firstName;
|
|
final String lastName;
|
|
final String? photoUrl;
|
|
final double hourlyRate;
|
|
final double dailyFees;
|
|
final AssistantStatus status;
|
|
final String? address;
|
|
final String? phone;
|
|
final String? email;
|
|
|
|
AssistantModel({
|
|
required this.id,
|
|
required this.firstName,
|
|
required this.lastName,
|
|
this.photoUrl,
|
|
required this.hourlyRate,
|
|
required this.dailyFees,
|
|
required this.status,
|
|
this.address,
|
|
this.phone,
|
|
this.email,
|
|
});
|
|
|
|
factory AssistantModel.fromJson(Map<String, dynamic> json) {
|
|
return AssistantModel(
|
|
id: json['id'],
|
|
firstName: json['firstName'],
|
|
lastName: json['lastName'],
|
|
photoUrl: json['photoUrl'],
|
|
hourlyRate: json['hourlyRate'].toDouble(),
|
|
dailyFees: json['dailyFees'].toDouble(),
|
|
status: AssistantStatus.values.byName(json['status']),
|
|
address: json['address'],
|
|
phone: json['phone'],
|
|
email: json['email'],
|
|
);
|
|
}
|
|
|
|
String get fullName => '$firstName $lastName';
|
|
String get hourlyRateFormatted => '${hourlyRate.toStringAsFixed(2)} €/h';
|
|
String get dailyFeesFormatted => '${dailyFees.toStringAsFixed(2)} €/jour';
|
|
}
|
|
|
|
enum AssistantStatus {
|
|
available,
|
|
busy,
|
|
onHoliday,
|
|
unavailable,
|
|
} |