// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'box_order.model.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

BoxOrder _$BoxOrderFromJson(Map<String, dynamic> json) {
  return BoxOrder()
    ..id = json['id'] as int
    ..box_id = json['box_id'] as int
    ..payment_id = json['payment_id'] as int
    ..user_id = json['user_id'] as int
    ..invoice_id = json['invoice_id'] as int
    ..subtotal = double.parse(json["subtotal"].toString())
    ..vat = double.parse(json["vat"].toString())
    ..total = double.parse(json["total"].toString())
    ..created_at = json['created_at'] == null
        ? null
        : DateTime.parse(json['created_at'] as String)
    ..updated_at = json['updated_at'] == null
        ? null
        : DateTime.parse(json['updated_at'] as String)
    ..discount = json['discount'] == null
        ? null
        : Discount.fromJson(json['discount'] as Map<String, dynamic>)
    ..lines = (json['lines'] as List)
        ?.map((e) =>
            e == null ? null : BoxOrderLine.fromJson(e as Map<String, dynamic>))
        ?.toList()
    ..invoice = json['invoice'] == null
        ? null
        : Invoice.fromJson(json['invoice'] as Map<String, dynamic>)
    ..payment = json['payment'] == null
        ? null
        : Payment.fromJson(json['payment'] as Map<String, dynamic>);
}

Map<String, dynamic> _$BoxOrderToJson(BoxOrder instance) => <String, dynamic>{
      'id': instance.id,
      'box_id': instance.box_id,
      'payment_id': instance.payment_id,
      'user_id': instance.user_id,
      'invoice_id': instance.invoice_id,
      'subtotal': instance.subtotal,
      'vat': instance.vat,
      'total': instance.total,
      'created_at': instance.created_at?.toIso8601String(),
      'updated_at': instance.updated_at?.toIso8601String(),
      'discount': instance.discount,
      'lines': instance.lines,
      'invoice': instance.invoice,
      'payment': instance.payment,
    };
