Some checks are pending
Flutter CI / build (push) Waiting to run
Co-authored-by: aider (ollama_chat/7b) <aider@aider.chat>
39 lines
844 B
Dart
39 lines
844 B
Dart
class Invoice {
|
|
final int? id;
|
|
final int customerId;
|
|
final String date;
|
|
final double total;
|
|
final double tax;
|
|
final double discountTotal;
|
|
|
|
Invoice({
|
|
this.id,
|
|
required this.customerId,
|
|
required this.date,
|
|
required this.total,
|
|
required this.tax,
|
|
required this.discountTotal,
|
|
});
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'id': id,
|
|
'customer_id': customerId,
|
|
'date': date,
|
|
'total': total,
|
|
'tax': tax,
|
|
'discount_total': discountTotal,
|
|
};
|
|
}
|
|
|
|
factory Invoice.fromMap(Map<String, dynamic> map) {
|
|
return Invoice(
|
|
id: map['id'] as int?,
|
|
customerId: map['customer_id'] as int,
|
|
date: map['date'] as String,
|
|
total: map['total'] as double,
|
|
tax: map['tax'] as double,
|
|
discountTotal: map['discount_total'] as double,
|
|
);
|
|
}
|
|
}
|