// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'order_dtos.dart';

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

_$OrderDtoImpl _$$OrderDtoImplFromJson(Map<String, dynamic> json) =>
    _$OrderDtoImpl(
      id: json['id'] as String?,
      orderNumber: json['order_number'] as String?,
      outletId: json['outlet_id'] as String?,
      userId: json['user_id'] as String?,
      tableNumber: json['table_number'] as String?,
      orderType: json['order_type'] as String?,
      status: json['status'] as String?,
      subtotal: (json['subtotal'] as num?)?.toInt(),
      taxAmount: (json['tax_amount'] as num?)?.toInt(),
      discountAmount: (json['discount_amount'] as num?)?.toInt(),
      totalAmount: (json['total_amount'] as num?)?.toInt(),
      totalCost: (json['total_cost'] as num?)?.toInt(),
      remainingAmount: (json['remaining_amount'] as num?)?.toInt(),
      paymentStatus: json['payment_status'] as String?,
      refundAmount: (json['refund_amount'] as num?)?.toInt(),
      isVoid: json['is_void'] as bool?,
      isRefund: json['is_refund'] as bool?,
      notes: json['notes'] as String?,
      metadata: json['metadata'] as Map<String, dynamic>?,
      createdAt: json['created_at'] as String?,
      updatedAt: json['updated_at'] as String?,
      orderItems: (json['order_items'] as List<dynamic>?)
          ?.map((e) => OrderItemDto.fromJson(e as Map<String, dynamic>))
          .toList(),
      payments: (json['payments'] as List<dynamic>?)
          ?.map((e) => OrderPaymentDto.fromJson(e as Map<String, dynamic>))
          .toList(),
      totalPaid: (json['total_paid'] as num?)?.toInt(),
      paymentCount: (json['payment_count'] as num?)?.toInt(),
      splitType: json['split_type'] as String?,
    );

Map<String, dynamic> _$$OrderDtoImplToJson(_$OrderDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'order_number': instance.orderNumber,
      'outlet_id': instance.outletId,
      'user_id': instance.userId,
      'table_number': instance.tableNumber,
      'order_type': instance.orderType,
      'status': instance.status,
      'subtotal': instance.subtotal,
      'tax_amount': instance.taxAmount,
      'discount_amount': instance.discountAmount,
      'total_amount': instance.totalAmount,
      'total_cost': instance.totalCost,
      'remaining_amount': instance.remainingAmount,
      'payment_status': instance.paymentStatus,
      'refund_amount': instance.refundAmount,
      'is_void': instance.isVoid,
      'is_refund': instance.isRefund,
      'notes': instance.notes,
      'metadata': instance.metadata,
      'created_at': instance.createdAt,
      'updated_at': instance.updatedAt,
      'order_items': instance.orderItems,
      'payments': instance.payments,
      'total_paid': instance.totalPaid,
      'payment_count': instance.paymentCount,
      'split_type': instance.splitType,
    };

_$OrderItemDtoImpl _$$OrderItemDtoImplFromJson(Map<String, dynamic> json) =>
    _$OrderItemDtoImpl(
      id: json['id'] as String?,
      orderId: json['order_id'] as String?,
      productId: json['product_id'] as String?,
      productName: json['product_name'] as String?,
      quantity: (json['quantity'] as num?)?.toInt(),
      price: (json['price'] as num?)?.toInt(),
      subtotal: (json['subtotal'] as num?)?.toInt(),
      discountAmount: (json['discount_amount'] as num?)?.toInt(),
      total: (json['total'] as num?)?.toInt(),
      cost: (json['cost'] as num?)?.toInt(),
      metadata: json['metadata'] as Map<String, dynamic>?,
      createdAt: json['created_at'] as String?,
      updatedAt: json['updated_at'] as String?,
    );

Map<String, dynamic> _$$OrderItemDtoImplToJson(_$OrderItemDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'order_id': instance.orderId,
      'product_id': instance.productId,
      'product_name': instance.productName,
      'quantity': instance.quantity,
      'price': instance.price,
      'subtotal': instance.subtotal,
      'discount_amount': instance.discountAmount,
      'total': instance.total,
      'cost': instance.cost,
      'metadata': instance.metadata,
      'created_at': instance.createdAt,
      'updated_at': instance.updatedAt,
    };

_$OrderPaymentDtoImpl _$$OrderPaymentDtoImplFromJson(
  Map<String, dynamic> json,
) => _$OrderPaymentDtoImpl(
  id: json['id'] as String?,
  orderId: json['order_id'] as String?,
  paymentMethodId: json['payment_method_id'] as String?,
  paymentMethodName: json['payment_method_name'] as String?,
  paymentMethodType: json['payment_method_type'] as String?,
  amount: (json['amount'] as num?)?.toInt(),
  status: json['status'] as String?,
  splitNumber: (json['split_number'] as num?)?.toInt(),
  splitTotal: (json['split_total'] as num?)?.toInt(),
  splitType: json['split_type'] as String?,
  splitDescription: json['split_description'] as String?,
  refundAmount: (json['refund_amount'] as num?)?.toInt(),
  metadata: json['metadata'] as Map<String, dynamic>?,
  createdAt: json['created_at'] as String?,
  updatedAt: json['updated_at'] as String?,
  paymentOrderItems: (json['payment_order_items'] as List<dynamic>?)
      ?.map((e) => PaymentOrderItemDto.fromJson(e as Map<String, dynamic>))
      .toList(),
);

Map<String, dynamic> _$$OrderPaymentDtoImplToJson(
  _$OrderPaymentDtoImpl instance,
) => <String, dynamic>{
  'id': instance.id,
  'order_id': instance.orderId,
  'payment_method_id': instance.paymentMethodId,
  'payment_method_name': instance.paymentMethodName,
  'payment_method_type': instance.paymentMethodType,
  'amount': instance.amount,
  'status': instance.status,
  'split_number': instance.splitNumber,
  'split_total': instance.splitTotal,
  'split_type': instance.splitType,
  'split_description': instance.splitDescription,
  'refund_amount': instance.refundAmount,
  'metadata': instance.metadata,
  'created_at': instance.createdAt,
  'updated_at': instance.updatedAt,
  'payment_order_items': instance.paymentOrderItems,
};

_$PaymentOrderItemDtoImpl _$$PaymentOrderItemDtoImplFromJson(
  Map<String, dynamic> json,
) => _$PaymentOrderItemDtoImpl(
  id: json['id'] as String?,
  orderPaymentId: json['order_payment_id'] as String?,
  orderItemId: json['order_item_id'] as String?,
  amount: (json['amount'] as num?)?.toInt(),
  refundAmount: (json['refund_amount'] as num?)?.toInt(),
  createdAt: json['created_at'] as String?,
  updatedAt: json['updated_at'] as String?,
);

Map<String, dynamic> _$$PaymentOrderItemDtoImplToJson(
  _$PaymentOrderItemDtoImpl instance,
) => <String, dynamic>{
  'id': instance.id,
  'order_payment_id': instance.orderPaymentId,
  'order_item_id': instance.orderItemId,
  'amount': instance.amount,
  'refund_amount': instance.refundAmount,
  'created_at': instance.createdAt,
  'updated_at': instance.updatedAt,
};
