- Added new modules for advisor compliance, KYC sessions, and script templates, enhancing the advisor agent's capabilities. - Implemented a comprehensive API structure under the `/api/advisor-agent` prefix, ensuring clear organization and access to new features. - Established database models and repositories for compliance rules and KYC sessions, facilitating robust data management. - Integrated exception handling and response models to improve error management and user feedback. - Updated settings to include new configurations for compliance and KYC features, ensuring flexibility and adaptability. This update significantly expands the advisor agent's functionality, providing essential tools for compliance and customer interaction while maintaining a structured API design.
20 lines
633 B
Python
20 lines
633 B
Python
from fastapi.testclient import TestClient
|
|
|
|
from app.main import app
|
|
|
|
client = TestClient(app)
|
|
|
|
|
|
def test_demo_advisor_staff_token_can_reach_kyc_module():
|
|
login = client.post("/api/auth/login", json={"actor_id": "STAFF-10086", "token_type": "staff"})
|
|
assert login.status_code == 200
|
|
token = login.json()["data"]["access_token"]
|
|
assert "advisor" in login.json()["data"]["roles"]
|
|
|
|
ping = client.get(
|
|
"/api/advisor-agent/kyc/ping",
|
|
headers={"Authorization": f"Bearer {token}", "X-Trace-Id": "trace-demo-kyc"},
|
|
)
|
|
assert ping.status_code == 200
|
|
assert ping.json()["data"]["module"] == "kyc"
|