mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 08:31:08 -05:00
Refactor API structure and add comprehensive user management features
- Restructure API v1 with improved serializers organization - Add user deletion requests and moderation queue system - Implement bulk moderation operations and permissions - Add user profile enhancements with display names and avatars - Expand ride and park API endpoints with better filtering - Add manufacturer API with detailed ride relationships - Improve authentication flows and error handling - Update frontend documentation and API specifications
This commit is contained in:
38
.clinerules/django-moderation-integration.md
Normal file
38
.clinerules/django-moderation-integration.md
Normal file
@@ -0,0 +1,38 @@
|
||||
## Brief overview
|
||||
Guidelines for integrating new Django moderation systems while preserving existing functionality, based on ThrillWiki project patterns. These rules ensure backward compatibility and proper integration when extending moderation capabilities.
|
||||
|
||||
## Integration approach
|
||||
- Always preserve existing models and functionality when adding new moderation features
|
||||
- Use comprehensive model integration rather than replacement - combine original and new models in single files
|
||||
- Maintain existing method signatures and property aliases for backward compatibility
|
||||
- Fix field name mismatches systematically across services, selectors, and related components
|
||||
|
||||
## Django model patterns
|
||||
- All models must inherit from TrackedModel base class and use pghistory for change tracking
|
||||
- Use proper Meta class inheritance: `class Meta(TrackedModel.Meta):`
|
||||
- Maintain comprehensive business logic methods on models (approve, reject, escalate)
|
||||
- Include property aliases for backward compatibility when field names change
|
||||
|
||||
## Service and selector updates
|
||||
- Update services and selectors to match restored model field names systematically
|
||||
- Use proper field references: `user` instead of `submitted_by`, `created_at` instead of `submitted_at`
|
||||
- Maintain transaction safety with `select_for_update()` in services
|
||||
- Keep comprehensive error handling and validation in service methods
|
||||
|
||||
## Migration strategy
|
||||
- Create migrations incrementally and handle field changes with proper defaults
|
||||
- Test Django checks after each major integration step
|
||||
- Apply migrations immediately after creation to verify database compatibility
|
||||
- Handle nullable field changes with appropriate migration prompts
|
||||
|
||||
## Documentation requirements
|
||||
- Update docs/types-api.ts with complete TypeScript interface definitions
|
||||
- Update docs/lib-api.ts with comprehensive API client implementation
|
||||
- Ensure full type safety and proper error handling in TypeScript clients
|
||||
- Document all new API endpoints and integration patterns
|
||||
|
||||
## Testing and validation
|
||||
- Run Django system checks after each integration step
|
||||
- Verify existing functionality still works after adding new features
|
||||
- Test both original workflow and new moderation system functionality
|
||||
- Confirm database migrations apply successfully without errors
|
||||
Reference in New Issue
Block a user