Map<String, dynamic> toJson() { switch (type) { case BillType.bill: return (this as BillDto).toJson(); case BillType.billScan: return (this as BillScanDto).toJson(); } }