diff --git a/Installation/Schema/zrc/zrc.objectIdentificatie.schema.json b/Installation/Schema/zrc/zrc.objectIdentificatie.schema.json index ac1db17..ae6c24f 100644 --- a/Installation/Schema/zrc/zrc.objectIdentificatie.schema.json +++ b/Installation/Schema/zrc/zrc.objectIdentificatie.schema.json @@ -9,29 +9,25 @@ "title": "identificatie", "description": "De unieke identificatie van het OBJECT.", "type": "string", - "maxLength": 100, - "required": true + "maxLength": 100 }, "wplWoonplaatsNaam": { "type": "string", "title": "wpl woonplaats naam", "description": "De unieke identificatie van het OBJECT", - "maxLength": 80, - "required": true + "maxLength": 80 }, "gorOpenbareRuimteNaam": { "type": "string", "title": "gor openbare ruimte naam", "description": "Een door het bevoegde gemeentelijke orgaan aan een OPENBARE RUIMTE toegekende benaming", - "maxLength": 80, - "required": true + "maxLength": 80 }, "huisnummer": { "type": "integer", "title": "huisnummer", "minimum": 0, - "maximum": 99999, - "required": true + "maximum": 99999 }, "huisletter": { "type": "string", diff --git a/Service/DRCService.php b/Service/DRCService.php index d1b45ba..9c8d754 100644 --- a/Service/DRCService.php +++ b/Service/DRCService.php @@ -403,7 +403,7 @@ public function inhoudHandler(array $data, array $configuration): array $file->setBase64($data['inhoud']); } else if ( ( - ($data['inhoud'] === null || filter_var($data['inhoud'], FILTER_VALIDATE_URL) === $data['inhoud']) + ($data['inhoud'] === null || filter_var($data['inhoud'], FILTER_VALIDATE_URL) === $data['inhoud'] || $data['inhoud'] === '') && ($data['link'] === null || $data['link'] === '') ) && isset($this->data['body']['bestandsomvang']) === true @@ -440,13 +440,13 @@ public function inhoudHandler(array $data, array $configuration): array $this->entityManager->persist($file); + $now = new \DateTime(); if ($this->data['method'] === 'POST') { - $objectEntity->hydrate(['bestandsdelen' => $fileParts, 'lock' => $lock, 'locked' => true, 'inhoud' => $this->generateDownloadEndpoint($objectId, $downloadEndpoint)]); + $objectEntity->hydrate(['bestandsdelen' => $fileParts, 'lock' => $lock, 'locked' => true, 'inhoud' => $this->generateDownloadEndpoint($objectEntity->getId()->toString(), $downloadEndpoint)]); } else { - $objectEntity->hydrate(['bestandsdelen' => $fileParts, 'inhoud' => $this->generateDownloadEndpoint($objectId, $downloadEndpoint)]); + $objectEntity->hydrate(['bestandsdelen' => $fileParts, 'inhoud' => $this->generateDownloadEndpoint($objectEntity->getId()->toString(), $downloadEndpoint), 'beginRegistratie' => $now->format('c')]); } - $this->entityManager->persist($objectEntity); $this->entityManager->flush();