feat: add fixed questions and improve authentication
This commit is contained in:
1 parent
8af4fed89d
commit
4c9f75f31e
42 files changed
+4008
-200
No files matched your search
+30
@@ -0,0 +1,30 @@
|
||||
"""Abstract persistence API for administrator-managed fixed questions."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any
|
||||
|
||||
|
||||
class FixedQuestionStore(ABC):
|
||||
"""Global fixed-question configuration shared by every account."""
|
||||
|
||||
@abstractmethod
|
||||
async def list_questions(self) -> list[dict[str, Any]]:
|
||||
"""Return every configured question in display order."""
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def find_enabled(self, question: str) -> dict[str, Any] | None:
|
||||
"""Return the enabled row whose question exactly equals ``question``."""
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def replace_all(
|
||||
self,
|
||||
rows: list[dict[str, Any]],
|
||||
*,
|
||||
updated_by: str | None = None,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Atomically replace the complete fixed-question configuration."""
|
||||
raise NotImplementedError
|
||||
Reference in new issue
Block a user