2026-02-09 15:49:50 +05:30
|
|
|
"""Gateway model storing organization-level gateway integration metadata."""
|
|
|
|
|
|
2026-02-04 23:07:22 +05:30
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2026-02-09 15:49:50 +05:30
|
|
|
from datetime import datetime # noqa: TCH003
|
2026-02-04 23:07:22 +05:30
|
|
|
from uuid import UUID, uuid4
|
|
|
|
|
|
2026-02-09 02:04:14 +05:30
|
|
|
from sqlmodel import Field
|
2026-02-04 23:07:22 +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-04 23:07:22 +05:30
|
|
|
|
2026-02-09 02:04:14 +05:30
|
|
|
class Gateway(QueryModel, table=True):
|
2026-02-09 15:49:50 +05:30
|
|
|
"""Configured external gateway endpoint and authentication settings."""
|
|
|
|
|
|
2026-02-04 23:07:22 +05:30
|
|
|
__tablename__ = "gateways"
|
|
|
|
|
|
|
|
|
|
id: UUID = Field(default_factory=uuid4, primary_key=True)
|
2026-02-08 21:16:26 +05:30
|
|
|
organization_id: UUID = Field(foreign_key="organizations.id", index=True)
|
2026-02-04 23:07:22 +05:30
|
|
|
name: str
|
|
|
|
|
url: str
|
|
|
|
|
token: str | None = Field(default=None)
|
|
|
|
|
main_session_key: str
|
|
|
|
|
workspace_root: str
|
2026-02-06 16:12:04 +05:30
|
|
|
created_at: datetime = Field(default_factory=utcnow)
|
|
|
|
|
updated_at: datetime = Field(default_factory=utcnow)
|