1d445f3980
Rework entity schema: rename Tracker→NotificationTracker, add CommandConfig/ CommandTracker/CommandTrackerListener entities for decoupled command handling. Commands now resolve through CommandTracker→CommandConfig instead of TelegramBot.commands_config. Smart ref-counted bot polling based on active listeners. Add chat_action to telegram targets. Full frontend CRUD pages for command configs and command trackers. Idempotent SQLite migrations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.7 KiB
2.7 KiB
Feature: Entity Relationship Refactor
Branch: feature/entity-relationship-refactor
Base branch: master
Created: 2026-03-20
Status: ✅ Complete
Strategy: Incremental
Mode: Automated
Execution: Orchestrator
Summary
Rework the entity schema so that ServiceProvider capabilities (notifications, commands) are inferred from provider type config. Current Trackers become NotificationTrackers. A new CommandTracker entity links providers to CommandConfigs and CommandsListeners (TelegramBot as first implementation). TelegramBot becomes dual-purpose: notification target backend + commands listener with smart ref-counted polling/webhook. CommandConfig is a new shareable entity scoped to provider type. Telegram targets gain a chat_action setting.
Build & Test Commands
- Build (backend):
cd packages/server && pip install -e . - Verify (backend): Server startup +
curl -s http://localhost:8420/api/health - Build (frontend):
cd frontend && npm install && npx vite build - Test: No automated test suite yet — verification via server startup and frontend build
Phases
- Phase 1: Database Schema & Migration [domain: backend] → subplan
- Phase 2: Notification Tracker Rename (API) [domain: backend] → subplan
- Phase 3: CommandConfig & CommandTracker CRUD [domain: backend] → subplan
- Phase 4: Command System Refactor [domain: backend] → subplan
- Phase 5: Frontend Rename & Restructure [domain: frontend] → subplan
- Phase 6: Frontend Command Entities [domain: frontend] → subplan
- Phase 7: Integration & Cleanup [domain: fullstack] → subplan
Phase Progress Log
| Phase | Domain | Status | Review | Build | Committed |
|---|---|---|---|---|---|
| Phase 1: DB Schema & Migration | backend | ✅ Complete | ✅ | ✅ | ✅ |
| Phase 2: Notification Tracker Rename | backend | ✅ Complete | ✅ | ✅ | ✅ |
| Phase 3: Command Entities API | backend | ✅ Complete | ✅ | ✅ | ✅ |
| Phase 4: Command System Refactor | backend | ✅ Complete | ✅ | ✅ | ✅ |
| Phase 5: Frontend Rename | frontend | ✅ Complete | ✅ | ✅ | ✅ |
| Phase 6: Frontend Commands | frontend | ✅ Complete | ✅ | ✅ | ✅ |
| Phase 7: Integration & Cleanup | fullstack | ✅ Complete | ✅ | ✅ | ✅ |
Final Review
- Comprehensive code review
- Full build passes
- Full test suite passes
- Merged to
master