Eliminar creche_app/lib/models/attendance.dart
This commit is contained in:
parent
d5fc25db2d
commit
f117f6ce88
|
|
@ -1,42 +0,0 @@
|
||||||
class Attendance {
|
|
||||||
final String id;
|
|
||||||
final String childId;
|
|
||||||
final DateTime date;
|
|
||||||
final String? status; // present | absent | late
|
|
||||||
final String? timeIn;
|
|
||||||
final String? timeOut;
|
|
||||||
final String? notes;
|
|
||||||
|
|
||||||
Attendance({
|
|
||||||
required this.id,
|
|
||||||
required this.childId,
|
|
||||||
required this.date,
|
|
||||||
this.status,
|
|
||||||
this.timeIn,
|
|
||||||
this.timeOut,
|
|
||||||
this.notes,
|
|
||||||
});
|
|
||||||
|
|
||||||
factory Attendance.fromMap(Map<String, dynamic> map) {
|
|
||||||
return Attendance(
|
|
||||||
id: map['id'] ?? '',
|
|
||||||
childId: map['child_id'] ?? '',
|
|
||||||
date: DateTime.tryParse(map['date'] ?? '') ?? DateTime.now(),
|
|
||||||
status: map['status'],
|
|
||||||
timeIn: map['time_in'],
|
|
||||||
timeOut: map['time_out'],
|
|
||||||
notes: map['notes'],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
|
||||||
return {
|
|
||||||
'child_id': childId,
|
|
||||||
'date': date.toIso8601String().split('T')[0],
|
|
||||||
'status': status,
|
|
||||||
'time_in': timeIn,
|
|
||||||
'time_out': timeOut,
|
|
||||||
'notes': notes,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue