import 'dart:convert';

class LocatedAddress {
  int? storeId;
  double? latitude;
  double? longitude;
  String? streetNumber;
  String? streetName;
  String? city;
  String? locality;
  String? province;
  String? country;
  String? postalCode;
  String? formattedAddress;

  LocatedAddress.fromJson(Map<String, dynamic> json)
    : storeId = json['store_id'],
      latitude = json['latitude'],
      longitude = json['longitude'],
      streetNumber = json['street_number'],
      streetName = json['street_name'],
      city = json['city'],
      locality = json['locality'],
      province = json['province'],
      country = json['country'],
      postalCode = json['postal_code'],
      formattedAddress = json['formatted_address'];

  Map<String, dynamic> toJson() => {
    'store_id': storeId,
    'latitude': latitude,
    'longitude': longitude,
    'street_number': streetNumber,
    'street_name': streetName,
    'city': city,
    'locality': locality,
    'province': province,
    'country': country,
    'postal_code': postalCode,
    'formatted_address': formattedAddress
  };

  @override
  String toString() {
    return json.encode(this);
  }
}