flip_api.project_services.get_projects

Attributes

router

Functions

get_projects_paginated_orm(...)

Fetches paginated project data from the database using SQLModel ORM.

get_projects_endpoint(, user_id)

Get a paginated and filtered list of projects.

Module Contents

flip_api.project_services.get_projects.router
flip_api.project_services.get_projects.get_projects_paginated_orm(session: sqlmodel.Session, user_id: uuid.UUID | None, paging_details: flip_api.utils.paging_utils.PagingInfo, filter_details: flip_api.utils.paging_utils.FilterInfo) flip_api.utils.paging_utils.IPagedResponse[flip_api.domain.interfaces.project.IProject]

Fetches paginated project data from the database using SQLModel ORM.

Parameters:
  • session (Session) – The SQLModel session used for the database queries.

  • user_id (UUID | None) – The requesting user’s ID. When provided, results are restricted to projects the user owns or has explicit access to.

  • paging_details (PagingInfo) – Page size, offset, and optional search string.

  • filter_details (FilterInfo) – Additional filter criteria (e.g. owner ID).

Returns:

Paginated list of projects and total row count.

Return type:

IPagedResponse[IProject]

flip_api.project_services.get_projects.get_projects_endpoint(request: fastapi.Request, session: sqlmodel.Session = Depends(get_session), user_id: uuid.UUID = Depends(verify_token)) flip_api.utils.paging_utils.IPagedData[flip_api.domain.interfaces.project.IProject]

Get a paginated and filtered list of projects.

Parameters:
  • request (Request) – The HTTP request object, used to access query parameters.

  • session (Session) – The database session for querying.

  • user_id (UUID) – The ID of the user making the request.

Returns:

A paginated response containing the projects.

Return type:

IPagedData[IProject]

Raises:

HTTPException – If an error occurs while fetching projects.