1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

testing pipe

This commit is contained in:
MoonTestUse1
2025-01-06 05:24:29 +06:00
parent fba5b250a7
commit 2f7bf9c28c
21 changed files with 582 additions and 475 deletions

View File

@@ -2,7 +2,8 @@
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from ..database import get_db
from ..crud import statistics
from ..crud import requests
from ..models.employee import Employee
from ..utils.auth import get_current_admin
router = APIRouter()
@@ -10,7 +11,11 @@ router = APIRouter()
@router.get("/")
def get_statistics(
db: Session = Depends(get_db),
_: dict = Depends(get_current_admin)
current_admin: Employee = Depends(get_current_admin)
):
"""Get system statistics"""
return statistics.get_request_statistics(db)
"""Get request statistics (admin only)"""
stats = requests.get_statistics(db)
return {
"total": stats["total"],
"by_status": stats["by_status"]
}