// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'home_model.dart';

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

HomeResponse _$HomeResponseFromJson(Map<String, dynamic> json) => HomeResponse(
  currentOutlet: CurrentOutletResponse.fromJson(
    json['current_outlet'] as Map<String, dynamic>,
  ),
  campaignByOutlets: (json['campaign_by_outlets'] as List<dynamic>)
      .map((e) => CampaignByOutletResponse.fromJson(e as Map<String, dynamic>))
      .toList(),
  allCategories: (json['all_categories'] as List<dynamic>)
      .map((e) => CategoryItemResponse.fromJson(e as Map<String, dynamic>))
      .toList(),
  otherOutlets: (json['other_outlets'] as List<dynamic>)
      .map((e) => OtherOutletResponse.fromJson(e as Map<String, dynamic>))
      .toList(),
  productRecommendations: (json['product_recommendations'] as List<dynamic>)
      .map((e) => ProductItemResponse.fromJson(e as Map<String, dynamic>))
      .toList(),
  allProducts: (json['all_products'] as List<dynamic>)
      .map((e) => ProductItemResponse.fromJson(e as Map<String, dynamic>))
      .toList(),
);

Map<String, dynamic> _$HomeResponseToJson(HomeResponse instance) =>
    <String, dynamic>{
      'current_outlet': instance.currentOutlet,
      'campaign_by_outlets': instance.campaignByOutlets,
      'all_categories': instance.allCategories,
      'other_outlets': instance.otherOutlets,
      'product_recommendations': instance.productRecommendations,
      'all_products': instance.allProducts,
    };

OperationalServiceResponse _$OperationalServiceResponseFromJson(
  Map<String, dynamic> json,
) => OperationalServiceResponse(
  onlineOpenTime: json['online_open_time'] as String,
  onlineCloseTime: json['online_close_time'] as String,
  isCloseService: json['is_close_service'] as bool,
);

Map<String, dynamic> _$OperationalServiceResponseToJson(
  OperationalServiceResponse instance,
) => <String, dynamic>{
  'online_open_time': instance.onlineOpenTime,
  'online_close_time': instance.onlineCloseTime,
  'is_close_service': instance.isCloseService,
};

CurrentOutletResponse _$CurrentOutletResponseFromJson(
  Map<String, dynamic> json,
) => CurrentOutletResponse(
  id: json['id'] as String,
  name: json['name'] as String,
  location: json['location'] as String?,
  latitude: toDouble(json['latitude']),
  longitude: toDouble(json['longitude']),
  isActive: json['is_active'] as bool,
);

Map<String, dynamic> _$CurrentOutletResponseToJson(
  CurrentOutletResponse instance,
) => <String, dynamic>{
  'id': instance.id,
  'name': instance.name,
  'latitude': instance.latitude,
  'longitude': instance.longitude,
  'location': instance.location,
  'is_active': instance.isActive,
};

CampaignByOutletResponse _$CampaignByOutletResponseFromJson(
  Map<String, dynamic> json,
) => CampaignByOutletResponse(
  campaignType: json['campaign_type'] as String?,
  actionRefId: json['action_ref_id'] as String?,
  serverBannerUrl: json['server_banner_url'] as String?,
);

Map<String, dynamic> _$CampaignByOutletResponseToJson(
  CampaignByOutletResponse instance,
) => <String, dynamic>{
  'campaign_type': instance.campaignType,
  'action_ref_id': instance.actionRefId,
  'server_banner_url': instance.serverBannerUrl,
};

CategoryItemResponse _$CategoryItemResponseFromJson(
  Map<String, dynamic> json,
) => CategoryItemResponse(
  id: json['id'] as String,
  serverImageUrl: json['server_image_url'] as String?,
  name: json['name'] as String,
);

Map<String, dynamic> _$CategoryItemResponseToJson(
  CategoryItemResponse instance,
) => <String, dynamic>{
  'id': instance.id,
  'server_image_url': instance.serverImageUrl,
  'name': instance.name,
};

MainOutletResponse _$MainOutletResponseFromJson(Map<String, dynamic> json) =>
    MainOutletResponse(
      uuid: json['uuid'] as String,
      name: json['name'] as String,
      phoneNumber: json['phone_number'] as String?,
      location: json['full_address'] as String?,
      latitude: toDouble(json['latitude']),
      longitude: toDouble(json['longitude']),
    );

Map<String, dynamic> _$MainOutletResponseToJson(MainOutletResponse instance) =>
    <String, dynamic>{
      'uuid': instance.uuid,
      'name': instance.name,
      'phone_number': instance.phoneNumber,
      'full_address': instance.location,
      'latitude': instance.latitude,
      'longitude': instance.longitude,
    };

OtherOutletResponse _$OtherOutletResponseFromJson(Map<String, dynamic> json) =>
    OtherOutletResponse(
      id: json['id'] as String,
      serverBannerUrl: json['server_banner_url'] as String?,
      name: json['name'] as String,
      phoneNumber: json['phone_number'] as String?,
      location: json['location'] as String?,
      latitude: toDouble(json['latitude']),
      longitude: toDouble(json['longitude']),
      isActive: json['is_active'] as bool,
    );

Map<String, dynamic> _$OtherOutletResponseToJson(
  OtherOutletResponse instance,
) => <String, dynamic>{
  'id': instance.id,
  'server_banner_url': instance.serverBannerUrl,
  'name': instance.name,
  'phone_number': instance.phoneNumber,
  'location': instance.location,
  'latitude': instance.latitude,
  'longitude': instance.longitude,
  'is_active': instance.isActive,
};

ProductItemResponse _$ProductItemResponseFromJson(Map<String, dynamic> json) =>
    ProductItemResponse(
      id: json['id'] as String,
      serverImageUrl: json['server_image_url'] as String?,
      name: json['name'] as String,
      totalSold: toDouble(json['total_sold']),
      averageRating: toDouble(json['average_rating']),
      sellingPrice: toDouble(json['selling_price']),
      likes: (json['likes'] as num).toInt(),
    );

Map<String, dynamic> _$ProductItemResponseToJson(
  ProductItemResponse instance,
) => <String, dynamic>{
  'id': instance.id,
  'server_image_url': instance.serverImageUrl,
  'name': instance.name,
  'total_sold': instance.totalSold,
  'average_rating': instance.averageRating,
  'selling_price': instance.sellingPrice,
  'likes': instance.likes,
};
