klg-asutk-app/backend/app/models/organization.py
Yuriy 0150aba4f5 Consolidation: KLG ASUTK + PAPA integration
- Unify API: lib/api.ts uses /api/v1, inbox uses /api/inbox (rewrites)
- Remove localhost refs: openapi, inbox page
- Add rewrites: /api/inbox|tmc -> inbox-server, /api/v1 -> FastAPI
- Add stub routes: knowledge/insights, recommendations, search, log-error
- Transfer from PAPA: prompts (inspection, tmc), scripts, supabase, data/tmc-requests
- Fix inbox-server: ORDER BY created_at, package.json
- Remove redundant app/api/inbox/files route (rewrites handle it)
- knowledge/ in gitignore (large PDFs)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 17:18:31 +03:00

21 lines
880 B
Python

from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column
from app.db.base import Base
from app.models.common import TimestampMixin, uuid4_str
class Organization(Base, TimestampMixin):
__tablename__ = "organizations"
id: Mapped[str] = mapped_column(String(36), primary_key=True, default=uuid4_str)
kind: Mapped[str] = mapped_column(
String(32), nullable=False, doc="operator|mro|authority|other"
)
name: Mapped[str] = mapped_column(String(255), nullable=False)
inn: Mapped[str | None] = mapped_column(String(16), nullable=True)
ogrn: Mapped[str | None] = mapped_column(String(20), nullable=True)
address: Mapped[str | None] = mapped_column(String(512), nullable=True)
email: Mapped[str | None] = mapped_column(String(255), nullable=True)
phone: Mapped[str | None] = mapped_column(String(64), nullable=True)