Add scheduled automation task and update URL routing

- Introduced a new scheduled task for executing automation rules every 5 minutes in the Celery beat schedule.
- Updated URL routing to include a new endpoint for automation-related functionalities.
- Refactored imports in various modules to align with the new business layer structure, ensuring backward compatibility for billing models, exceptions, and services.
This commit is contained in:
IGNY8 VPS (Salman)
2025-11-16 22:11:05 +00:00
parent 455358ecfc
commit 7f8982a0ab
40 changed files with 1822 additions and 778 deletions

View File

@@ -31,10 +31,9 @@
- ✅ Preserve all existing API functionality
### Key Principles
- **Backward Compatibility**: All APIs remain unchanged
- **Service Layer Pattern**: Business logic in services, not ViewSets
- **No Breaking Changes**: Response formats unchanged
- **Testable Services**: Services can be tested independently
- **Clean Architecture**: Clear separation between API layer (modules/) and business logic (business/)
---
@@ -413,22 +412,21 @@ class TasksViewSet(SiteSectorModelViewSet):
| Risk | Level | Mitigation |
|------|-------|------------|
| **Breaking API changes** | MEDIUM | Extensive testing, keep response formats identical |
| **Import errors** | MEDIUM | Update all imports systematically |
| **Data loss during migration** | LOW | Backup before migration, test on staging |
| **Service logic errors** | MEDIUM | Unit tests for all services |
| **Model migration complexity** | MEDIUM | Use Django migrations, test thoroughly |
---
## SUCCESS CRITERIA
- ✅ All existing API endpoints work identically
- ✅ Response formats unchanged
- ✅ No breaking changes for frontend
- ✅ Services are testable independently
- ✅ Business logic extracted from ViewSets
- ✅ ViewSets are thin wrappers
- ✅ ViewSets are thin wrappers that delegate to services
- ✅ All models moved to business layer
- ✅ All imports updated correctly
- ✅ Services handle credit checks and business rules
---