Add challenges promotion
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from app.models.challenge import ChallengeType, Difficulty, ProofType
|
||||
from app.models.challenge import ChallengeType, Difficulty, ProofType, ChallengeStatus
|
||||
from app.schemas.game import GameShort
|
||||
|
||||
|
||||
class ProposedByUser(BaseModel):
|
||||
"""Minimal user info for proposed challenges"""
|
||||
id: int
|
||||
nickname: str
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class ChallengeBase(BaseModel):
|
||||
title: str = Field(..., min_length=1, max_length=100)
|
||||
description: str = Field(..., min_length=1)
|
||||
@@ -36,11 +45,18 @@ class ChallengeResponse(ChallengeBase):
|
||||
game: GameShort
|
||||
is_generated: bool
|
||||
created_at: datetime
|
||||
status: str = "approved"
|
||||
proposed_by: ProposedByUser | None = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class ChallengePropose(ChallengeBase):
|
||||
"""Schema for proposing a challenge by a participant"""
|
||||
pass
|
||||
|
||||
|
||||
class ChallengeGenerated(BaseModel):
|
||||
"""Schema for GPT-generated challenges"""
|
||||
title: str
|
||||
|
||||
Reference in New Issue
Block a user