Courrier v1.7 (tt-2026-11-070) : suivi des demandes par fil de discussion, clore et rouvrir, avertissement de fraicheur

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGaEeWkqZYNP6Wn3mGQsrL
This commit is contained in:
gemini-opsandClaude Sonnet 5.5 committed 2026-11-17 23:57:31 +01:00
1 parent b712ee10cd
commit 44bfbc3a0c
8 files changed
+336 -10

No files matched your search

+35
View File
@@ -503,3 +503,38 @@ def delete_course(course_id: int, db_path: Optional[str] = None) -> bool:
return conn.execute("DELETE FROM courses WHERE id = ?", (course_id,)).rowcount > 0
finally:
conn.close()
# --- Suivi des demandes : fils clos ---
def _suivi_pret(conn: sqlite3.Connection) -> None:
conn.execute("CREATE TABLE IF NOT EXISTS suivi_clos (cle TEXT PRIMARY KEY, dernier_id TEXT NOT NULL, clos_le TEXT NOT NULL)")
def list_suivi_clos(db_path: Optional[str] = None) -> Dict[str, str]:
conn = get_connection(db_path)
try:
_suivi_pret(conn)
return {r["cle"]: r["dernier_id"] for r in conn.execute("SELECT cle, dernier_id FROM suivi_clos").fetchall()}
finally:
conn.close()
def clore_suivi(cle: str, dernier_id: str, db_path: Optional[str] = None) -> None:
conn = get_connection(db_path)
try:
_suivi_pret(conn)
with conn:
conn.execute("INSERT INTO suivi_clos (cle, dernier_id, clos_le) VALUES (?, ?, ?) ON CONFLICT(cle) DO UPDATE SET dernier_id = excluded.dernier_id, clos_le = excluded.clos_le",
(cle, dernier_id, get_tunis_now_iso()))
finally:
conn.close()
def rouvrir_suivi(cle: str, db_path: Optional[str] = None) -> bool:
conn = get_connection(db_path)
try:
_suivi_pret(conn)
with conn:
return conn.execute("DELETE FROM suivi_clos WHERE cle = ?", (cle,)).rowcount > 0
finally:
conn.close()