From 1bb983a7d17e769c4601c930d27d2c364f26487c Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 11 Mar 2026 19:22:07 +0000 Subject: [PATCH] Eliminar creche_app/lib/models/payment.dart --- creche_app/lib/models/payment.dart | 42 ------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 creche_app/lib/models/payment.dart diff --git a/creche_app/lib/models/payment.dart b/creche_app/lib/models/payment.dart deleted file mode 100644 index b7409de..0000000 --- a/creche_app/lib/models/payment.dart +++ /dev/null @@ -1,42 +0,0 @@ -class Payment { - final String id; - final String childId; // ← adicionado - final String guardianId; - final DateTime month; - final double amount; - final String status; // pending | paid | overdue - final DateTime? paidAt; - final String? receiptUrl; - - Payment({ - required this.id, - required this.childId, - required this.guardianId, - required this.month, - required this.amount, - required this.status, - this.paidAt, - this.receiptUrl, - }); - - factory Payment.fromMap(Map map) => Payment( - id: map['id'] ?? '', - childId: map['child_id'] ?? '', - guardianId: map['guardian_id'] ?? '', - month: DateTime.tryParse(map['month'] ?? '') ?? DateTime.now(), - amount: (map['amount'] ?? 0).toDouble(), - status: map['status'] ?? 'pending', - paidAt: map['paid_at'] != null ? DateTime.tryParse(map['paid_at']) : null, - receiptUrl: map['receipt_url'], - ); - - Map toMap() => { - 'child_id': childId, - 'guardian_id': guardianId, - 'month': month.toIso8601String().split('T')[0], - 'amount': amount, - 'status': status, - 'paid_at': paidAt?.toIso8601String(), - 'receipt_url': receiptUrl, - }; -}