"""Title library domain entity."""

from __future__ import annotations

from dataclasses import dataclass, field
from datetime import datetime, timezone
from typing import List


@dataclass
class TitleLibraryItem:
    """标题库条目"""

    id: str
    user_id: str
    name: str
    text: str
    category: str = "default"
    description: str = ""
    tags: List[str] = field(default_factory=list)
    usage_count: int = 0
    is_active: bool = True
    metadata_: dict = field(default_factory=dict)
    created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
    updated_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
