(Feat) Migration PocketBase

This commit is contained in:
2026-07-18 11:51:32 +02:00
parent 1d3ee69c6d
commit e483fd9070
15 changed files with 522 additions and 453 deletions
+5 -3
View File
@@ -41,12 +41,14 @@ class Mouvement {
factory Mouvement.fromMap(Map<String, dynamic> map) {
return Mouvement(
id: map['id'].toString(),
clientId: map['client_id'].toString(),
type: (map['type'] as String?) ?? TypeMouvement.ajustement,
clientId: (map['client'] ?? '').toString(),
type: (map['type'] as String?)?.isNotEmpty == true
? map['type'] as String
: TypeMouvement.ajustement,
montantEuros: (map['montant_euros'] as num?)?.toDouble(),
points: (map['points'] as num?)?.toDouble() ?? 0,
libelle: (map['libelle'] as String?) ?? '',
date: DateTime.tryParse(map['created_at']?.toString() ?? '')?.toLocal() ??
date: DateTime.tryParse(map['created']?.toString() ?? '')?.toLocal() ??
DateTime.fromMillisecondsSinceEpoch(0),
);
}