Organization Synchronization Testing Guide
Date: July 24, 2025
App: SoftwareCatalog
Feature: Organization Synchronization with OpenRegister
๐จ ESSENTIAL INFORMATION FOR NEW CONVERSATIONโ
Current Statusโ
- โ
Cron-based synchronization implemented: Replaced event-driven system with
OrganizationSyncService - โ Manual sync trigger available: "Sync Now" button in settings UI
- โ Comprehensive logging implemented: All sync steps logged for debugging
- โ
Background job registered:
OrganizationContactSyncJobruns every 5 minutes - ๐ Testing needed: Verify cron job execution and manual sync functionality
Critical API Endpointsโ
SoftwareCatalog Sync API (NEW)โ
# Manual sync trigger
curl -u 'admin:admin' -X POST 'http://localhost/index.php/apps/softwarecatalog/api/settings/sync'
# Get sync status
curl -u 'admin:admin' 'http://localhost/index.php/apps/softwarecatalog/api/settings/sync-status'
# Check sync configuration
curl -u 'admin:admin' 'http://localhost/index.php/apps/softwarecatalog/api/settings'
OpenRegister API (Authenticated)โ
# Create organization object
curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST \
'http://localhost/index.php/apps/openregister/api/objects/6/35' \
-d '{"naam":"Test Org","website":"https://test.org","type":"Leverancier","beoordeling":"actief"}'
# Update organization object
curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT \
'http://localhost/index.php/apps/openregister/api/objects/6/35/{UUID}' \
-d '{"naam":"Updated Org","beoordeling":"inactief"}'
# Get organization object
curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{UUID}'
# Get organization entity
curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/organisations/{UUID}'
OpenConnector API (Anonymous)โ
# Anonymous user registration (MAIN TEST SCENARIO)
curl -X POST 'http://nextcloud.local/index.php/apps/openconnector/api/endpoint/register' \
-H 'Content-Type: application/json' \
-d '{
"naam": "Anonymous Test Org",
"website": "https://anonymous-test.org",
"type": "Gemeente",
"beoordeling": "actief",
"contactpersonen": [
{
"voornaam": "Anonymous",
"achternaam": "Contact1",
"email": "anonymous.contact1@test.org",
"telefoon": "+31 555 555 555",
"functie": "Manager"
}
]
}'
Essential Commandsโ
Docker Container Accessโ
# Access Nextcloud container
cd /home/rubenlinde/nextcloud-docker-dev
docker-compose exec nextcloud bash
# Run commands as www-data user (required for file operations)
docker-compose exec -u 33 nextcloud bash
User Managementโ
# List all users
docker-compose exec -u 33 nextcloud php /var/www/html/occ user:list
# Get user details
docker-compose exec -u 33 nextcloud php /var/www/html/occ user:info {username}
# Check user status (enabled/disabled)
docker-compose exec -u 33 nextcloud php /var/www/html/occ user:info {username} | grep enabled
Configurationโ
# Check SoftwareCatalog configuration
docker-compose exec -u 33 nextcloud php /var/www/html/occ config:app:get softwarecatalog voorzieningen_organisatie_schema
docker-compose exec -u 33 nextcloud php /var/www/html/occ config:app:get softwarecatalog voorzieningen_contactpersoon_schema
docker-compose exec -u 33 nextcloud php /var/www/html/occ config:app:get softwarecatalog voorzieningen_register
Log Readingโ
Real-time Log Monitoringโ
# Follow logs in real-time
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log
# Filter for OrganizationSyncService events (NEW)
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep -i "organizationsyncservice"
# Filter for SoftwareCatalog events
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep -i "softwarecatalog"
# Filter for specific organization UUID
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep "{UUID}"
# Filter for user activation/deactivation
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep -E "becameActive|becameInactive|activate|deactivate"
Log Analysisโ
# Get last 50 log entries
docker-compose exec nextcloud tail -n 50 /var/www/html/data/nextcloud.log
# Search for specific error
docker-compose exec nextcloud grep -i "no user logged in" /var/www/html/data/nextcloud.log
# Search for organization sync events
docker-compose exec nextcloud grep -i "sync.*organization" /var/www/html/data/nextcloud.log
# Search for background job execution
docker-compose exec nextcloud grep -i "organizationcontactsyncjob" /var/www/html/data/nextcloud.log
Schema Configurationโ
- Register ID: 6 (Voorzieningen)
- Organisatie Schema ID: 35
- Contactpersoon Schema ID: 34
- Gebruiker Schema ID: 42
Key Architecture Conceptsโ
Cron-Based Synchronization (NEW)โ
- Background Job:
OrganizationContactSyncJobruns every 5 minutes - Service:
OrganizationSyncServicehandles all synchronization logic - Manual Trigger: "Sync Now" button in settings UI or API endpoint
- Flow: Cron job โ Service โ Object processing โ Entity creation โ User management
OpenRegister Objects vs Entitiesโ
- Objects: Abstract data structures managed by schemas (e.g.,
organisatieobject at register 6, schema 35) - Entities: Classic Nextcloud entities (e.g.,
organisationentity,userentity) - Flow: Anonymous user creates
organisatieobject โ System createsorganisationentity anduserentity โ New user becomes owner
Event Flowโ
- Object creation triggers
ObjectCreatedEvent - Event listener calls
handleNewOrganization() syncOrganizationWithOpenRegister()creates organization entityprocessOrganization()creates user accountshandleOwnershipAssignment()transfers ownership to new users
Current Test Scenariosโ
1. Cron-Based Synchronization (PRIORITY)โ
- Status: โ Code implemented, ๐ Testing needed
- Background Job:
OrganizationContactSyncJobruns every 5 minutes - Manual Trigger:
POST /apps/softwarecatalog/api/settings/sync - Expected: Organizations synchronized, entities created, users managed
- Logging: Comprehensive step-by-step logging in
OrganizationSyncService
2. Anonymous User Registration (PRIORITY)โ
- Status: โ Code implemented, ๐ Testing needed
- Endpoint:
POST /apps/openconnector/api/endpoint/register - Expected: Organization created, users created, ownership assigned
- Previous Error: "No user logged in" - โ FIXED
2. Nested Contactpersoon Objectsโ
- Status: โ Documented, ๐ Testing needed
- Endpoint:
POST /apps/openregister/api/objects/6/35with nested contactpersonen - Expected: Contact persons processed, users created
3. User Status Managementโ
- Status: โ Implemented, ๐ Testing needed
- Test: Change organization
beoordelingfromactieftoinactief - Expected: Only SoftwareCatalog users deactivated, admin users protected
Known Issues and Solutionsโ
1. "No user logged in" Errorโ
- Problem:
OrganisationService->createOrganisation()requires user context - Solution: โ
Modified
createOrganisationInOpenRegister()to detect anonymous context and use mapper directly - Status: โ FIXED
2. Ownership Assignmentโ
- Problem: Anonymous users need ownership transferred after creation
- Solution: โ
Added
handleOwnershipAssignment()method - Status: โ IMPLEMENTED
3. Organization Referencesโ
- Problem: Objects need proper organization entity references
- Solution: โ
Ownership assignment sets
organisationfield on all objects - Status: โ IMPLEMENTED
4. UUID Format Mismatch (CURRENT ISSUE)โ
- Problem: Organization object UUIDs use standard format (with hyphens:
ddaf232b-acbc-4396-946d-f80ccc2d3eb1) but OpenRegister expects 32-character hex strings (without hyphens:ddaf232bacbc4396946df80ccc2d3eb1) - Error:
"Field 'uuid' doesn't have a default value"when creating organization entities - Root Cause: OpenConnector tries to create organization entity immediately, before SoftwareCatalog event listener can process it
- Solution: โ
Implemented UUID format conversion in
createOrganisationInOpenRegister()method - Status: ๐ PARTIALLY FIXED - Works for authenticated API calls, but OpenConnector still has the issue
- Next Steps: Need to fix OpenConnector's
ObjectService::createFromArray()method to handle UUID format conversion
Next Steps for New Conversationโ
- Test Cron-Based Synchronization: Monitor background job execution and logs
- Test Manual Sync Trigger: Use "Sync Now" button or API endpoint
- Test Anonymous User Registration: Use OpenConnector endpoint with Postman/curl
- Verify User Creation: Check if contact person users are created
- Verify Ownership Assignment: Check object ownership and organization references
- Test User Status Changes: Activate/deactivate organization and verify user status
- Test Nested Contact Persons: Create organization with nested contactpersonen array
Current Workaround for UUID Issueโ
Since the OpenConnector endpoint has a UUID format issue, you can test the organization creation flow using the authenticated OpenRegister API as a workaround:
# Test organization creation via authenticated API (workaround)
docker-compose exec nextcloud curl -s -u 'admin:admin' -H 'Content-Type: application/json' -X POST 'http://localhost/index.php/apps/openregister/api/objects/6/35' -d '{
"naam": "Test Organization",
"website": "https://test.org",
"type": "Gemeente",
"beoordeling": "actief",
"contactpersonen": [
{
"voornaam": "Test",
"achternaam": "Contact",
"email": "test.contact@test.org",
"telefoon": "+31 555 555 555",
"functie": "Manager"
}
]
}'
This will trigger the same SoftwareCatalog event listener and test our UUID fix without the OpenConnector issue.
Debugging Commandsโ
Synchronization Testing (NEW)โ
# Test manual synchronization
curl -u 'admin:admin' -X POST 'http://localhost/index.php/apps/softwarecatalog/api/settings/sync'
# Check sync status
curl -u 'admin:admin' 'http://localhost/index.php/apps/softwarecatalog/api/settings/sync-status'
# Monitor synchronization logs
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep -i "organizationsyncservice"
# Check background job execution
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep -i "organizationcontactsyncjob"
User and Organization Testingโ
# Check if users were created
docker-compose exec -u 33 nextcloud php /var/www/html/occ user:list | grep -E "anonymous|test"
# Check organization entity
curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/organisations/{UUID}'
# Check object ownership
curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{UUID}' | jq '.@self.owner'
# Monitor logs during test
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep -E "ownership|assignment|anonymous"
File Locationsโ
- Main Service:
/var/www/html/apps-extra/softwarecatalog/lib/Service/SoftwareCatalogueService.php - Event Listener:
/var/www/html/apps-extra/softwarecatalog/lib/EventListener/SoftwareCatalogEventListener.php - Logs:
/var/www/html/data/nextcloud.log - Configuration:
/var/www/html/config/config.php
Overviewโ
This document provides comprehensive testing scenarios for the organization synchronization functionality between the Software Catalog app and OpenRegister. The synchronization ensures that organisatie objects in the Software Catalog are properly synchronized with organization objects in OpenRegister.
Test Environment Setupโ
Prerequisitesโ
- Nextcloud Docker container running (
master-nextcloud-1) - Software Catalog app enabled
- OpenRegister app enabled
- Admin credentials:
admin:admin
Configuration Verificationโ
Before testing, verify the Software Catalog configuration:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/softwarecatalog/api/settings'"
Expected configuration:
voorzieningen_organisatie_register: "6"voorzieningen_organisatie_schema: "35"
Test Scenariosโ
0. Cron-Based Synchronization Test (NEW)โ
Objective: Verify that the background job and manual sync trigger work correctly.
Test Steps:
0.1 Manual Synchronization Testโ
- Trigger manual synchronization:
curl -u 'admin:admin' -X POST 'http://localhost/index.php/apps/softwarecatalog/api/settings/sync'
- Monitor the logs for detailed execution steps:
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep -i "organizationsyncservice"
- Check sync status:
curl -u 'admin:admin' 'http://localhost/index.php/apps/softwarecatalog/api/settings/sync-status'
Expected Log Output:
OrganizationSyncService: Starting manual organization synchronization started via API
OrganizationSyncService: Starting comprehensive organization synchronization
OrganizationSyncService: Found organisatie objects
OrganizationSyncService: Processing organisatie object
OrganizationSyncService: Creating new organisation entity (if needed)
OrganizationSyncService: Creating user account for contact person (if needed)
OrganizationSyncService: Successfully updated organisation entity users
OrganizationSyncService: Manual organization synchronization completed via API
0.2 Background Job Testโ
- Monitor background job execution:
docker-compose exec nextcloud tail -f /var/www/html/data/nextcloud.log | grep -i "organizationcontactsyncjob"
- Wait for the next 5-minute interval or check job status:
docker-compose exec -u 33 nextcloud php /var/www/html/occ background:job:list | grep OrganizationContactSyncJob
Expected Results:
- Manual sync completes successfully with detailed logging
- Background job runs every 5 minutes
- All organizations are processed and synchronized
- User accounts are created/updated as needed
- Organization entities are created/updated as needed
1. Organization Creation Testโ
Objective: Verify that creating an organisatie object in OpenRegister triggers synchronization to create a corresponding organization in OpenRegister.
Test Steps:
- Create a new
organisatieobject in the voorzieningen register:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"naam\":\"Test Organization Create\",\"website\":\"https://test-create.org\",\"type\":\"Leverancier\",\"status\":\"actief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35'"
- Verify the object was created in the voorzieningen register:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/35?_limit=800' | grep 'Test Organization Create'"
- Check if the organization was synchronized to OpenRegister organizations:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/organisations' | grep 'Test Organization Create'"
Expected Results:
- Organization object created in voorzieningen register with status "actief"
- Corresponding organization created in OpenRegister with status "active"
- UUID preserved between both systems
2. Organization Update Testโ
Objective: Verify that updating an organisatie object triggers synchronization to update the corresponding organization in OpenRegister.
Test Steps:
- Update an existing organization:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT -d '{\"naam\":\"Updated Test Organization\",\"website\":\"https://updated-test.org\",\"type\":\"Leverancier\",\"status\":\"inactief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Verify the update in voorzieningen register:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Check if the organization was updated in OpenRegister:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/organisations/{ORGANIZATION_ID}'"
Expected Results:
- Organization updated in voorzieningen register with status "inactief"
- Corresponding organization updated in OpenRegister with status "inactive"
- All other fields properly synchronized
3. Organization Deletion Testโ
Objective: Verify that deleting an organisatie object triggers synchronization to deactivate the corresponding organization in OpenRegister.
Test Steps:
- Delete an organization:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -X DELETE 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Verify the deletion in voorzieningen register:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Check if the organization was deactivated in OpenRegister:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/organisations/{ORGANIZATION_ID}'"
Expected Results:
- Organization deleted from voorzieningen register
- Corresponding organization deactivated in OpenRegister
- All users in the organization deactivated
4. Status Mapping Testโ
Objective: Verify that status values are properly mapped between Software Catalog and OpenRegister.
Test Cases:
actiefโactiveinactiefโinactive
Test Steps:
- Create organization with status "actief":
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"naam\":\"Active Test Org\",\"status\":\"actief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35'"
- Create organization with status "inactief":
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"naam\":\"Inactive Test Org\",\"status\":\"inactief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35'"
- Verify status mapping in OpenRegister organizations
5. Contact Person Organization Membership Testโ
Objective: Verify that when a contactpersoon is created or updated, they are automatically added to their organization's users list.
Test Steps:
- Create a contact person with organization reference:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"naam\":\"Test Contact\",\"username\":\"testuser\",\"organisatie\":\"{ORGANIZATION_ID}\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/{CONTACT_SCHEMA_ID}'"
- Verify the contact person was added to organization users list:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
Expected Results:
- Contact person created successfully
- Username added to organization's users list
- User account created in Nextcloud
6. User Status Management Testโ
Objective: Verify that when an organization status changes, all users in that organization are activated/deactivated accordingly.
Test Steps:
- Create organization with users
- Change organization status to "inactief"
- Verify all users are deactivated
- Change organization status to "actief"
- Verify all users are activated
Expected Results:
- Organization status change triggers user status changes
- All users in organization follow organization status
- User accounts properly activated/deactivated in Nextcloud
7. SoftwareCatalog-Specific User Activation/Deactivation Testโ
Objective: Verify that when an organization status changes, only SoftwareCatalog-specific users (from contactpersoon objects) are activated/deactivated, while admin group users remain unaffected.
Test Steps:
7.1 Organization Deactivation Testโ
- Create an organization with contact persons:
# Create organization
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"naam\":\"Test Org with Users\",\"website\":\"https://test-users.org\",\"type\":\"Leverancier\",\"beoordeling\":\"actief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35'"
- Create contact persons for the organization:
# Create contact person 1
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"voornaam\":\"John\",\"achternaam\":\"Doe\",\"email\":\"john.doe@test.org\",\"functie\":\"Manager\",\"organisatie\":\"{ORGANIZATION_UUID}\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/38'"
# Create contact person 2
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"voornaam\":\"Jane\",\"achternaam\":\"Smith\",\"email\":\"jane.smith@test.org\",\"functie\":\"Developer\",\"organisatie\":\"{ORGANIZATION_UUID}\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/38'"
- Verify users are created and active:
# Check organization users
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/organisations' | grep '{ORGANIZATION_UUID}'"
# Check user status
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:list | grep -E "john.doe|jane.smith"
- Deactivate the organization:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT -d '{\"naam\":\"Test Org with Users\",\"website\":\"https://test-users.org\",\"type\":\"Leverancier\",\"beoordeling\":\"inactief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Verify SoftwareCatalog users are deactivated but admin users remain active:
# Check user status after deactivation
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:list | grep -E "john.doe|jane.smith|admin"
# Verify admin user still active
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info admin
Expected Results:
- SoftwareCatalog users (john.doe, jane.smith) are deactivated
- Admin group users remain active and unaffected
- Organization status shows as "inactief"
7.2 Organization Activation Testโ
- Reactivate the organization:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT -d '{\"naam\":\"Test Org with Users\",\"website\":\"https://test-users.org\",\"type\":\"Leverancier\",\"beoordeling\":\"actief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Verify SoftwareCatalog users are reactivated:
# Check user status after reactivation
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:list | grep -E "john.doe|jane.smith|admin"
# Verify all users are active
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info john.doe
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info jane.smith
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info admin
Expected Results:
- SoftwareCatalog users (john.doe, jane.smith) are reactivated
- Admin group users remain active
- Organization status shows as "actief"
8. Contact Person User Management Testโ
Objective: Verify that contact persons are properly linked to organizations and their user accounts are managed correctly.
Test Steps:
- Create organization:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"naam\":\"Contact Person Test Org\",\"website\":\"https://contact-test.org\",\"type\":\"Gemeente\",\"beoordeling\":\"actief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35'"
- Create contact person with organization reference:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"voornaam\":\"Contact\",\"achternaam\":\"Person\",\"email\":\"contact.person@test.org\",\"telefoon\":\"+31 123 456 789\",\"functie\":\"Beheerder\",\"organisatie\":\"{ORGANIZATION_UUID}\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/38'"
- Verify contact person is processed and user created:
# Check contact person object
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/38?_limit=800' | grep 'contact.person@test.org'"
# Check user account created
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:list | grep contact.person
# Check organization users list
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/organisations' | grep '{ORGANIZATION_UUID}'"
Expected Results:
- Contact person object created successfully
- User account created for contact person
- Username added to organization's users list
- User is active (matching organization status)
9. Admin Group User Protection Testโ
Objective: Verify that admin group users are never affected by organization status changes.
Test Steps:
- Create organization with admin users already present:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"naam\":\"Admin Protection Test Org\",\"website\":\"https://admin-protection.org\",\"type\":\"Leverancier\",\"beoordeling\":\"actief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35'"
- Add additional admin users to admin group:
# Create test admin user
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:add testadmin --password-from-env
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ group:adduser admin testadmin
- Create contact persons for the organization:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"voornaam\":\"Regular\",\"achternaam\":\"User\",\"email\":\"regular.user@test.org\",\"functie\":\"User\",\"organisatie\":\"{ORGANIZATION_UUID}\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/38'"
- Deactivate organization:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT -d '{\"naam\":\"Admin Protection Test Org\",\"website\":\"https://admin-protection.org\",\"type\":\"Leverancier\",\"beoordeling\":\"inactief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Verify admin users remain active:
# Check admin users status
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info admin
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info testadmin
# Check regular user status
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info regular.user
Expected Results:
- Admin users (admin, testadmin) remain active
- Regular SoftwareCatalog user (regular.user) is deactivated
- Admin group users are completely protected from organization status changes
10. Bulk User Management Testโ
Objective: Verify that bulk operations on organizations with multiple users work correctly.
Test Steps:
- Create organization with multiple contact persons:
# Create organization
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"naam\":\"Bulk User Test Org\",\"website\":\"https://bulk-users.org\",\"type\":\"Gemeente\",\"beoordeling\":\"actief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35'"
# Create multiple contact persons
for i in {1..5}; do
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{\"voornaam\":\"User$i\",\"achternaam\":\"Test\",\"email\":\"user$i@test.org\",\"functie\":\"User$i\",\"organisatie\":\"{ORGANIZATION_UUID}\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/38'"
done
- Verify all users are created and active:
# Check all users are active
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:list | grep -E "user[1-5]"
- Deactivate organization and verify bulk deactivation:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT -d '{\"naam\":\"Bulk User Test Org\",\"website\":\"https://bulk-users.org\",\"type\":\"Gemeente\",\"beoordeling\":\"inactief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
# Check all users are deactivated
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:list | grep -E "user[1-5]"
- Reactivate organization and verify bulk activation:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT -d '{\"naam\":\"Bulk User Test Org\",\"website\":\"https://bulk-users.org\",\"type\":\"Gemeente\",\"beoordeling\":\"actief\"}' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
# Check all users are reactivated
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:list | grep -E "user[1-5]"
Expected Results:
- All 5 users created successfully
- All users deactivated when organization deactivated
- All users reactivated when organization reactivated
- Admin users remain unaffected throughout the process
11. Nested Contactpersoon Objects Testโ
Objective: Verify that contact persons can be created as nested objects within organizations and are properly processed for user management.
Test Steps:
11.1 Create Organization with Nested Contact Personsโ
- Create an organization with nested contact persons:
# Create organization with nested contact persons
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{
\"naam\": \"Nested Contact Test Org\",
\"website\": \"https://nested-contact-test.org\",
\"type\": \"Gemeente\",
\"beoordeling\": \"actief\",
\"contactpersonen\": [
{
\"voornaam\": \"Nested\",
\"achternaam\": \"Contact1\",
\"email\": \"nested.contact1@test.org\",
\"telefoon\": \"+31 111 111 111\",
\"functie\": \"Manager\"
},
{
\"voornaam\": \"Nested\",
\"achternaam\": \"Contact2\",
\"email\": \"nested.contact2@test.org\",
\"telefoon\": \"+31 222 222 222\",
\"functie\": \"Developer\"
}
]
}' 'http://localhost/index.php/apps/openregister/api/objects/6/35'"
- Verify the organization was created with nested contact persons:
# Check organization structure
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Verify contact persons were processed and users created:
# Check if users were created
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:list | grep -E "nested.contact1|nested.contact2"
# Check user status
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info nested.contact1@test.org
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info nested.contact2@test.org
Expected Results:
- Organization created successfully with nested contact persons
- Contact persons are properly linked to the organization
- User accounts are created for each contact person
- Users are active (matching organization status)
11.2 Test User Status Changes with Nested Contact Personsโ
- Deactivate the organization:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT -d '{
\"naam\": \"Nested Contact Test Org\",
\"website\": \"https://nested-contact-test.org\",
\"type\": \"Gemeente\",
\"beoordeling\": \"inactief\"
}' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Verify nested contact person users are deactivated:
# Check user status after deactivation
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info nested.contact1@test.org | grep enabled
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info nested.contact2@test.org | grep enabled
- Reactivate the organization:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT -d '{
\"naam\": \"Nested Contact Test Org\",
\"website\": \"https://nested-contact-test.org\",
\"type\": \"Gemeente\",
\"beoordeling\": \"actief\"
}' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
- Verify nested contact person users are reactivated:
# Check user status after reactivation
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info nested.contact1@test.org | grep enabled
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info nested.contact2@test.org | grep enabled
Expected Results:
- Nested contact person users are deactivated when organization becomes inactive
- Nested contact person users are reactivated when organization becomes active
- Admin users remain unaffected throughout the process
11.3 Test Mixed Contact Person Creation Methodsโ
- Create organization with some nested contact persons:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{
\"naam\": \"Mixed Contact Test Org\",
\"website\": \"https://mixed-contact-test.org\",
\"type\": \"Leverancier\",
\"beoordeling\": \"actief\",
\"contactpersonen\": [
{
\"voornaam\": \"Mixed\",
\"achternaam\": \"Contact1\",
\"email\": \"mixed.contact1@test.org\",
\"telefoon\": \"+31 333 333 333\",
\"functie\": \"Manager\"
}
]
}' 'http://localhost/index.php/apps/openregister/api/objects/6/35'"
- Add additional contact person via separate API call:
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X POST -d '{
\"voornaam\": \"Mixed\",
\"achternaam\": \"Contact2\",
\"email\": \"mixed.contact2@test.org\",
\"telefoon\": \"+31 444 444 444\",
\"functie\": \"Developer\",
\"organisatie\": \"{ORGANIZATION_UUID}\"
}' 'http://localhost/index.php/apps/openregister/api/objects/6/34'"
- Verify all contact persons are properly managed:
# Check all users are created
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:list | grep -E "mixed.contact1|mixed.contact2"
# Test organization status changes affect all users
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -H 'Content-Type: application/json' -X PUT -d '{
\"beoordeling\": \"inactief\"
}' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_ID}'"
# Verify all users are deactivated
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info mixed.contact1@test.org | grep enabled
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info mixed.contact2@test.org | grep enabled
Expected Results:
- Both nested and separately created contact persons are properly managed
- All contact person users respond to organization status changes
- User management works consistently regardless of creation method
12. Anonymous User Registration via OpenConnectorโ
Objective: Test organization registration by anonymous users through OpenConnector, ensuring proper ownership assignment and entity creation.
Background - OpenRegister Objects vs Entities:
- OpenRegister Objects: Abstract data structures managed by schemas (e.g.,
organisatieobject at register 6, schema 35) - OpenRegister Entities: Classic Nextcloud entities (e.g.,
organisationentity,userentity) - Flow: Anonymous user creates
organisatieobject โ System createsorganisationentity anduserentity โ New user becomes owner of both objects
Test Steps:
12.1 Anonymous User Registration via OpenConnectorโ
- Register organization as anonymous user through OpenConnector:
Postman Configuration:
- Method: POST
- URL:
http://nextcloud.local/index.php/apps/openconnector/api/endpoint/register - Headers:
Content-Type: application/json
- Body (raw JSON):
{
"naam": "Anonymous Test Org",
"website": "https://anonymous-test.org",
"type": "Gemeente",
"beoordeling": "actief",
"contactpersonen": [
{
"voornaam": "Anonymous",
"achternaam": "Contact1",
"email": "anonymous.contact1@test.org",
"telefoon": "+31 555 555 555",
"functie": "Manager"
},
{
"voornaam": "Anonymous",
"achternaam": "Contact2",
"email": "anonymous.contact2@test.org",
"telefoon": "+31 666 666 666",
"functie": "Developer"
}
]
}
cURL Command (from host machine):
curl -X POST "http://nextcloud.local/index.php/apps/openconnector/api/endpoint/register" \
-H "Content-Type: application/json" \
-d '{
"naam": "Anonymous Test Org",
"website": "https://anonymous-test.org",
"type": "Gemeente",
"beoordeling": "actief",
"contactpersonen": [
{
"voornaam": "Anonymous",
"achternaam": "Contact1",
"email": "anonymous.contact1@test.org",
"telefoon": "+31 555 555 555",
"functie": "Manager"
},
{
"voornaam": "Anonymous",
"achternaam": "Contact2",
"email": "anonymous.contact2@test.org",
"telefoon": "+31 666 666 666",
"functie": "Developer"
}
]
}'
cURL Command (from within Docker container):
docker-compose exec nextcloud curl -X POST "http://localhost/index.php/apps/openconnector/api/endpoint/register" \
-H "Content-Type: application/json" \
-d '{
"naam": "Anonymous Test Org",
"website": "https://anonymous-test.org",
"type": "Gemeente",
"beoordeling": "actief",
"contactpersonen": [
{
"voornaam": "Anonymous",
"achternaam": "Contact1",
"email": "anonymous.contact1@test.org",
"telefoon": "+31 555 555 555",
"functie": "Manager"
},
{
"voornaam": "Anonymous",
"achternaam": "Contact2",
"email": "anonymous.contact2@test.org",
"telefoon": "+31 666 666 666",
"functie": "Developer"
}
]
}'
Current Status:
- โ Endpoint accessible: The OpenConnector endpoint is working and accessible from within the Docker container
- โ UUID Issue: Currently getting "Field 'uuid' doesn't have a default value" error when creating organization entities
- ๐ Fix in progress: UUID format conversion implemented in SoftwareCatalog service (standard UUID with hyphens โ 32-char hex string)
- โ ๏ธ OpenConnector Issue: The error occurs in OpenConnector before SoftwareCatalog event listener can process it
Expected Results (once UUID issue is resolved):
- Organization object created successfully via OpenConnector
- Organization entity created in OpenRegister with matching UUID
- User accounts created for contact persons
- Primary contact person user becomes owner of organization object
- Organization entity is set as organization on both objects
12.2 Verify Ownership Assignmentโ
- Check organization object ownership:
# Verify the newly created user is the owner
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ORGANIZATION_UUID}' | jq '.@self.owner'"
- Check contact person object ownership:
# Verify contact person objects have correct ownership and organization
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/34/{CONTACT_UUID}' | jq '.@self.owner, .organisatie'"
Expected Results:
- Organization object owner is the newly created user (not admin)
- Contact person objects owner is the newly created user
- Contact person objects have organization field set to organization entity UUID
12.3 Test User Login and Accessโ
- Test user login with newly created credentials:
# Test login (this would be done via web interface)
# The user should be able to log in and access their organization
- Verify user can access their organization:
# Check user permissions and access
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ user:info anonymous.contact1@test.org
Expected Results:
- User can log in successfully
- User has appropriate permissions for their organization
- User can access and modify their organization data
13. OpenRegister Objects vs Entities - Technical Detailsโ
OpenRegister Objects:
- Managed by schemas and registers
- Stored in
oc_openregister_objectstable - Have UUID, owner, organization fields
- Examples:
organisatie(schema 35),contactpersoon(schema 34) - Created via
/apps/openregister/api/objects/{register}/{schema}
OpenRegister Entities:
- Classic Nextcloud entities
- Stored in dedicated tables (e.g.,
oc_openregister_organisations) - Have ID, UUID, name, status fields
- Examples:
organisationentity,userentity - Created via
/apps/openregister/api/organisations
Conversion Flow:
- Anonymous user creates
organisatieobject via OpenConnector - Event listener triggers organization sync
- System creates
organisationentity - System creates
userentity for primary contact - System updates object ownership and organization references
- User becomes owner of their objects
Debugging and Troubleshootingโ
Check Event Logsโ
docker logs master-nextcloud-1 --since 10m | grep -E "\[SoftwareCatalog\]|\[ObjectCreatedEvent\]|\[ObjectUpdatedEvent\]|\[ObjectDeletedEvent\]"
Check App Statusโ
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ app:list | grep softwarecatalog
Enable App if Neededโ
docker exec -u 33 master-nextcloud-1 php /var/www/html/occ app:enable softwarecatalog
Check Nextcloud Logsโ
docker exec -u 33 master-nextcloud-1 tail -f /var/www/html/data/nextcloud.log
Test Data Managementโ
Cleanup Test Dataโ
After testing, clean up test organizations:
# Find test organizations
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' 'http://localhost/index.php/apps/openregister/api/objects/6/35?_limit=800' | grep -o '\"id\":\"[^\"]*\"' | grep -E 'Test|test'"
# Delete test organizations (replace {ID} with actual IDs)
docker exec -it -u 33 master-nextcloud-1 bash -c "curl -u 'admin:admin' -X DELETE 'http://localhost/index.php/apps/openregister/api/objects/6/35/{ID}'"
Performance Testingโ
Bulk Organization Creationโ
Test creating multiple organizations to verify performance: