refactor: update researcher API endpoints to include batch search and statistics functionality

- Removed deprecated search logic and replaced it with a new structure for handling researcher statistics.
- Introduced new schemas for batch search requests and responses.
- Enhanced the search endpoint to return publication statistics alongside researcher data.
- Updated docker-compose file to remove unnecessary versioning.
This commit is contained in:
Mireya Cueto Garrido
2026-04-28 09:41:45 +02:00
parent 60cb036f3e
commit c0eb0d3916
3 changed files with 116 additions and 26 deletions
+24 -3
View File
@@ -1,6 +1,6 @@
from pydantic import BaseModel
from pydantic import BaseModel, Field
from uuid import UUID
from typing import Optional, List
from typing import Optional, List, Dict
from datetime import datetime
from app.schema.publication import PublicationSchema
@@ -14,14 +14,35 @@ class ResearcherSchema(BaseModel):
model_config = {"from_attributes": True}
class ResearcherStatsSchema(BaseModel):
total_publications: int
publication_types: Dict[str, int]
class ResearcherWithPublicationsSchema(BaseModel):
researcher: ResearcherSchema
publications: List[PublicationSchema]
stats: ResearcherStatsSchema
# NUEVOS CAMPOS
new_records: int
updated_records: int
unchanged_records: int
total_records: int
model_config = {"from_attributes": True}
class ResearcherBatchSearchRequestSchema(BaseModel):
orcid_ids: List[str] = Field(min_length=1)
class ResearcherSearchErrorSchema(BaseModel):
orcid_id: str
detail: str
class ResearcherBatchSearchResponseSchema(BaseModel):
results: List[ResearcherWithPublicationsSchema]
errors: List[ResearcherSearchErrorSchema]
total_requested: int
total_processed: int