Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions lib/Service/ModuleComplianceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,25 @@ private function getComplianceObjectsForModule(string $moduleUuid): array
try {
// Get compliance schema ID from configuration
$complianceSchemaId = $this->settingsService->getSchemaIdForObjectType('compliancy');

if (!$complianceSchemaId) {
$this->logger->warning('ModuleComplianceService: Compliance schema not configured', [
'moduleUuid' => $moduleUuid
]);
return [];
}

// Get register ID from voorzieningen config
$voorzieningenConfig = $this->settingsService->getVoorzieningenConfig();
$registerId = $voorzieningenConfig['register'] ?? null;

if (!$registerId) {
$this->logger->warning('ModuleComplianceService: Voorzieningen register not configured', [
'moduleUuid' => $moduleUuid
]);
return [];
}

// Get object service
$objectService = $this->getObjectService();
if (!$objectService) {
Expand All @@ -206,6 +217,7 @@ private function getComplianceObjectsForModule(string $moduleUuid): array
$query = [
'@self' => [
'schema' => (int) $complianceSchemaId,
'register' => (int) $registerId,
],
'module' => $moduleUuid,
];
Expand Down Expand Up @@ -416,21 +428,30 @@ public function bulkSyncModuleStandards(): array
try {
// Get compliance schema ID from configuration
$complianceSchemaId = $this->settingsService->getSchemaIdForObjectType('compliancy');

if (!$complianceSchemaId) {
throw new \RuntimeException('Compliance schema not configured');
}

// Get register ID from voorzieningen config
$voorzieningenConfig = $this->settingsService->getVoorzieningenConfig();
$registerId = $voorzieningenConfig['register'] ?? null;

if (!$registerId) {
throw new \RuntimeException('Voorzieningen register not configured');
}

// Get object service
$objectService = $this->getObjectService();
if (!$objectService) {
throw new \RuntimeException('ObjectService not available');
}

// Get all compliance objects
// Get all compliance objects (both schema AND register are required)
$query = [
'@self' => [
'schema' => (int) $complianceSchemaId,
'register' => (int) $registerId,
],
];
$complianceObjects = $objectService->searchObjects($query);
Expand Down
5 changes: 2 additions & 3 deletions lib/Settings/softwarecatalogus_register.json
Original file line number Diff line number Diff line change
Expand Up @@ -2220,8 +2220,7 @@
"summary": "",
"icon": "Usage",
"required": [
"afnemer",
"status"
"afnemer"
],
"properties": {
"afnemer": {
Expand Down Expand Up @@ -2396,7 +2395,7 @@
"description": "De status van het gebruik",
"type": "string",
"default": "Concept",
"required": true,
"required": false,
"visible": true,
"order": 17,
"minLength": null,
Expand Down