46 lines
1013 B
Python
46 lines
1013 B
Python
from typing import Dict, Any
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ProjectInfo(BaseModel):
|
|
"""Project information model."""
|
|
id: int
|
|
activity: Dict[str, Any]
|
|
|
|
|
|
class TimeReportResponse(BaseModel):
|
|
"""Response model for time reporting endpoint."""
|
|
message: str
|
|
reported_days: int
|
|
total_hours: float
|
|
project_name: str
|
|
user_name: str
|
|
|
|
|
|
class TimeEvent(BaseModel):
|
|
"""Time event model for Kleer API."""
|
|
foreign_id: str = Field(default="", alias="foreign-id")
|
|
user: Dict[str, int]
|
|
client_project: int = Field(alias="client-project")
|
|
activity: Dict[str, Any]
|
|
date: str
|
|
hours: float
|
|
comment: str = ""
|
|
internal_comment: str = Field(default="", alias="internal-comment")
|
|
|
|
class Config:
|
|
populate_by_name = True
|
|
|
|
|
|
class UserInfo(BaseModel):
|
|
"""User information model."""
|
|
id: int
|
|
name: str
|
|
|
|
|
|
class ProjectResponse(BaseModel):
|
|
"""Project response model."""
|
|
id: int
|
|
name: str
|
|
activity_id: Dict[str, Any]
|