Qualifier : corrections R2/R6 + router + modèle DB + wizard frontend
Corrections moteur (TDD) : - R2 : within_mandate → record_in_observatory=True (Observatoire des décisions) - R6 : >50 personnes → collective recommandé, pas obligatoire (confidence=recommended) - R3 supprimée : affected_count=1 hors périmètre de l'outil - R9-R12 renommés G1-G4 (garde-fous internes) - 23 tests, 213/213 verts Étape 1 — Router /api/v1/qualify : - POST / → qualify() avec config depuis DB ou defaults - GET /protocol → protocole actif - POST /protocol → créer/remplacer (auth requise) Étape 2 — Modèle QualificationProtocol : - Table qualification_protocols (seuils configurables via admin) - Migration Alembic + seed du protocole par défaut Étape 3 — Wizard frontend decisions/new.vue : - Étape 1 : formulaire de qualification (mandat, affected_count, structurant, contexte) - Étape 2 : résultat (type, raisons, modalités, observatoire, on-chain) - Étape 3 : formulaire de décision (titre, description, protocole si collectif) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,7 @@ from app.models import ( # noqa: F401
|
||||
MandateStep,
|
||||
VotingProtocol,
|
||||
FormulaConfig,
|
||||
QualificationProtocol,
|
||||
SanctuaryEntry,
|
||||
BlockchainCache,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
"""add_qualification_protocol
|
||||
|
||||
Revision ID: b78571ae9e00
|
||||
Revises: 70914b334cfb
|
||||
Create Date: 2026-04-23 17:08:07.161306+00:00
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision: str = 'b78571ae9e00'
|
||||
down_revision: Union[str, None] = '70914b334cfb'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_table(
|
||||
'qualification_protocols',
|
||||
sa.Column('id', sa.Uuid(), nullable=False),
|
||||
sa.Column('name', sa.String(128), nullable=False),
|
||||
sa.Column('description', sa.Text(), nullable=True),
|
||||
sa.Column('small_group_max', sa.Integer(), nullable=False, server_default='5'),
|
||||
sa.Column('collective_wot_min', sa.Integer(), nullable=False, server_default='50'),
|
||||
sa.Column(
|
||||
'default_modalities_json',
|
||||
sa.Text(),
|
||||
nullable=False,
|
||||
server_default='["vote_wot","vote_smith","consultation_avis","election"]',
|
||||
),
|
||||
sa.Column('is_active', sa.Boolean(), nullable=False, server_default='1'),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.func.now()),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_table('qualification_protocols')
|
||||
Reference in New Issue
Block a user