Make contractor residence optional with visibility rules
- Make residence_id nullable in contractor model - Add created_by_id field to track contractor creator - Update access control: personal contractors visible only to creator, residence contractors visible to all residence users - Add database migration for schema changes - Update admin panel DTOs and handlers for optional residence - Fix test utilities for new model structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
4
migrations/003_contractor_optional_residence.down.sql
Normal file
4
migrations/003_contractor_optional_residence.down.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Revert: Make residence_id required again
|
||||
-- WARNING: This will fail if there are contractors with NULL residence_id
|
||||
|
||||
ALTER TABLE task_contractor ALTER COLUMN residence_id SET NOT NULL;
|
||||
Reference in New Issue
Block a user