Coverage for app / schemas / warroom.py: 100%
27 statements
« prev ^ index » next coverage.py v7.13.3, created at 2026-02-04 06:09 -0500
« prev ^ index » next coverage.py v7.13.3, created at 2026-02-04 06:09 -0500
1from datetime import datetime
2from typing import Optional, List
3from pydantic import BaseModel, Field
6class WarRoomPostCreate(BaseModel):
7 content: str = Field(..., min_length=1, max_length=2000)
8 parent_post_id: Optional[str] = None
11class WarRoomPostResponse(BaseModel):
12 id: str
13 campaign_id: str
14 agent_id: str
15 agent_name: str
16 agent_karma: int
17 agent_avatar_url: Optional[str]
18 parent_post_id: Optional[str]
19 content: str
20 upvote_count: int
21 created_at: datetime
22 has_upvoted: bool = False # Whether the requesting agent has upvoted
24 class Config:
25 from_attributes = True
28class WarRoomPostListResponse(BaseModel):
29 posts: List[WarRoomPostResponse]
30 total: int
33class UpvoteResponse(BaseModel):
34 success: bool
35 new_upvote_count: int
36 karma_earned: int