You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
794 B
Python
24 lines
794 B
Python
from __future__ import annotations
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
from sqlmodel import SQLModel, Field
|
|
|
|
class GoogleAccount(SQLModel, table=True):
|
|
id: Optional[int] = Field(default=None, primary_key=True)
|
|
|
|
# email del usuario autorizado (ej: tu@gmail.com)
|
|
email: str = Field(index=True, unique=True)
|
|
|
|
# token OAuth completo (json) guardado como texto
|
|
token_json: str
|
|
|
|
created_at: datetime = Field(default_factory=datetime.utcnow)
|
|
updated_at: datetime = Field(default_factory=datetime.utcnow)
|
|
|
|
class AuditLog(SQLModel, table=True):
|
|
id: Optional[int] = Field(default=None, primary_key=True)
|
|
account_email: str = Field(index=True)
|
|
action: str
|
|
detail: str = ""
|
|
created_at: datetime = Field(default_factory=datetime.utcnow)
|