Organization Synchronization Use Cases and Testing
Date: July 24, 2025
App: SoftwareCatalog
Feature: Organization Synchronization with OpenRegister
๐จ QUICK REFERENCE FOR NEW CONVERSATIONโ
Current Implementation Statusโ
- โ Anonymous user registration: Fixed "No user logged in" error
- โ Ownership assignment: Implemented automatic ownership transfer
- โ User status management: Implemented activation/deactivation based on organization status
- โ Admin user protection: Admin users remain unaffected by organization status changes
- ๐ Testing needed: Anonymous user registration via OpenConnector
Key API Endpointsโ
# Anonymous registration (MAIN TEST)
POST http://nextcloud.local/index.php/apps/openconnector/api/endpoint/register
# Authenticated organization management
POST http://localhost/index.php/apps/openregister/api/objects/6/35
PUT http://localhost/index.php/apps/openregister/api/objects/6/35/{UUID}
GET http://localhost/index.php/apps/openregister/api/organisations/{UUID}
Essential Commandsโ
# User management
docker-compose exec -u 33 nextcloud php /var/www/html/occ user:list
docker-compose exec -u 33 nextcloud php /var/www/html/occ user:info {username}
# Log monitoring
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep -i "softwarecatalog"
# Configuration
docker-compose exec -u 33 nextcloud php /var/www/html/occ config:app:get softwarecatalog voorzieningen_organisatie_schema
Architecture Summaryโ
- Objects: OpenRegister schema-managed data (organisatie, contactpersoon)
- Entities: Nextcloud entities (organisation, user)
- Flow: Object creation โ Entity creation โ User creation โ Ownership assignment
Next Priority Testโ
- Test anonymous user registration via OpenConnector
- Verify user creation and ownership assignment
- Test organization status changes affect user status
Overviewโ
This document outlines the use cases and testing scenarios for the new organization synchronization functionality in the Software Catalog app. The feature enables automatic synchronization between SoftwareCatalog organizations and OpenRegister, along with user status management based on organization status.
Use Casesโ
1. Organization Creation Synchronizationโ
Scenario: A new organization is created in SoftwareCatalog
Expected Behavior:
- Organization data is automatically synced to OpenRegister
- Status mapping:
actiefโactive: true,inactief/deactiefโactive: false - Organization UUID is preserved across both systems
- Contactpersonen are processed and users are created (inactive initially)
Test Steps:
- Create a new organization in SoftwareCatalog with status
actief - Verify organization appears in OpenRegister with
active: true - Verify organization UUID is identical in both systems
- Create contactpersonen for the organization
- Verify users are created but set to inactive initially
2. Organization Status Change - Activationโ
Scenario: Organization status changes from inactief to actief
Expected Behavior:
- Organization is updated in OpenRegister with
active: true - All users in the organization are activated
- Activation email is sent to the organization
- Contactpersonen processing continues normally
Test Steps:
- Create organization with status
inactief - Add contactpersonen (users will be inactive)
- Change organization status to
actief - Verify all users become active
- Verify activation email is sent
- Verify organization has
active: truein OpenRegister
3. Organization Status Change - Deactivationโ
Scenario: Organization status changes from actief to inactief
Expected Behavior:
- Organization is updated in OpenRegister with
active: false - All users in the organization are deactivated
- Users cannot log in but accounts are preserved
Test Steps:
- Create organization with status
actief - Add contactpersonen (users will be active)
- Change organization status to
inactief - Verify all users become inactive
- Verify users cannot log in
- Verify organization status is
inactivein OpenRegister
4. Organization Deletionโ
Scenario: Organization is deleted from SoftwareCatalog
Expected Behavior:
- All users in the organization are deactivated
- Organization data is preserved in OpenRegister (no automatic deletion)
- Users cannot log in but accounts are preserved
Test Steps:
- Create organization with contactpersonen
- Delete the organization
- Verify all users become inactive
- Verify users cannot log in
- Verify organization still exists in OpenRegister
5. Contactpersoon Creation and Organization Membershipโ
Scenario: A new contactpersoon is created for an organization
Expected Behavior:
- User account is created (inactive initially)
- Username is added to organization's
usersarray - User is assigned to appropriate groups based on roles
- Organization membership is properly established
Test Steps:
- Create organization in SoftwareCatalog
- Create contactpersoon for the organization
- Verify user account is created
- Verify username is added to organization's users list
- Verify user is assigned to appropriate groups
- Verify user status matches organization status
6. Contactpersoon Update and Organization Membershipโ
Scenario: An existing contactpersoon is updated
Expected Behavior:
- User account is updated if needed
- Username remains in organization's
usersarray - Group assignments are updated based on role changes
- Organization membership is maintained
Test Steps:
- Create organization with contactpersoon
- Update contactpersoon roles or details
- Verify user account is updated
- Verify username remains in organization's users list
- Verify group assignments are updated
- Verify organization membership is maintained
7. Cross-System UUID Consistencyโ
Scenario: Organizations and contactpersonen use UUIDs across systems
Expected Behavior:
- Organization UUIDs are identical in SoftwareCatalog and OpenRegister
- Contactpersoon UUIDs are preserved during processing
- UUID-based lookups work correctly in both systems
Test Steps:
- Create organization and note UUID
- Verify same UUID appears in OpenRegister
- Create contactpersoon and note UUID
- Verify UUID is preserved during user creation
- Test UUID-based lookups in both systems
8. SoftwareCatalog-Specific User Status Managementโ
Scenario: Organization status changes affect only SoftwareCatalog-specific users (from contactpersoon objects), while admin group users remain protected.
Expected Behavior:
- When organization becomes
inactief: Only contactpersoon users are deactivated - When organization becomes
actief: Only contactpersoon users are activated - Admin group users are never affected by organization status changes
- Contactpersoon users are identified by their usernames in the organization's contactpersonen array
Test Steps:
- Create organization with status
actief - Create contactpersonen for the organization (users will be active)
- Add admin users to admin group (they should remain unaffected)
- Change organization status to
inactief - Verify only contactpersoon users become inactive
- Verify admin users remain active
- Change organization status back to
actief - Verify only contactpersoon users become active again
9. Contact Person User Creation and Managementโ
Scenario: Contact persons are automatically converted to user accounts and managed based on organization status.
Expected Behavior:
- Contact person creation triggers user account creation
- Username is generated from contact person data
- User status matches organization status
- User is added to organization's users list
- User can be activated/deactivated with organization status changes
Test Steps:
- Create organization in SoftwareCatalog
- Create contact person with organization reference
- Verify user account is created
- Verify username is added to organization's users list
- Verify user status matches organization status
- Test organization status changes affect user status
10. Admin Group User Protectionโ
Scenario: Admin group users are completely protected from organization status changes.
Expected Behavior:
- Admin group users are always added to organizations
- Admin group users are never deactivated when organization becomes inactive
- Admin group users remain active regardless of organization status
- Only SoftwareCatalog-specific users (contactpersonen) are affected by status changes
Test Steps:
- Create organization with admin users present
- Add additional users to admin group
- Create contact persons for the organization
- Deactivate organization
- Verify admin users remain active
- Verify contact person users are deactivated
- Reactivate organization
- Verify admin users remain active
- Verify contact person users are reactivated
11. Bulk User Managementโ
Scenario: Organizations with multiple contact persons can be managed in bulk.
Expected Behavior:
- Multiple contact persons can be created for an organization
- All contact person users are managed together
- Bulk activation/deactivation works correctly
- Admin users remain protected during bulk operations
Test Steps:
- Create organization
- Create multiple contact persons (5-10 users)
- Verify all users are created and active
- Deactivate organization
- Verify all contact person users are deactivated
- Verify admin users remain active
- Reactivate organization
- Verify all contact person users are reactivated
12. Nested Contact Person Objectsโ
Scenario: Contact persons are created as nested objects within organizations rather than as separate objects.
Expected Behavior:
- Organizations can contain nested contact person objects
- Nested contact persons are automatically processed for user creation
- User accounts are created for each nested contact person
- User status matches organization status
- Nested contact persons respond to organization status changes
Test Steps:
- Create organization with nested contact persons in the
contactpersonenarray - Verify contact persons are properly linked to the organization
- Verify user accounts are created for each nested contact person
- Test organization status changes affect nested contact person users
- Verify admin users remain unaffected
13. Mixed Contact Person Creation Methodsโ
Scenario: Organizations can have both nested contact persons and separately created contact persons.
Expected Behavior:
- Organizations can contain both nested and separate contact persons
- All contact persons (nested and separate) are properly managed
- User management works consistently regardless of creation method
- Organization status changes affect all contact person users uniformly
Test Steps:
- Create organization with some nested contact persons
- Add additional contact persons via separate API calls
- Verify all contact persons are properly linked and managed
- Test organization status changes affect all users consistently
- Verify admin users remain protected throughout the process
14. Anonymous User Registration via OpenConnectorโ
Scenario: Anonymous users register organizations through OpenConnector without having existing user accounts or organization entities.
Expected Behavior:
- Anonymous user can create organization via OpenConnector endpoint
- System automatically creates organization entity in OpenRegister
- System creates user account for primary contact person
- Newly created user becomes owner of organization and contact person objects
- Organization entity is properly linked to all objects
- User can log in and access their organization
Test Steps:
- Anonymous user submits organization registration via OpenConnector
- Verify organization object is created with admin as temporary owner
- Verify organization entity is created in OpenRegister
- Verify user account is created for primary contact person
- Verify ownership is transferred to newly created user
- Verify organization references are properly set
- Test user login and access to their organization
15. OpenRegister Objects vs Entities Architectureโ
Scenario: Understanding the distinction between OpenRegister objects and entities for proper system integration.
OpenRegister Objects:
- Abstract data structures managed by schemas
- Stored in
oc_openregister_objectstable - Have UUID, owner, organization, and schema-specific fields
- Examples:
organisatie(schema 35),contactpersoon(schema 34) - Created via REST API endpoints with register/schema parameters
- Support complex relationships and nested structures
OpenRegister Entities:
- Classic Nextcloud entities with dedicated tables
- Stored in specific entity tables (e.g.,
oc_openregister_organisations) - Have ID, UUID, name, status, and entity-specific fields
- Examples:
organisationentity,userentity - Created via entity-specific API endpoints
- Support standard Nextcloud entity operations
Conversion Process:
- Object creation triggers event listeners
- Event listeners create corresponding entities
- Entities are linked back to objects via UUID references
- Ownership and relationships are established
- System maintains consistency between objects and entities
Expected Behavior:
- Objects and entities maintain UUID consistency
- Changes to objects trigger entity updates
- Entity changes can trigger object updates (bidirectional sync)
- Proper ownership and relationship management
- Consistent data across both systems
Testing Scenariosโ
Test Environment Setupโ
Prerequisites:
- SoftwareCatalog app enabled
- OpenRegister app enabled
- Proper schema and register configuration
- Test organization and contactpersoon schemas configured
Configuration Required:
// SettingsService configuration
'voorzieningen_organisatie_schema' => '37', // Organization schema ID
'voorzieningen_contactpersoon_schema' => '38', // Contactpersoon schema ID
'voorzieningen_register' => '1', // Register ID
Test Data Requirementsโ
Organization Test Data:
{
"naam": "Test Organization",
"type": "Gemeente",
"website": "https://test.org",
"beoordeling": "actief",
"adres": "Test Street 123",
"postcode": "1234 AB",
"plaats": "Test City",
"telefoon": "+31 123 456 789",
"email": "info@test.org"
}
Contactpersoon Test Data:
{
"voornaam": "John",
"achternaam": "Doe",
"email": "john.doe@test.org",
"telefoon": "+31 123 456 789",
"functie": "Manager",
"organisation": "ORGANIZATION_UUID",
"roles": ["Functioneel-beheerder", "Gebruik-beheerder"]
}
Automated Test Casesโ
Test Case 1: Organization Creation Flowโ
// Test organization creation and OpenRegister sync
public function testOrganizationCreationSync(): void
{
// 1. Create organization in SoftwareCatalog
$organizationData = $this->createTestOrganization();
$organization = $this->createOrganization($organizationData);
// 2. Verify organization exists in OpenRegister
$openRegisterOrg = $this->findOrganizationInOpenRegister($organization->getUuid());
$this->assertNotNull($openRegisterOrg);
$this->assertEquals('active', $openRegisterOrg->getStatus());
// 3. Verify UUID consistency
$this->assertEquals($organization->getUuid(), $openRegisterOrg->getUuid());
}
Test Case 2: User Status Managementโ
// Test user activation/deactivation based on organization status
public function testUserStatusManagement(): void
{
// 1. Create organization with inactive status
$organization = $this->createOrganization(['beoordeling' => 'inactief']);
// 2. Add contactpersoon
$contactpersoon = $this->createContactpersoon($organization->getUuid());
// 3. Verify user is inactive
$user = $this->userManager->get($contactpersoon->getUsername());
$this->assertFalse($user->isEnabled());
// 4. Activate organization
$this->updateOrganization($organization->getUuid(), ['beoordeling' => 'actief']);
// 5. Verify user is now active
$user = $this->userManager->get($contactpersoon->getUsername());
$this->assertTrue($user->isEnabled());
}
Test Case 3: Organization Membershipโ
// Test contactpersoon organization membership
public function testOrganizationMembership(): void
{
// 1. Create organization
$organization = $this->createOrganization();
// 2. Create contactpersoon
$contactpersoon = $this->createContactpersoon($organization->getUuid());
// 3. Verify username is in organization's users list
$orgData = $organization->getObject();
$this->assertContains($contactpersoon->getUsername(), $orgData['users']);
}
Manual Testing Checklistโ
Organization Managementโ
- Create organization with
actiefstatus - Verify organization appears in OpenRegister with
activestatus - Create organization with
inactiefstatus - Verify organization appears in OpenRegister with
inactivestatus - Update organization status from
inactieftoactief - Verify all users become active
- Update organization status from
actieftoinactief - Verify all users become inactive
- Delete organization
- Verify all users become inactive
Contactpersoon Managementโ
- Create contactpersoon for active organization
- Verify user is created and active
- Verify username is added to organization's users list
- Create contactpersoon for inactive organization
- Verify user is created but inactive
- Update contactpersoon roles
- Verify group assignments are updated
- Verify organization membership is maintained
Error Handlingโ
- Test with missing OpenRegister configuration
- Test with invalid organization UUID
- Test with missing contactpersoon data
- Test with network connectivity issues
- Verify graceful error handling and logging
Performance Considerationsโ
Expected Performanceโ
- Organization sync: < 2 seconds
- User status updates: < 1 second per user
- Contactpersoon processing: < 3 seconds
- Organization membership updates: < 1 second
Monitoring Pointsโ
- Event listener execution time
- OpenRegister API response times
- User management operation times
- Database query performance
- Memory usage during bulk operations
Security Considerationsโ
Data Protectionโ
- Organization UUIDs are preserved across systems
- User credentials are not shared between systems
- Organization data is mapped securely
- Access controls are maintained per system
Audit Trailโ
- All organization sync operations are logged
- User status changes are tracked
- Organization membership updates are recorded
- Error conditions are logged with context
Troubleshootingโ
Common Issuesโ
Organization not syncing to OpenRegister:
- Check OpenRegister app is enabled
- Verify schema and register configuration
- Check network connectivity
- Review error logs for specific issues
Users not activating/deactivating:
- Verify organization status changes are detected
- Check user manager permissions
- Review contactpersoon organization assignments
- Check for conflicting group assignments
UUID mismatches:
- Verify organization creation order
- Check for duplicate organization creation
- Review UUID generation and assignment
- Verify cross-system UUID consistency
Debug Commandsโ
# Check organization sync status
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ softwarecatalog:debug:organization-sync
# Check user status for organization
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ softwarecatalog:debug:user-status --organization=UUID
# Check organization membership
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ softwarecatalog:debug:organization-membership --organization=UUID
Future Enhancementsโ
Planned Featuresโ
- Bidirectional sync (OpenRegister โ SoftwareCatalog)
- Bulk organization operations
- Advanced status mapping
- Custom field synchronization
- Real-time sync notifications
Integration Pointsโ
- Email notification system
- Group management system
- User hierarchy management
- Audit trail system
- Reporting and analytics
Conclusionโ
The organization synchronization feature provides seamless integration between SoftwareCatalog and OpenRegister, ensuring data consistency and proper user management. The comprehensive testing framework ensures reliable operation across various scenarios and edge cases.
For questions or issues, refer to the SoftwareCatalog documentation or contact the development team.