(Feat) Migration PocketBase
This commit is contained in:
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user