refactor(backend): update API routes and service layer

- Update agent router/service/repository with new endpoints
- Update auth routes with phone-based authentication
- Update users service with new phone lookup
- Update schedule_items with new schemas
- Update message schemas with visibility support
- Update settings with new automation scheduler config
- Update CLI with new commands
- Update tests to match new API contracts
This commit is contained in:
qzl
2026-03-19 18:42:59 +08:00
parent 641d847008
commit f0af44d840
36 changed files with 1083 additions and 1853 deletions
@@ -52,7 +52,7 @@ def test_share_schedule_item_returns_200() -> None:
response = client.post(
f"/api/v1/schedule-items/{item_id}/share",
json={
"email": "friend@example.com",
"phone": "+8613810000000",
"permission_view": True,
"permission_edit": False,
"permission_invite": True,
@@ -62,7 +62,7 @@ def test_share_schedule_item_returns_200() -> None:
body = response.json()
assert body["message"] == "Calendar invitation sent"
assert service.last_share_request is not None
assert service.last_share_request.email == "friend@example.com"
assert service.last_share_request.phone == "+8613810000000"
assert service.last_share_request.permission_invite is True
finally:
app.dependency_overrides = {}