feat(plan): task_kind on Note model + to_dict
This commit is contained in:
@@ -60,6 +60,10 @@ class Note(Base, TimestampMixin):
|
|||||||
# Structured metadata for entity types (person/place/list)
|
# Structured metadata for entity types (person/place/list)
|
||||||
# Named 'entity_meta' to avoid collision with SQLAlchemy's reserved 'metadata' attribute
|
# Named 'entity_meta' to avoid collision with SQLAlchemy's reserved 'metadata' attribute
|
||||||
entity_meta: Mapped[dict | None] = mapped_column("metadata", JSONB, nullable=True)
|
entity_meta: Mapped[dict | None] = mapped_column("metadata", JSONB, nullable=True)
|
||||||
|
# Task sub-kind — 'work' (default) or 'plan'. Only meaningful when the note
|
||||||
|
# is a task (status is not None); ordinary notes keep the 'work' default and
|
||||||
|
# ignore it. Orthogonal to note_type (which is the note/entity axis).
|
||||||
|
task_kind: Mapped[str] = mapped_column(Text, default="work", server_default="work")
|
||||||
|
|
||||||
__table_args__ = (
|
__table_args__ = (
|
||||||
Index("ix_notes_tags", "tags", postgresql_using="gin"),
|
Index("ix_notes_tags", "tags", postgresql_using="gin"),
|
||||||
@@ -106,6 +110,7 @@ class Note(Base, TimestampMixin):
|
|||||||
),
|
),
|
||||||
"is_task": self.is_task,
|
"is_task": self.is_task,
|
||||||
"note_type": self.entity_type,
|
"note_type": self.entity_type,
|
||||||
|
"task_kind": self.task_kind,
|
||||||
"metadata": self.entity_meta or {},
|
"metadata": self.entity_meta or {},
|
||||||
"created_at": self.created_at.isoformat(),
|
"created_at": self.created_at.isoformat(),
|
||||||
"updated_at": self.updated_at.isoformat(),
|
"updated_at": self.updated_at.isoformat(),
|
||||||
|
|||||||
Reference in New Issue
Block a user