Invoice.fromMap constructor
Implementation
factory Invoice.fromMap(Map<String, dynamic> map) {
return Invoice(
$id: map['\$id'].toString(),
$createdAt: map['\$createdAt'].toString(),
$updatedAt: map['\$updatedAt'].toString(),
$permissions: List.from(map['\$permissions'] ?? []),
teamId: map['teamId'].toString(),
aggregationId: map['aggregationId'].toString(),
plan: map['plan'].toString(),
usage: List<UsageResources>.from(
map['usage'].map((p) => UsageResources.fromMap(p))),
amount: map['amount'].toDouble(),
tax: map['tax'].toDouble(),
taxAmount: map['taxAmount'].toDouble(),
vat: map['vat'].toDouble(),
vatAmount: map['vatAmount'].toDouble(),
grossAmount: map['grossAmount'].toDouble(),
creditsUsed: map['creditsUsed'].toDouble(),
currency: map['currency'].toString(),
clientSecret: map['clientSecret'].toString(),
status: map['status'].toString(),
lastError: map['lastError'].toString(),
dueAt: map['dueAt'].toString(),
from: map['from'].toString(),
to: map['to'].toString(),
);
}