Metadata-Version: 2.4
Name: iil-platform-notifications
Version: 0.1.0
Summary: Platform-wide multi-channel notification registry (ADR-088)
Author: Achim Dehnert
License: MIT
Requires-Python: >=3.10
Requires-Dist: celery>=5.3
Requires-Dist: django>=4.2
Requires-Dist: httpx>=0.25
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest-django>=4.5; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: sms
Requires-Dist: twilio>=8.0; extra == 'sms'
Description-Content-Type: text/markdown

# platform-notifications

> Platform-wide multi-channel notification registry (ADR-088)

## Overview

Unified notification system with channel abstraction, Celery-First
async delivery, audit logging, and thread-safe registry pattern.

## Installation

```bash
pip install -e packages/platform-notifications
pip install -e "packages/platform-notifications[sms]"  # for Twilio SMS
```

## Usage

```python
from platform_notifications.service import NotificationService, Notification

NotificationService.send(Notification(
    tenant_id=request.tenant_id,
    channel="email",
    recipient="user@example.com",
    subject="Welcome",
    body="Hello from the platform!",
    source_app="wedding-hub",
    source_event="rsvp_confirmation",
))
```

## Built-in Channels

- **email** — Django `send_mail`
- **sms** — Twilio (requires `twilio` extra)
- **webhook** — Generic HTTPS POST via `httpx`

## Configuration

```python
# config/settings/base.py
PLATFORM_NOTIFICATIONS = {
    "DEFAULT_CHANNELS": ["email"],
    "RETRY_MAX": 3,
    "RETRY_BACKOFF": True,
    "RETRY_BACKOFF_MAX": 300,
    "LOG_RETENTION_DAYS": 90,
}
```

## Database

Run: `python manage.py migrate platform_notifications`

## Related ADRs

- **ADR-088**: Notification Registry
- **ADR-045**: Secret Management (Twilio, Discord, Telegram)
- **ADR-072**: Schema Isolation (Row-Level deviation documented)
