Adding chtlawfirm to the api

This commit is contained in:
2025-04-10 22:43:00 +02:00
parent 72a8e7fb91
commit ef9ae99cb6
34 changed files with 1648 additions and 44 deletions

View File

@@ -1,19 +1,16 @@
from datetime import datetime
from fastapi import APIRouter
from beanie import Document, PydanticObjectId
from pydantic import Field, computed_field
from hub.auth import auth_router, register_router, password_router, verification_router, users_router, \
google_oauth_router, discord_oauth_router
from hub.firm.routes import router as firm_router
hub_router = APIRouter()
class CrudDocument(Document):
_id: str
created_at: datetime = Field(default=datetime.utcnow(), nullable=False, title="Créé le")
created_by: PydanticObjectId = Field()
updated_at: datetime = Field(default_factory=datetime.utcnow, nullable=False, title="Modifié le")
updated_by: PydanticObjectId = Field()
@computed_field
def label(self) -> str:
return self.compute_label()
def compute_label(self) -> str:
return ""
hub_router.include_router(register_router, tags=["Auth"], )
hub_router.include_router(auth_router, prefix="/auth", tags=["Auth"], )
hub_router.include_router(google_oauth_router, prefix="/auth/google", tags=["Auth"])
hub_router.include_router(discord_oauth_router, prefix="/auth/discord", tags=["Auth"])
hub_router.include_router(verification_router, prefix="/auth/verification", tags=["Auth"], )
hub_router.include_router(users_router, prefix="/users", tags=["Users"], )
hub_router.include_router(password_router, prefix="/users", tags=["Users"], )
hub_router.include_router(firm_router, prefix="/users/firms", tags=["Users"], )