import '../../domain/models/card.dart';
import '../../domain/models/home.dart';
import '../dtos/characters_dto.dart';

extension CharactersDtoToModel on CharactersDto {
  HomeData toDomain() => HomeData(
    data: data?.map((e) => e.toDomain()).toList(),
    nextPage: meta?.pagination?.next,
  );
}

extension CharactersDataDtoToModel on CharactersDataDto {
  CardData toDomain() => CardData(
    fullName,
    family: family,
    title: title,
    imageUrl: imageUrl
  );
}