Sprint 1 : scaffolding complet de Glibredecision
Plateforme de decisions collectives pour Duniter/G1. Backend FastAPI async + PostgreSQL (14 tables, 8 routers, 6 services, moteur de vote avec formule d'inertie WoT/Smith/TechComm). Frontend Nuxt 4 + Nuxt UI v3 + Pinia (9 pages, 5 stores). Infrastructure Docker + Woodpecker CI + Traefik. Documentation technique et utilisateur (15 fichiers). Seed : Licence G1, Engagement Forgeron v2.0.0, 4 protocoles de vote. 30 tests unitaires (formules, mode params, vote nuance) -- tous verts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
70
backend/app/schemas/mandate.py
Normal file
70
backend/app/schemas/mandate.py
Normal file
@@ -0,0 +1,70 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
# ── Mandate Step ─────────────────────────────────────────────────
|
||||
|
||||
|
||||
class MandateStepCreate(BaseModel):
|
||||
"""Payload for creating a step within a mandate process."""
|
||||
|
||||
step_order: int = Field(..., ge=0)
|
||||
step_type: str = Field(
|
||||
...,
|
||||
max_length=32,
|
||||
description="formulation, candidacy, vote, assignment, reporting, completion, revocation",
|
||||
)
|
||||
title: str | None = Field(default=None, max_length=256)
|
||||
description: str | None = None
|
||||
|
||||
|
||||
class MandateStepOut(BaseModel):
|
||||
"""Full mandate step representation."""
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: UUID
|
||||
mandate_id: UUID
|
||||
step_order: int
|
||||
step_type: str
|
||||
title: str | None = None
|
||||
description: str | None = None
|
||||
status: str
|
||||
vote_session_id: UUID | None = None
|
||||
outcome: str | None = None
|
||||
created_at: datetime
|
||||
|
||||
|
||||
# ── Mandate ──────────────────────────────────────────────────────
|
||||
|
||||
|
||||
class MandateCreate(BaseModel):
|
||||
"""Payload for creating a new mandate."""
|
||||
|
||||
title: str = Field(..., min_length=1, max_length=256)
|
||||
description: str | None = None
|
||||
mandate_type: str = Field(..., max_length=64, description="techcomm, smith, custom")
|
||||
decision_id: UUID | None = None
|
||||
|
||||
|
||||
class MandateOut(BaseModel):
|
||||
"""Full mandate representation returned by the API."""
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: UUID
|
||||
title: str
|
||||
description: str | None = None
|
||||
mandate_type: str
|
||||
status: str
|
||||
mandatee_id: UUID | None = None
|
||||
decision_id: UUID | None = None
|
||||
starts_at: datetime | None = None
|
||||
ends_at: datetime | None = None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
steps: list[MandateStepOut] = Field(default_factory=list)
|
||||
Reference in New Issue
Block a user