class CityEntity {
  final String name;
  final String coords;

  const CityEntity({
    required this.name,
    required this.coords,
  });

  Map<String, Object?> toDocument() {
    return {
      'name': name,
      'coords': coords,
    };
  }

  static CityEntity fromDocument(Map<String, dynamic> doc) {
    return CityEntity(
      name: doc['name'] as String,
      coords: doc['coords'] as String,
    );
  }

  @override
  String toString() {
    return '''CityEntity {
      name: $name
      coords: $coords
    }''';
  }
}
