the middle of the idiots

This commit is contained in:
2025-10-24 16:29:40 -05:00
parent 6a58e19b10
commit 721301c779
2472 changed files with 237076 additions and 418 deletions

View File

@@ -6,9 +6,9 @@ from typing import List
from pydantic import BaseModel
from sqlalchemy.orm import Session
from ..database import SessionLocal
from ..models import Tenant
from ..config.settings import settings
from ...database import SessionLocal
from ...models import Tenant
from ...config.settings import settings
router = APIRouter()
@@ -17,6 +17,14 @@ class TenantCreate(BaseModel):
name: str
subdomain: str
class Config:
json_schema_extra = {
"example": {
"name": "Acme Corporation",
"subdomain": "acme"
}
}
class TenantResponse(BaseModel):
id: int
name: str
@@ -25,6 +33,14 @@ class TenantResponse(BaseModel):
class Config:
from_attributes = True
json_schema_extra = {
"example": {
"id": 1,
"name": "Acme Corporation",
"subdomain": "acme",
"is_active": True
}
}
@router.get("/", response_model=List[TenantResponse])
async def get_tenants(skip: int = 0, limit: int = 100, db: Session = Depends(SessionLocal)):