Restructure data model: TrackingConfig + TemplateConfig entities
Some checks failed
Validate / Hassfest (push) Has been cancelled
Some checks failed
Validate / Hassfest (push) Has been cancelled
Major model restructuring for clean separation of concerns: New entities: - TrackingConfig: What to react to (event types, asset filters, periodic/scheduled/memory mode config) - reusable across targets - TemplateConfig: All ~15 template slots from blueprint (event messages, asset formatting, date/location, scheduled messages) with full defaults - separate entities per locale Changed entities: - AlbumTracker: Simplified to album selection + polling + target_ids (removed event_types, template_id, all filter fields) - NotificationTarget: Extended with tracking_config_id and template_config_id FKs (many-to-one, reusable configs) Removed entities: - MessageTemplate (replaced by TemplateConfig) - ScheduledJob (absorbed into TrackingConfig) Updated services: - watcher.py: Each target checked against its own tracking_config for event filtering before sending notification - notifier.py: Uses target's template_config to select the right template slot based on event type New API routes: - /api/tracking-configs/* (CRUD) - /api/template-configs/* (CRUD + per-slot preview) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,12 +17,12 @@ from .services.scheduler import start_scheduler, stop_scheduler
|
||||
from .auth.routes import router as auth_router
|
||||
from .api.servers import router as servers_router
|
||||
from .api.trackers import router as trackers_router
|
||||
from .api.templates import router as templates_router
|
||||
from .api.tracking_configs import router as tracking_configs_router
|
||||
from .api.template_configs import router as template_configs_router
|
||||
from .api.targets import router as targets_router
|
||||
from .api.users import router as users_router
|
||||
from .api.status import router as status_router
|
||||
from .api.sync import router as sync_router
|
||||
from .api.scheduled import router as scheduled_router
|
||||
from .ai.telegram_webhook import router as telegram_ai_router
|
||||
|
||||
logging.basicConfig(
|
||||
@@ -68,12 +68,12 @@ app.add_middleware(
|
||||
app.include_router(auth_router)
|
||||
app.include_router(servers_router)
|
||||
app.include_router(trackers_router)
|
||||
app.include_router(templates_router)
|
||||
app.include_router(tracking_configs_router)
|
||||
app.include_router(template_configs_router)
|
||||
app.include_router(targets_router)
|
||||
app.include_router(users_router)
|
||||
app.include_router(status_router)
|
||||
app.include_router(sync_router)
|
||||
app.include_router(scheduled_router)
|
||||
app.include_router(telegram_ai_router)
|
||||
|
||||
# Serve frontend static files if available
|
||||
|
||||
Reference in New Issue
Block a user