// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'order_model.dart';

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

OrderReportResponse _$OrderReportResponseFromJson(Map<String, dynamic> json) =>
    OrderReportResponse(
      id: json['id'] as String,
      orderNumber: json['order_number'] as String,
      productImages: (json['product_images'] as List<dynamic>)
          .map((e) => e as String?)
          .toList(),
      totalItems: (json['total_items'] as num).toInt(),
      totalAmount: toDouble(json['total_amount']),
      orderStatus: json['order_status'] as String,
      deliveryType: json['delivery_type'] as String,
      hasBeenAssessed: json['has_been_assessed'] as bool? ?? false,
      createdAt: json['created_at'] as String,
    );

Map<String, dynamic> _$OrderReportResponseToJson(
  OrderReportResponse instance,
) => <String, dynamic>{
  'id': instance.id,
  'order_number': instance.orderNumber,
  'total_items': instance.totalItems,
  'product_images': instance.productImages,
  'total_amount': instance.totalAmount,
  'order_status': instance.orderStatus,
  'delivery_type': instance.deliveryType,
  'has_been_assessed': instance.hasBeenAssessed,
  'created_at': instance.createdAt,
};

OrderInfoResponse _$OrderInfoResponseFromJson(Map<String, dynamic> json) =>
    OrderInfoResponse(
      id: json['id'] as String,
      orderNumber: json['order_number'] as String,
      createdAt: json['created_at'] as String,
      orderStatus: json['order_status'] as String,
      isCancellation: json['is_cancellation'] as bool?,
      cancellationAccepted: json['cancellation_accepted'] as bool?,
      approvalProcess: json['approval_process'] as String?,
      deliveryType: json['delivery_type'] as String,
      deliveryPreference: json['delivery_preference'] as String,
      outletNameSnapshot: json['outlet_name_snapshot'] as String,
      outletAddressSnapshot: json['outlet_address_snapshot'] == null
          ? null
          : OutletAddressSnapshotResponse.fromJson(
              json['outlet_address_snapshot'] as Map<String, dynamic>,
            ),
      customerAddressSnapshot: json['customer_address_snapshot'] == null
          ? null
          : CustomerAddressSnapshotResponse.fromJson(
              json['customer_address_snapshot'] as Map<String, dynamic>,
            ),
      orderItems: (json['order_items'] as List<dynamic>)
          .map((e) => OrderItemInfoResponse.fromJson(e as Map<String, dynamic>))
          .toList(),
      paymentMethod: json['payment_method'] as String,
      paymentProofUrl: json['payment_proof_url'] as String?,
      totalOrder: toDouble(json['total_order']),
      deliveryFeeType: json['delivery_fee_type'] as String?,
      deliveryFee: (json['delivery_fee'] as num).toDouble(),
      totalDeliveryFee: toDouble(json['total_delivery_fee']),
      totalAmount: toDouble(json['total_amount']),
    );

Map<String, dynamic> _$OrderInfoResponseToJson(OrderInfoResponse instance) =>
    <String, dynamic>{
      'id': instance.id,
      'order_number': instance.orderNumber,
      'created_at': instance.createdAt,
      'order_status': instance.orderStatus,
      'is_cancellation': instance.isCancellation,
      'cancellation_accepted': instance.cancellationAccepted,
      'approval_process': instance.approvalProcess,
      'delivery_type': instance.deliveryType,
      'delivery_preference': instance.deliveryPreference,
      'outlet_name_snapshot': instance.outletNameSnapshot,
      'outlet_address_snapshot': instance.outletAddressSnapshot,
      'customer_address_snapshot': instance.customerAddressSnapshot,
      'order_items': instance.orderItems,
      'payment_method': instance.paymentMethod,
      'payment_proof_url': instance.paymentProofUrl,
      'total_order': instance.totalOrder,
      'delivery_fee_type': instance.deliveryFeeType,
      'delivery_fee': instance.deliveryFee,
      'total_delivery_fee': instance.totalDeliveryFee,
      'total_amount': instance.totalAmount,
    };

OutletAddressSnapshotResponse _$OutletAddressSnapshotResponseFromJson(
  Map<String, dynamic> json,
) => OutletAddressSnapshotResponse(
  fullAddress: json['full_address'] as String,
  latitude: toDouble(json['latitude']),
  longitude: toDouble(json['longitude']),
);

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

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

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

OrderItemInfoResponse _$OrderItemInfoResponseFromJson(
  Map<String, dynamic> json,
) => OrderItemInfoResponse(
  id: json['id'] as String,
  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']),
  quantity: (json['quantity'] as num).toInt(),
);

Map<String, dynamic> _$OrderItemInfoResponseToJson(
  OrderItemInfoResponse instance,
) => <String, dynamic>{
  'id': instance.id,
  'product_image_url_snapshot': instance.productImageUrlSnapshot,
  'product_name_snapshot': instance.productNameSnapshot,
  'product_variant_name_snapshot': instance.productVariantNameSnapshot,
  'selling_price_snapshot': instance.sellingPriceSnapshot,
  'quantity': instance.quantity,
};

ProductReviewItemResponse _$ProductReviewItemResponseFromJson(
  Map<String, dynamic> json,
) => ProductReviewItemResponse(
  productVariantId: json['product_variant_id'] as String,
  productImageUrlSnapshot: json['product_image_url_snapshot'] as String?,
  productNameSnapshot: json['product_name_snapshot'] as String,
  productVariantNameSnapshot: json['product_variant_name_snapshot'] as String?,
);

Map<String, dynamic> _$ProductReviewItemResponseToJson(
  ProductReviewItemResponse instance,
) => <String, dynamic>{
  'product_variant_id': instance.productVariantId,
  'product_image_url_snapshot': instance.productImageUrlSnapshot,
  'product_name_snapshot': instance.productNameSnapshot,
  'product_variant_name_snapshot': instance.productVariantNameSnapshot,
};

ProductReviewRequest _$ProductReviewRequestFromJson(
  Map<String, dynamic> json,
) => ProductReviewRequest(
  customerId: json['customer_id'] as String,
  productVariantId: json['product_variant_id'] as String,
  rating: (json['rating'] as num).toInt(),
  comment: json['comment'] as String?,
);

Map<String, dynamic> _$ProductReviewRequestToJson(
  ProductReviewRequest instance,
) => <String, dynamic>{
  'customer_id': instance.customerId,
  'product_variant_id': instance.productVariantId,
  'rating': instance.rating,
  'comment': instance.comment,
};
