feat: Controllo accessi RFID completo con gestione sessioni
- Aggiunto supporto multi-pattern RFID (US/IT layout) - Implementata invalidazione sessioni al restart del server - Schermata "badge non trovato" con countdown 30s - Notifica quando badge validatore passato senza utente - Database aggiornato con badge reali di test - Layout ottimizzato per tablet orizzontale - Banner NumLock per desktop - Toggle visibilità password - Carosello benvenuto multilingua (10 lingue) - Pagina debug RFID (/debug)
This commit is contained in:
21
backend-mock/schemas/__init__.py
Normal file
21
backend-mock/schemas/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Focolari Voting System - Schemas Package
|
||||
"""
|
||||
|
||||
from .models import (
|
||||
LoginRequest,
|
||||
EntryRequest,
|
||||
UserResponse,
|
||||
RoomInfoResponse,
|
||||
LoginResponse,
|
||||
EntryResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"LoginRequest",
|
||||
"EntryRequest",
|
||||
"UserResponse",
|
||||
"RoomInfoResponse",
|
||||
"LoginResponse",
|
||||
"EntryResponse",
|
||||
]
|
||||
50
backend-mock/schemas/models.py
Normal file
50
backend-mock/schemas/models.py
Normal file
@@ -0,0 +1,50 @@
|
||||
"""
|
||||
Focolari Voting System - Modelli Pydantic
|
||||
"""
|
||||
|
||||
from typing import Optional, Literal
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class LoginRequest(BaseModel):
|
||||
"""Richiesta login validatore"""
|
||||
badge: str
|
||||
password: str
|
||||
|
||||
|
||||
class EntryRequest(BaseModel):
|
||||
"""Richiesta ingresso partecipante"""
|
||||
user_badge: str
|
||||
validator_password: str
|
||||
|
||||
|
||||
class UserResponse(BaseModel):
|
||||
"""Risposta dati utente"""
|
||||
badge_code: str
|
||||
nome: str
|
||||
cognome: str
|
||||
url_foto: str
|
||||
ruolo: Literal["Tecnico", "Votante", "Ospite"]
|
||||
ammesso: bool
|
||||
warning: Optional[str] = None
|
||||
|
||||
|
||||
class RoomInfoResponse(BaseModel):
|
||||
"""Risposta info sala"""
|
||||
room_name: str
|
||||
meeting_id: str
|
||||
server_start_time: int # Timestamp avvio server per invalidare sessioni
|
||||
|
||||
|
||||
class LoginResponse(BaseModel):
|
||||
"""Risposta login"""
|
||||
success: bool
|
||||
message: str
|
||||
token: Optional[str] = None
|
||||
|
||||
|
||||
class EntryResponse(BaseModel):
|
||||
"""Risposta richiesta ingresso (asettica, senza welcome_message)"""
|
||||
success: bool
|
||||
message: str
|
||||
Reference in New Issue
Block a user