"""Statement Reserves Handler.""" from fastapi import APIRouter from moneyhub.logic import statement_reserves as logic from moneyhub.schemas.statement_reserves import StatementReservesSchema statement_reserves_router = APIRouter(prefix='/statement-reserves', tags=['statement_reserves']) @statement_reserves_router.get( '/account/{account_id}/statement-period/{statement_period_id}', status_code=200 ) def get_statement_reserves_by_account_id( account_id: int, statement_period_id: int, contract_id: int | None = None ) -> StatementReservesSchema | None: """GET statement reserves totals for a specified account. Args: account_id (int): The id of an account statement_period_id (int): The id of the statement period contract_id (int): the id of a contract Returns: dict: dict of statement reserves totals """ return logic.get_statement_reserves( account_id, contract_id, statement_period_id)