import 'package:huixiang/retrofit/data/exchange_order_goods.dart';

class ExchangeOrder {
  ExchangeOrder();

  String id;
  String createTime;
  String createUser;
  String updateTime;
  String updateUser;
  String storeId;
  String mid;
  String orderCode;
  String amount;
  String money;
  int payStatus;
  int sendStatus;
  String address;
  String recAddress;
  int state;
  int useTyped;
  int isDelete;
  List<ExchangeOrderGoods> creditOrderDetailList;

  factory ExchangeOrder.fromJson(Map<String, dynamic> json) => ExchangeOrder()
    ..id = json['id'] as String
    ..createTime = json['createTime'] as String
    ..createUser = json['createUser'] as String
    ..updateTime = json['updateTime'] as String
    ..updateUser = json['updateUser'] as String
    ..storeId = json['storeId'] as String
    ..mid = json['mid'] as String
    ..orderCode = json['orderCode'] as String
    ..amount = json['amount'] as String
    ..money = json['money'] as String
    ..payStatus = json['payStatus'] as int
    ..sendStatus = json['sendStatus'] as int
    ..address = json['address'] as String
    ..recAddress = json['recAddress'] as String
    ..state = json['state'] as int
    ..useTyped = json['useTyped'] as int
    ..isDelete = json['isDelete'] as int
    ..creditOrderDetailList = (json['creditOrderDetailList'] as List)
        ?.map((e) => e == null
            ? null
            : ExchangeOrderGoods.fromJson(e as Map<String, dynamic>))
        ?.toList();

  Map<String, dynamic> toJson() => <String, dynamic>{
        'id': this.id,
        'createTime': this.createTime,
        'createUser': this.createUser,
        'updateTime': this.updateTime,
        'updateUser': this.updateUser,
        'storeId': this.storeId,
        'mid': this.mid,
        'orderCode': this.orderCode,
        'amount': this.amount,
        'money': this.money,
        'payStatus': this.payStatus,
        'sendStatus': this.sendStatus,
        'address': this.address,
        'recAddress': this.recAddress,
        'state': this.state,
        'useTyped': this.useTyped,
        'isDelete': this.isDelete,
        'creditOrderDetailList': this.creditOrderDetailList.map((e) => e.toJson()).toList(),
      };
}