from fastapi import APIRouter, Depends
from ..utils import engine, get_session
from ..models.capacity import Capacity
from sqlmodel import Session, select, SQLModel, and_
from sqlalchemy.exc import NoResultFound
from ..models.user import User
from ..models.team import Team

router = APIRouter(prefix="/api/capacities", tags=["capacity"])
session = Session(engine)


@router.post("/")
async def post_capacity(*, capacity: Capacity, session: Session = Depends(get_session)):
    """
    Post new capacity.

    Parameters
    ----------
    capacity : Capacity
        Capacity that is to be added to the database.
    session : Session
        SQL session that is to be used to add the capacity.
        Defaults to creating a dependency on the running SQL model session.
    """
    statement = 