feat(project): show business fields in statistics details

Reuse assignment business columns and keyword searches in the four statistics drill-down lists. Add a statistics-permission read endpoint sharing tenant-scoped detail queries without granting assignment access.

Related to issue #13. Independent static review completed. User self-test arrangement: regression cases authored, no tests or builds executed.
This commit is contained in:
zlwu committed 2026-11-04 14:40:04 +08:00
1 parent f04e24186f
commit fa5efa9629
7 files changed
+106 -8

No files matched your search

+15
View File
@@ -159,6 +159,21 @@ def records(bizType: str, page: int=Query(1, ge=1), pageSize: int=Query(20, ge=1
return success_response(svc.records(db, *ctx, bizType, page, pageSize, teamId=teamId, projectId=projectId, unassigned=unassigned, status=status, keyword=keyword, startDate=startDate, endDate=endDate))
@router.get(PREFIX + '/statistics/records')
def statistics_records(
bizType: Literal['cell_storage', 'research_donation', 'pilot_service', 'basic_experiment'],
page: int = Query(1, ge=1), pageSize: int = Query(20, ge=1, le=200),
teamId: Optional[str] = None, projectId: Optional[str] = None,
unassigned: bool = False, status: Optional[str] = None, keyword: Optional[str] = None,
startDate: Optional[str] = None, endDate: Optional[str] = None,
ctx=Depends(guard('project:statistics:list')), db: Session=Depends(get_db),
):
return success_response(project_assignment_records.statistics_records(
db, *ctx, bizType, page, pageSize, teamId=teamId, projectId=projectId,
unassigned=unassigned, status=status, keyword=keyword, startDate=startDate, endDate=endDate,
))
@router.post(PREFIX + '/assignments/preview')
def preview(body: PreviewBody, ctx=Depends(guard('project:assignment:edit')), db: Session=Depends(get_db)):
return success_response(svc.preview_assignment(db, *ctx, body.bizType, body.id, body.projectId))