class Discount {
  String id;
  String code;
  String customerId;
  String customerName;
  String status;
  double amount;

  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'],
    );
  }
}
