Files
fcs/lib/domain/entities/discount.dart

39 lines
715 B
Dart
Raw Normal View History

2020-06-26 16:04:40 +06:30
class Discount {
2020-10-15 10:53:41 +06:30
String id;
2020-06-26 16:04:40 +06:30
String code;
2020-10-15 10:53:41 +06:30
String customerId;
String customerName;
2020-06-26 16:04:40 +06:30
String status;
double amount;
2020-10-15 10:53:41 +06:30
Discount({
this.id,
this.code,
this.customerId,
this.customerName,
this.amount,
this.status,
});
Map<String, dynamic> toMap() {
return {
'id': id,
'code': code,
"customer_id": customerId,
"customer_name": customerName,
"amount": amount,
};
}
factory Discount.fromMap(Map<String, dynamic> map, String id) {
return Discount(
id: id,
code: map['code'],
customerId: map['customer_id'],
customerName: map['customer_name'],
amount: map['amount'],
status: map['status'],
);
}
2020-06-26 16:04:40 +06:30
}