import uuid
from datetime import datetime
from typing import Optional
from sqlalchemy import UniqueConstraint

from sqlmodel import Field, Relationship
from pydantic_factories import ModelFactory, Use
from faker import Faker
from api.db.models.base import BaseModel, BaseTable


class StudentBase(BaseModel):
    name: str = Field(index=True, nullable=False)
    sandbox_id: uuid.UUID = None

    # faber line of business data for student degree credentials
    degree: Optional[str] = Field(default=None, nullable=True)
    age: Optional[int] = Field(default=None, nullable=True)
    student_id: Optional[str] = Field(default=None, nullable=True)
    date: Optional[datetime] = Field(default=None, nullable=True)

    # track invitation information
    # this is for this LOB to track this entity in Traction
    invitation_state: Optional[str] = Field(default=None, nullable=True)
    connection_id: Optional[uuid.UUID] = 