123
This commit is contained in:
29
backend/api_service/app/schemas/task.py
Normal file
29
backend/api_service/app/schemas/task.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""
|
||||
Pydantic schemas for Task CRUD operations.
|
||||
"""
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class TaskCreate(BaseModel):
|
||||
"""Request body for creating a new signin task."""
|
||||
cron_expression: str = Field(..., min_length=1, max_length=50, description="Cron expression for scheduling")
|
||||
|
||||
|
||||
class TaskUpdate(BaseModel):
|
||||
"""Request body for updating an existing task."""
|
||||
is_enabled: Optional[bool] = Field(None, description="Enable or disable the task")
|
||||
|
||||
|
||||
class TaskResponse(BaseModel):
|
||||
"""Public representation of a signin task."""
|
||||
id: str
|
||||
account_id: str
|
||||
cron_expression: str
|
||||
is_enabled: bool
|
||||
created_at: Optional[datetime]
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user