using System;
using Knot.Modules.Profiles.Domain;

namespace Knot.Modules.Profiles.Application.Profiles.DTOs;

public record UserProfileDto(
    Guid Id,
    string UserName,
    string DisplayName,
    string? AvatarUrl,
    string? Bio,
    DateTime? Birthday,
    DateTime CreatedAt,
    bool HideStoryViews = false,
    bool IsOnline = false,
    DateTime? LastSeen = null)
{
    public static UserProfileDto FromDocument(ProfileDocument doc) =>
        new(
            doc.Id,
            doc.Username,
            doc.DisplayName,
            doc.AvatarUrl,
            doc.Bio,
            doc.Birthday,
            doc.CreatedAt,
            doc.HideStoryViews
        );
}
