using Postall.Domain.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Postall.Domain.Dtos
{
    public class ChannelResponse
    {
        public string Id { get; set; }
        public string UserId { get; set; }
        public string YoutubeId { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public string ThumbnailUrl { get; set; }
        public DateTime PublishedAt { get; set; }
        public ulong SubscriberCount { get; set; }
        public ulong VideoCount { get; set; }

        // Propriedade para seleção de canais na interface
        public bool IsSelected { get; set; }

        // URL do canal no YouTube
        public string ChannelUrl => $"https://www.youtube.com/channel/{Id}";

        public ChannelData ToChannelData()
        {
            return new ChannelData
            {
                Id = Id,
                UserId = UserId,
                YoutubeId = YoutubeId,
                Title = Title,
                Description = Description,
                ThumbnailUrl = ThumbnailUrl,
                PublishedAt = PublishedAt,
                SubscriberCount = SubscriberCount,
                VideoCount = VideoCount
            };
        }
    }
}
