Skip to content

Commit

Permalink
ProjectsSummaryInternal model and test endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
EddieLF committed Sep 14, 2023
1 parent 3d0ab4d commit b96779a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 7 deletions.
46 changes: 43 additions & 3 deletions api/routes/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from db.python.layers.web import WebLayer, SearchItem
from db.python.tables.project import ProjectPermissionsTable
from models.models.search import SearchResponse
from models.models.web import ProjectSummary, PagingLinks
from models.models.web import ProjectsSummaryInternal, ProjectSummary, PagingLinks


class SearchResponseModel(BaseModel):
Expand Down Expand Up @@ -126,10 +126,50 @@ async def sync_seqr_project(


@router.post('/projects-summary', operation_id='getProjectsSummary')
async def get_projects_summary(sequencing_types: list[str] = None):
async def get_projects_summary(
projects: list[int] = None, sequencing_types: list[str] = None
):
"""
Get the summary of all projects
Get the project summaries
"""
return [
ProjectsSummaryInternal(
project=1,
dataset='test-dataset-1',
sequencing_type='genome',
total_families=1,
total_participants=3,
total_samples=3,
total_sequencing_groups=3,
total_crams=3,
total_sgs_in_latest_es_index=3,
total_sgs_in_latest_annotate_dataset=3,
),
ProjectsSummaryInternal(
project=1,
dataset='test-dataset-1',
sequencing_type='exome',
total_families=1,
total_participants=1,
total_samples=1,
total_sequencing_groups=1,
total_crams=1,
total_sgs_in_latest_es_index=1,
total_sgs_in_latest_annotate_dataset=1,
),
ProjectsSummaryInternal(
project=2,
dataset='test-dataset-2',
sequencing_type='genome',
total_families=5,
total_participants=5,
total_samples=5,
total_sequencing_groups=5,
total_crams=4,
total_sgs_in_latest_es_index=4,
total_sgs_in_latest_annotate_dataset=4,
),
]
return await WebLayer(get_projectless_db_connection).get_projects_summary(
sequencing_types=sequencing_types
)
8 changes: 4 additions & 4 deletions models/models/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class ProjectsSummaryInternal:
total_crams: int
# latest_es_index_output: str
# latest_es_index_timestamp: str
# total_sgs_in_latest_es_index: int
# latest_joint_call_output: str
# latest_joint_call_timestamp: str
# total_sgs_in_latest_joint_call: int
total_sgs_in_latest_es_index: int
# latest_annotate_dataset_output: str
# latest_annotate_dataset_timestamp: str
total_sgs_in_latest_annotate_dataset: int


@dataclasses.dataclass
Expand Down

0 comments on commit b96779a

Please sign in to comment.