2026-02-09 15:49:50 +05:30
|
|
|
"""Task fingerprint model for duplicate/task-linking operations."""
|
|
|
|
|
|
2026-02-05 14:39:34 +05:30
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2026-02-09 17:24:21 +05:30
|
|
|
from datetime import datetime
|
2026-02-05 14:39:34 +05:30
|
|
|
from uuid import UUID, uuid4
|
|
|
|
|
|
2026-02-09 02:04:14 +05:30
|
|
|
from sqlmodel import Field
|
2026-02-05 14:39:34 +05:30
|
|
|
|
2026-02-06 16:12:04 +05:30
|
|
|
from app.core.time import utcnow
|
2026-02-09 02:04:14 +05:30
|
|
|
from app.models.base import QueryModel
|
2026-02-06 16:12:04 +05:30
|
|
|
|
2026-02-09 17:24:21 +05:30
|
|
|
RUNTIME_ANNOTATION_TYPES = (datetime,)
|
|
|
|
|
|
2026-02-05 14:39:34 +05:30
|
|
|
|
2026-02-09 02:04:14 +05:30
|
|
|
class TaskFingerprint(QueryModel, table=True):
|
2026-02-09 15:49:50 +05:30
|
|
|
"""Hashed task-content fingerprint associated with a board and task."""
|
|
|
|
|
|
2026-02-05 14:39:34 +05:30
|
|
|
__tablename__ = "task_fingerprints"
|
|
|
|
|
|
|
|
|
|
id: UUID = Field(default_factory=uuid4, primary_key=True)
|
|
|
|
|
board_id: UUID = Field(foreign_key="boards.id", index=True)
|
|
|
|
|
fingerprint_hash: str = Field(index=True)
|
|
|
|
|
task_id: UUID = Field(foreign_key="tasks.id")
|
2026-02-06 16:12:04 +05:30
|
|
|
created_at: datetime = Field(default_factory=utcnow)
|