import 'dart:convert';

import 'package:flutter/cupertino.dart';

class ModelWallet {
  int idOrder;
  int idPerson;
  double cashIn;
  double cashOut;
  String dateWallet;
  int id;
  String tokenReceipt;

  ModelWallet(
      {this.idOrder,
        this.idPerson,
        this.cashIn,
        this.cashOut,
        this.dateWallet,
        this.id,
        this.tokenReceipt});

  ModelWallet.fromJson(Map<String, dynamic> json) {
    idOrder = json['id_order'];
    idPerson = json['id_person'];
    cashIn = double.tryParse(json['cash_in'].toString());
    cashOut = double.tryParse(json['cash_out'].toString());
    dateWallet = json['date_wallet'];
    id = json['id'];
    tokenReceipt = json['token_receipt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id_order'] = this.idOrder;
    data['id_person'] = this.idPerson;
    data['cash_in'] = this.cashIn;
    data['cash_out'] = this.cashOut;
    data['date_wallet'] = this.dateWallet;
    data['id'] = this.id;
    data['token_receipt'] = this.tokenReceipt;
    return data;
  }
}