(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
+1 -1
View File
@@ -1,7 +1,7 @@
/// Un client fidélité. Le [code] est ce qui est encodé dans son QR code :
/// scanner le QR permet de retrouver le compte.
class Client {
final String id; // uuid Supabase
final String id; // id PocketBase
/// Code unique du compte (encodé dans le QR), ex : « FID-3F9K2A ».
final String code;
+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),
);
}