// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'checkout_model.dart';

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

OnlineOrderRequest _$OnlineOrderRequestFromJson(
  Map<String, dynamic> json,
) => OnlineOrderRequest(
  outletId: json['outlet_id'] as String,
  outletNameSnapshot: json['outlet_name_snapshot'] as String,
  outletPhoneNumberSnapshot: json['outlet_phone_number_snapshot'] as String?,
  outletAddressSnapshot: json['outlet_address_snapshot'] == null
      ? null
      : OutletAddressSnapshotRequest.fromJson(
          json['outlet_address_snapshot'] as Map<String, dynamic>,
        ),
  customerId: json['customer_id'] as String,
  customerNameSnapshot: json['customer_name_snapshot'] as String,
  customerEmailSnapshot: json['customer_email_snapshot'] as String?,
  customerPhoneNumberSnapshot: json['customer_phone_number_snapshot'] as String,
  customerAddressSnapshot: json['customer_address_snapshot'] == null
      ? null
      : CustomerAddressSnapshotRequest.fromJson(
          json['customer_address_snapshot'] as Map<String, dynamic>,
        ),
  orderStatus: json['order_status'] as String,
  deliveryType: json['delivery_type'] as String,
  deliveryPreference: json['delivery_preference'] as String,
  deliveryFeeType: json['delivery_fee_type'] as String?,
  deliveryFee: (json['delivery_fee'] as num).toDouble(),
  totalDeliveryFee: (json['total_delivery_fee'] as num).toDouble(),
  totalOrder: (json['total_order'] as num).toDouble(),
  totalAmount: (json['total_amount'] as num).toDouble(),
  notes: json['notes'] as String?,
  paymentMethod: json['payment_method'] as String,
  items: (json['items'] as List<dynamic>)
      .map((e) => OnlineOrderItemRequest.fromJson(e as Map<String, dynamic>))
      .toList(),
);

Map<String, dynamic> _$OnlineOrderRequestToJson(OnlineOrderRequest instance) =>
    <String, dynamic>{
      'outlet_id': instance.outletId,
      'outlet_name_snapshot': instance.outletNameSnapshot,
      'outlet_phone_number_snapshot': instance.outletPhoneNumberSnapshot,
      'outlet_address_snapshot': instance.outletAddressSnapshot,
      'customer_id': instance.customerId,
      'customer_name_snapshot': instance.customerNameSnapshot,
      'customer_email_snapshot': instance.customerEmailSnapshot,
      'customer_phone_number_snapshot': instance.customerPhoneNumberSnapshot,
      'customer_address_snapshot': instance.customerAddressSnapshot,
      'order_status': instance.orderStatus,
      'delivery_type': instance.deliveryType,
      'delivery_preference': instance.deliveryPreference,
      'delivery_fee_type': instance.deliveryFeeType,
      'delivery_fee': instance.deliveryFee,
      'total_delivery_fee': instance.totalDeliveryFee,
      'total_order': instance.totalOrder,
      'total_amount': instance.totalAmount,
      'notes': instance.notes,
      'payment_method': instance.paymentMethod,
      'items': instance.items,
    };

OutletAddressSnapshotRequest _$OutletAddressSnapshotRequestFromJson(
  Map<String, dynamic> json,
) => OutletAddressSnapshotRequest(
  fullAddress: json['full_address'] as String,
  latitude: (json['latitude'] as num).toDouble(),
  longitude: (json['longitude'] as num).toDouble(),
);

Map<String, dynamic> _$OutletAddressSnapshotRequestToJson(
  OutletAddressSnapshotRequest instance,
) => <String, dynamic>{
  'full_address': instance.fullAddress,
  'latitude': instance.latitude,
  'longitude': instance.longitude,
};

CustomerAddressSnapshotRequest _$CustomerAddressSnapshotRequestFromJson(
  Map<String, dynamic> json,
) => CustomerAddressSnapshotRequest(
  label: json['label'] as String,
  fullAddress: json['full_address'] as String,
  latitude: (json['latitude'] as num).toDouble(),
  longitude: (json['longitude'] as num).toDouble(),
);

Map<String, dynamic> _$CustomerAddressSnapshotRequestToJson(
  CustomerAddressSnapshotRequest instance,
) => <String, dynamic>{
  'label': instance.label,
  'full_address': instance.fullAddress,
  'latitude': instance.latitude,
  'longitude': instance.longitude,
};

OnlineOrderItemRequest _$OnlineOrderItemRequestFromJson(
  Map<String, dynamic> json,
) => OnlineOrderItemRequest(
  productVariantId: json['product_variant_id'] as String,
  quantity: (json['quantity'] as num).toInt(),
  productImageUrlSnapshot: json['product_image_url_snapshot'] as String?,
  productNameSnapshot: json['product_name_snapshot'] as String,
  productVariantNameSnapshot: json['product_variant_name_snapshot'] as String?,
  sellingPriceSnapshot: toDouble(json['selling_price_snapshot']),
  subtotal: toDouble(json['subtotal']),
);

Map<String, dynamic> _$OnlineOrderItemRequestToJson(
  OnlineOrderItemRequest instance,
) => <String, dynamic>{
  'product_variant_id': instance.productVariantId,
  'quantity': instance.quantity,
  'product_image_url_snapshot': instance.productImageUrlSnapshot,
  'product_name_snapshot': instance.productNameSnapshot,
  'product_variant_name_snapshot': instance.productVariantNameSnapshot,
  'selling_price_snapshot': instance.sellingPriceSnapshot,
  'subtotal': instance.subtotal,
};

CheckoutResponse _$CheckoutResponseFromJson(Map<String, dynamic> json) =>
    CheckoutResponse(
      orderId: json['order_id'] as String,
      orderNumber: json['order_number'] as String,
    );

Map<String, dynamic> _$CheckoutResponseToJson(CheckoutResponse instance) =>
    <String, dynamic>{
      'order_id': instance.orderId,
      'order_number': instance.orderNumber,
    };
