using System.ComponentModel.DataAnnotations;
using BookmarkApi.Shared.Enums;

namespace BookmarkApi.Shared.DTOs.Bookmark;

/// <summary>
/// 更新书签请求
/// </summary>
public class UpdateBookmarkRequest
{
    /// <summary>
    /// 所属文件夹ID（null 为根目录）
    /// </summary>
    public Guid? FolderId { get; set; }

    /// <summary>
    /// 是否更新文件夹（用于区分 null 和不更新）
    /// </summary>
    public bool UpdateFolder { get; set; }

    /// <summary>
    /// 书签标题
    /// </summary>
    [StringLength(500, ErrorMessage = "标题长度不能超过500个字符")]
    public string? Title { get; set; }

    /// <summary>
    /// 书签URL
    /// </summary>
    [Url(ErrorMessage = "URL格式不正确")]
    [StringLength(2000, ErrorMessage = "URL长度不能超过2000个字符")]
    public string? Url { get; set; }

    /// <summary>
    /// 书签描述
    /// </summary>
    [StringLength(2000, ErrorMessage = "描述长度不能超过2000个字符")]
    public string? Description { get; set; }

    /// <summary>
    /// 网站图标
    /// </summary>
    public string? Icon { get; set; }

    /// <summary>
    /// 标签数组
    /// </summary>
    public string[]? Tags { get; set; }

    /// <summary>
    /// 可见性类型
    /// </summary>
    public VisibilityType? Visibility { get; set; }

    /// <summary>
    /// 允许查看的设备ID列表
    /// </summary>
    public Guid[]? AllowedDevices { get; set; }
}

