Owner Must Exist Before Block Assignment
Owner Must Exist Before Block Assignment
Introduced in v0.12.0
Overview
As of v0.12.0, the platform enforces a key business rule: an owner record must exist before a block can be assigned to them. This ensures referential integrity throughout the system and prevents orphaned block assignments.
What This Means
When assigning a block to an owner, the system will now validate that the target owner already exists. If the owner does not exist, the assignment will be rejected with an appropriate error.
Correct Workflow
Follow this order of operations when setting up a new block and owner relationship:
- Create the owner record — Register the owner in the platform first (via the UI or API).
- Assign the block — Once the owner exists, proceed to assign the block to that owner.
Attempting to reverse these steps (assigning a block before the owner exists) will result in a validation error.
Impact on Integrations
If you use the API or any automated scripts to create block assignments, ensure your workflow respects this ordering:
# Correct order
POST /owners → create the owner first
POST /blocks/assign → then assign the block
# Incorrect order (will be rejected as of v0.12.0)
POST /blocks/assign → fails if owner does not exist
Existing Data
Existing valid block-owner relationships are unaffected. However, if your data contains orphaned assignments (blocks linked to owner IDs that do not correspond to any existing owner record), those should be identified and corrected.
Error Handling
When a block assignment is attempted against a non-existent owner, the system will return a validation error. Check your owner ID and confirm the owner record has been successfully created before retrying.