main
md 46 lines 2.02 KB
Rendered Raw
1 # notification_create.py DOX
2
3 ## Purpose
4
5 - Own the `notification_create.py` API endpoint.
6 - This module handles notification notification create requests.
7 - Keep this file-level DOX profile synchronized with `notification_create.py` because this directory is intentionally flat.
8
9 ## Ownership
10
11 - `notification_create.py` owns the runtime implementation.
12 - `notification_create.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation.
13 - Classes:
14 - `NotificationCreate` (`ApiHandler`)
15 - `requires_auth(cls) -> bool`
16 - `async process(self, input: dict, request: Request) -> dict | Response`
17
18 ## Runtime Contracts
19
20 - HTTP handlers must derive from `helpers.api.ApiHandler`; WebSocket handlers must derive from `helpers.ws.WsHandler`.
21 - Update this file whenever request payloads, authentication or CSRF requirements, response shapes, route side effects, or WebSocket event contracts change.
22 - `NotificationCreate` is an `ApiHandler`.
23 - `NotificationCreate` defines `process(...)`.
24 - `NotificationCreate` defines `requires_auth(...)`.
25 - Imported dependency areas include: `flask`, `helpers.api`, `helpers.notification`.
26
27 ## Key Concepts
28
29 - Important called helpers/classes observed in the source: `NotificationManager.send_notification`, `NotificationType`, `notification.output`, `notification_type.lower`.
30 - Keep request/response, tool, or helper semantics documented here at the same time as source changes.
31
32 ## Work Guidance
33
34 - Preserve authentication, CSRF, loopback, and API-key checks unless the endpoint contract explicitly changes.
35 - Update frontend callers, plugin callers, and tests together when payload shape changes.
36 - Use `helpers.api.Response` for non-JSON responses, files, redirects, or status-specific replies.
37
38 ## Verification
39
40 - Run endpoint-specific or API/WebSocket tests for changed behavior; smoke-test browser callers when no focused test exists.
41 - Related tests observed by source search:
42 - `tests/test_download_toast_regressions.py`
43
44 ## Child DOX Index
45
46 No child DOX files.