class Team {
  final String id;
  final String name;
  final String season;
  final String imageUrl;
  final bool isFavorite;

  Team({
    required this.id,
    required this.name,
    required this.season,
    required this.imageUrl,
    this.isFavorite = false
  });

  // Mapeia o JSON que vem do Supabase (id costuma ser UUID ou String)
  factory Team.fromMap(Map<String, dynamic> map) {
    return Team(
      id: map['id']?.toString() ?? '',
      name: map['name'] ?? '',
      season: map['season'] ?? '',
      imageUrl: map['image_url'] ?? '',
      isFavorite: map['is_favorite'] ?? false,
    );
  }

  Map<String, dynamic> toMap() {
    return {
      'name': name,
      'season': season,
      'image_url': imageUrl,
      'is_favorite': isFavorite,
    };
  }
}