60 lines
1.2 KiB
Python
60 lines
1.2 KiB
Python
from datetime import datetime
|
|
from typing import Optional, List, Dict, Any
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class ProjectSummary(BaseModel):
|
|
project_id: str
|
|
project_title: str
|
|
completed_count: int
|
|
in_progress_count: int
|
|
overdue_count: int
|
|
total_tasks: int
|
|
|
|
|
|
class ReportSummary(BaseModel):
|
|
completed_count: int
|
|
in_progress_count: int
|
|
overdue_count: int
|
|
total_tasks: int
|
|
|
|
|
|
class WeeklyReportContent(BaseModel):
|
|
week_start: str
|
|
week_end: str
|
|
generated_at: str
|
|
projects: List[Dict[str, Any]]
|
|
summary: ReportSummary
|
|
|
|
|
|
class ReportHistoryItem(BaseModel):
|
|
id: str
|
|
report_id: str
|
|
generated_at: datetime
|
|
content: Dict[str, Any]
|
|
status: str
|
|
error_message: Optional[str] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class ReportHistoryListResponse(BaseModel):
|
|
reports: List[ReportHistoryItem]
|
|
total: int
|
|
|
|
|
|
class GenerateReportResponse(BaseModel):
|
|
message: str
|
|
report_id: str
|
|
summary: ReportSummary
|
|
|
|
|
|
class WeeklyReportSubscription(BaseModel):
|
|
is_active: bool
|
|
last_sent_at: Optional[datetime] = None
|
|
|
|
|
|
class WeeklyReportSubscriptionUpdate(BaseModel):
|
|
is_active: bool
|