import uuid

from sqlalchemy import Column, JSON
from sqlmodel import SQLModel, Field


class Integration(SQLModel, table=True):
    id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
    name: str = Field(index=True)
    icon: str = Field(index=True)
    type: str = Field(index=True)
    tag: str = Field(index=True, nullable=True)
    description: str = Field(index=True, nullable=True)
    code_reference: str = Field(index=True)


class Link(SQLModel, table=True):
    id: uuid.UUID = Field(default_factory=uuid.uuid4, primary_key=True)
    company: uuid.UUID = Field(index=True)
    auth_config: dict = Field(sa_column=Column(JSON))

