Prepare ERP source for Gitea deployment

This commit is contained in:
A R R R Associates
2026-06-20 15:01:44 +05:30
commit 5c75eb6bd9
450 changed files with 67698 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from sqlalchemy import select
from app.core.db.deps import get_common_db
from app.modules.core.tenancy.models import Tenant, Branch
router = APIRouter(prefix="/tenancy", tags=["tenancy"])
@router.get("/tenants")
def list_tenants(db: Session = Depends(get_common_db)):
return db.execute(select(Tenant).order_by(Tenant.id)).scalars().all()
@router.get("/branches")
def list_branches(db: Session = Depends(get_common_db)):
return db.execute(select(Branch).order_by(Branch.id)).scalars().all()