From 04b56b4be5ff70e8986d2efe9a972d8a3665491f Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Wed, 18 Dec 2024 09:30:37 +0100 Subject: [PATCH 1/4] Objecten controller --- lib/Controller/ObjectsController.php | 233 +++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 lib/Controller/ObjectsController.php diff --git a/lib/Controller/ObjectsController.php b/lib/Controller/ObjectsController.php new file mode 100644 index 0000000..f39ee49 --- /dev/null +++ b/lib/Controller/ObjectsController.php @@ -0,0 +1,233 @@ +objectService->getMapper($objectType); + } catch (Exception $e) { + throw $e; + } + + return $objectType; + } + + /** + * Return (and search) all objects + * + * @NoAdminRequired + * @NoCSRFRequired + * + * @return JSONResponse + */ + public function index(): JSONResponse + { + // Retrieve all request parameters + $requestParams = $this->request->getParams(); + + try { + // Validate object type configuration + $objectType = $this->validateObjectType($requestParams); + + // Fetch objects based on filters and order using provided objectType + $data = $this->objectService->getResultArrayForRequest( + objectType: $objectType, + requestParams: $requestParams + ); + + // Return JSON response + return new JSONResponse($data); + } catch (Exception $e) { + return new JSONResponse( + ['error' => $e->getMessage()], + 400 + ); + } + } + + /** + * Read a single object + * + * @NoAdminRequired + * @NoCSRFRequired + * + * @return JSONResponse + */ + public function show(string $id): JSONResponse + { + try { + // Get request parameters and validate object type + $requestParams = $this->request->getParams(); + $objectType = $this->validateObjectType($requestParams); + + // Get extend parameter if present + $extend = $requestParams['extend'] ?? $requestParams['_extend'] ?? []; + if (is_string($extend)) { + $extend = array_map('trim', explode(',', $extend)); + } + + // Fetch the object by its ID + $object = $this->objectService->getObject($objectType, $id, $extend); + + // Return the object as a JSON response + return new JSONResponse($object); + } catch (Exception $e) { + return new JSONResponse( + ['error' => $e->getMessage()], + 400 + ); + } + } + + /** + * Create an object + * + * @NoAdminRequired + * @NoCSRFRequired + * + * @return JSONResponse + */ + public function create(): JSONResponse + { + try { + // Get all parameters from the request + $data = $this->request->getParams(); + $objectType = $this->validateObjectType($data); + + // Remove the 'id' field if it exists, as we're creating a new object + unset($data['id']); + unset($data['_objectType']); + + // Save the new object + $object = $this->objectService->saveObject($objectType, $data); + + // Return the created object as a JSON response + return new JSONResponse($object); + } catch (Exception $e) { + return new JSONResponse( + ['error' => $e->getMessage()], + 400 + ); + } + } + + /** + * Update an object + * + * @NoAdminRequired + * @NoCSRFRequired + * + * @return JSONResponse + */ + public function update(string $id): JSONResponse + { + try { + // Get all parameters from the request + $data = $this->request->getParams(); + $objectType = $this->validateObjectType($data); + + // Ensure ID in data matches URL parameter + $data['id'] = $id; + unset($data['_objectType']); + + // Save the updated object + $object = $this->objectService->saveObject($objectType, $data); + + // Return the updated object as a JSON response + return new JSONResponse($object); + } catch (Exception $e) { + return new JSONResponse( + ['error' => $e->getMessage()], + 400 + ); + } + } + + /** + * Delete an object + * + * @NoAdminRequired + * @NoCSRFRequired + * + * @return JSONResponse + */ + public function destroy(string $id): JSONResponse + { + try { + // Get request parameters and validate object type + $requestParams = $this->request->getParams(); + $objectType = $this->validateObjectType($requestParams); + + // Delete the object + $result = $this->objectService->deleteObject($objectType, $id); + + // Return the result as a JSON response + return new JSONResponse(['success' => $result], $result === true ? 200 : 404); + } catch (Exception $e) { + return new JSONResponse( + ['error' => $e->getMessage()], + 400 + ); + } + } + + /** + * Get audit trail for a specific object + * + * @NoAdminRequired + * @NoCSRFRequired + * + * @return JSONResponse + */ + public function getAuditTrail(string $id): JSONResponse + { + try { + // Get request parameters and validate object type + $requestParams = $this->request->getParams(); + $objectType = $this->validateObjectType($requestParams); + + $auditTrail = $this->objectService->getAuditTrail($objectType, $id); + return new JSONResponse($auditTrail); + } catch (Exception $e) { + return new JSONResponse( + ['error' => $e->getMessage()], + 400 + ); + } + } +} From badd7ffbaca8ec343673d83e5603179191c462c6 Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Wed, 18 Dec 2024 09:30:38 +0100 Subject: [PATCH 2/4] Objects controleler --- .github/workflows/release-workflow.yaml | 390 ++-- lib/Controller/UsersController.php | 152 +- src/entities/medewerkers/medewerkers.mock.ts | 30 +- src/entities/medewerkers/medewerkers.ts | 70 +- src/entities/medewerkers/medewerkers.types.ts | 16 +- .../contactMomenten/ContactMomentenForm.vue | 2064 ++++++++--------- .../klantRegister/ViewKlantRegister.vue | 874 +++---- src/modals/klanten/SearchKlantModal.vue | 804 +++---- src/modals/medewerkers/EditMedewerker.vue | 332 +-- src/modals/zaakTypen/DeleteZaaktype.vue | 196 +- src/modals/zaakTypen/ZaaktypeForm.vue | 580 ++--- src/modals/zaken/AddBerichtToZaak.vue | 292 +-- src/modals/zaken/AddRolToZaak.vue | 298 +-- src/modals/zaken/AddTaakToZaak.vue | 300 +-- .../icons/icon/icon-calendar-check-outline.js | 26 +- src/services/icons/icons.css | 44 +- src/services/icons/index.js | 14 +- .../contactMomenten/ContactMomentDetails.vue | 448 ++-- .../contactMomenten/ContactMomentenIndex.vue | 92 +- .../contactMomenten/ContactMomentenList.vue | 380 +-- src/views/medewerkers/MedewerkerDetails.vue | 328 +-- src/views/medewerkers/MedewerkerList.vue | 378 +-- src/views/widgets/ContactMomentenWidget.vue | 422 ++-- src/views/widgets/TakenWidget.vue | 450 ++-- 24 files changed, 4490 insertions(+), 4490 deletions(-) diff --git a/.github/workflows/release-workflow.yaml b/.github/workflows/release-workflow.yaml index abc4f59..8ac526d 100644 --- a/.github/workflows/release-workflow.yaml +++ b/.github/workflows/release-workflow.yaml @@ -1,196 +1,196 @@ -name: Release Workflow - -on: - push: - branches: - - master - - main - workflow_dispatch: - inputs: - version: - description: 'Version to release (leave empty to use info.xml version)' - required: false - default: '' - -jobs: - release-management: - runs-on: ubuntu-latest - steps: - - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set app env - run: | - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Get current version and increment - id: increment_version - run: | - current_version=$(grep -oP '(?<=)[^<]+' appinfo/info.xml) - IFS='.' read -ra version_parts <<< "$current_version" - ((version_parts[2]++)) - new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}" - echo "NEW_VERSION=$new_version" >> $GITHUB_ENV - echo "new_version=$new_version" >> $GITHUB_OUTPUT - - - name: Update version in info.xml - run: | - sed -i "s|.*|${{ env.NEW_VERSION }}|" appinfo/info.xml - - - name: Commit version update - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -am "Bump version to ${{ env.NEW_VERSION }}" - git push - - # Step 1: Prepare the signing certificate and key - - name: Prepare Signing Certificate and Key - run: | - echo "${{ secrets.NEXTCLOUD_SIGNING_CERT }}" > signing-cert.crt - echo "${{ secrets.NEXTCLOUD_SIGNING_KEY }}" > signing-key.key - - # Step 3: Install Node.js dependencies using npm - - name: Install npm dependencies - uses: actions/setup-node@v3 - with: - node-version: '18.x' # Specify Node.js version - - # Step 4: Install PHP extensions - - name: Set up PHP and install extensions - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - extensions: zip, gd - - # Step 5: Build the node dependencies - - run: npm ci - - # Step 6: Build the node dependencies - - run: npm run build - - # Step 7: Build composer dependencies - - run: composer i --no-dev - - # Step 8: Copy the files into the package directory - - name: Copy the package files into the package - run: | - mkdir -p package/${{ github.event.repository.name }} - rsync -av --progress \ - --exclude='package' \ - --exclude='.git' \ - --exclude='.github' \ - --exclude='.vscode' \ - --exclude='docker' \ - --exclude='docs' \ - --exclude='node_modules' \ - --exclude='/src' \ - --exclude='test' \ - --exclude='package-lock.json' \ - --exclude='composer.lock' \ - --exclude='composer-setup.php' \ - --exclude='.phpunit.result.cache' \ - --exclude='phpmd.xml' \ - --exclude='signing-key.key' \ - --exclude='package.json' \ - --exclude='composer.json' \ - --exclude='coverage.txt' \ - --exclude='signing-cert.crt' \ - --exclude='docker-compose.yml' \ - --exclude='webpack.config.js' \ - --exclude='.prettierrc' \ - --exclude='psalm.xml' \ - --exclude='phpunit.xml' \ - --exclude='tsconfig.json' \ - --exclude='changelog-ci-config.json' \ - --exclude='jest.config.js' \ - --exclude='.gitattributes' \ - --exclude='.php-cs-fixer.dist.php' \ - --exclude='.gitignore' \ - --exclude='.eslintrc.js' \ - --exclude='stylelint.config.js' \ - --exclude='.babelrc' \ - --exclude='.nvmrc' \ - ./ package/${{ github.event.repository.name }}/ - - # Step 9: Create the TAR.GZ archive - - name: Create Tarball - run: | - cd package && tar -czf ../nextcloud-release.tar.gz ${{ github.event.repository.name }} - - # Step 10: Sign the TAR.GZ file with OpenSSL - - name: Sign the TAR.GZ file with OpenSSL - run: | - openssl dgst -sha512 -sign signing-key.key nextcloud-release.tar.gz | openssl base64 -out nextcloud-release.signature - - # Step 11: Generate Git version information - - name: Git Version - id: version - uses: codacy/git-version@2.7.1 - with: - release-branch: main - - # Step 12: Extract repository description - - name: Extract repository description - id: repo-description - run: | - description=$(jq -r '.description' <(curl -s https://api.github.com/repos/${{ github.repository }})) - echo "REPO_DESCRIPTION=$description" >> $GITHUB_ENV - - # Step 13: Run Changelog CI - - name: Run Changelog CI - if: github.ref == 'refs/heads/main' - uses: saadmk11/changelog-ci@v1.1.2 - with: - release_version: ${{ env.NEW_VERSION }} - config_file: changelog-ci-config.json - - # Step 14: Output the version - - name: Use the version - run: | - echo ${{ steps.version.outputs.version }} - - # Step 15: Copy the package files into the package (this step seems redundant, consider removing) - - name: Copy the package files into the package - run: | - mkdir -p package/${{ github.event.repository.name }} - rsync -av --progress --exclude='package' --exclude='.git' ./ package/${{ github.event.repository.name }}/ - - # Step 18: Create a new release on GitHub - - name: Upload Release - uses: ncipollo/release-action@v1.12.0 - with: - tag: v${{ env.NEW_VERSION }} - name: Release ${{ env.NEW_VERSION }} - draft: false - prerelease: false - - - name: Attach tarball to github release - uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2 - id: attach_to_release - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: nextcloud-release.tar.gz # Corrected spelling - asset_name: ${{ env.APP_NAME }}-${{ env.NEW_VERSION }}.tar.gz - tag: v${{ env.NEW_VERSION }} - overwrite: true - - - name: Upload app to Nextcloud appstore - uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1 - with: - app_name: ${{ env.APP_NAME }} - appstore_token: ${{ secrets.NEXTCLOUD_APPSTORE_TOKEN }} - download_url: https://github.com/${{ github.repository }}/releases/download/v${{ env.NEW_VERSION }}/${{ env.APP_NAME }}-${{ env.NEW_VERSION }}.tar.gz - app_private_key: ${{ secrets.NEXTCLOUD_SIGNING_KEY }} - nightly: false - - - name: Verify version and contents - run: | - echo "App version: ${{ env.NEW_VERSION }}" - echo "Tarball contents:" - tar -tvf nextcloud-release.tar.gz - echo "info.xml contents:" +name: Release Workflow + +on: + push: + branches: + - master + - main + workflow_dispatch: + inputs: + version: + description: 'Version to release (leave empty to use info.xml version)' + required: false + default: '' + +jobs: + release-management: + runs-on: ubuntu-latest + steps: + + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set app env + run: | + echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV + + - name: Get current version and increment + id: increment_version + run: | + current_version=$(grep -oP '(?<=)[^<]+' appinfo/info.xml) + IFS='.' read -ra version_parts <<< "$current_version" + ((version_parts[2]++)) + new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}" + echo "NEW_VERSION=$new_version" >> $GITHUB_ENV + echo "new_version=$new_version" >> $GITHUB_OUTPUT + + - name: Update version in info.xml + run: | + sed -i "s|.*|${{ env.NEW_VERSION }}|" appinfo/info.xml + + - name: Commit version update + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -am "Bump version to ${{ env.NEW_VERSION }}" + git push + + # Step 1: Prepare the signing certificate and key + - name: Prepare Signing Certificate and Key + run: | + echo "${{ secrets.NEXTCLOUD_SIGNING_CERT }}" > signing-cert.crt + echo "${{ secrets.NEXTCLOUD_SIGNING_KEY }}" > signing-key.key + + # Step 3: Install Node.js dependencies using npm + - name: Install npm dependencies + uses: actions/setup-node@v3 + with: + node-version: '18.x' # Specify Node.js version + + # Step 4: Install PHP extensions + - name: Set up PHP and install extensions + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + extensions: zip, gd + + # Step 5: Build the node dependencies + - run: npm ci + + # Step 6: Build the node dependencies + - run: npm run build + + # Step 7: Build composer dependencies + - run: composer i --no-dev + + # Step 8: Copy the files into the package directory + - name: Copy the package files into the package + run: | + mkdir -p package/${{ github.event.repository.name }} + rsync -av --progress \ + --exclude='package' \ + --exclude='.git' \ + --exclude='.github' \ + --exclude='.vscode' \ + --exclude='docker' \ + --exclude='docs' \ + --exclude='node_modules' \ + --exclude='/src' \ + --exclude='test' \ + --exclude='package-lock.json' \ + --exclude='composer.lock' \ + --exclude='composer-setup.php' \ + --exclude='.phpunit.result.cache' \ + --exclude='phpmd.xml' \ + --exclude='signing-key.key' \ + --exclude='package.json' \ + --exclude='composer.json' \ + --exclude='coverage.txt' \ + --exclude='signing-cert.crt' \ + --exclude='docker-compose.yml' \ + --exclude='webpack.config.js' \ + --exclude='.prettierrc' \ + --exclude='psalm.xml' \ + --exclude='phpunit.xml' \ + --exclude='tsconfig.json' \ + --exclude='changelog-ci-config.json' \ + --exclude='jest.config.js' \ + --exclude='.gitattributes' \ + --exclude='.php-cs-fixer.dist.php' \ + --exclude='.gitignore' \ + --exclude='.eslintrc.js' \ + --exclude='stylelint.config.js' \ + --exclude='.babelrc' \ + --exclude='.nvmrc' \ + ./ package/${{ github.event.repository.name }}/ + + # Step 9: Create the TAR.GZ archive + - name: Create Tarball + run: | + cd package && tar -czf ../nextcloud-release.tar.gz ${{ github.event.repository.name }} + + # Step 10: Sign the TAR.GZ file with OpenSSL + - name: Sign the TAR.GZ file with OpenSSL + run: | + openssl dgst -sha512 -sign signing-key.key nextcloud-release.tar.gz | openssl base64 -out nextcloud-release.signature + + # Step 11: Generate Git version information + - name: Git Version + id: version + uses: codacy/git-version@2.7.1 + with: + release-branch: main + + # Step 12: Extract repository description + - name: Extract repository description + id: repo-description + run: | + description=$(jq -r '.description' <(curl -s https://api.github.com/repos/${{ github.repository }})) + echo "REPO_DESCRIPTION=$description" >> $GITHUB_ENV + + # Step 13: Run Changelog CI + - name: Run Changelog CI + if: github.ref == 'refs/heads/main' + uses: saadmk11/changelog-ci@v1.1.2 + with: + release_version: ${{ env.NEW_VERSION }} + config_file: changelog-ci-config.json + + # Step 14: Output the version + - name: Use the version + run: | + echo ${{ steps.version.outputs.version }} + + # Step 15: Copy the package files into the package (this step seems redundant, consider removing) + - name: Copy the package files into the package + run: | + mkdir -p package/${{ github.event.repository.name }} + rsync -av --progress --exclude='package' --exclude='.git' ./ package/${{ github.event.repository.name }}/ + + # Step 18: Create a new release on GitHub + - name: Upload Release + uses: ncipollo/release-action@v1.12.0 + with: + tag: v${{ env.NEW_VERSION }} + name: Release ${{ env.NEW_VERSION }} + draft: false + prerelease: false + + - name: Attach tarball to github release + uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2 + id: attach_to_release + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: nextcloud-release.tar.gz # Corrected spelling + asset_name: ${{ env.APP_NAME }}-${{ env.NEW_VERSION }}.tar.gz + tag: v${{ env.NEW_VERSION }} + overwrite: true + + - name: Upload app to Nextcloud appstore + uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1 + with: + app_name: ${{ env.APP_NAME }} + appstore_token: ${{ secrets.NEXTCLOUD_APPSTORE_TOKEN }} + download_url: https://github.com/${{ github.repository }}/releases/download/v${{ env.NEW_VERSION }}/${{ env.APP_NAME }}-${{ env.NEW_VERSION }}.tar.gz + app_private_key: ${{ secrets.NEXTCLOUD_SIGNING_KEY }} + nightly: false + + - name: Verify version and contents + run: | + echo "App version: ${{ env.NEW_VERSION }}" + echo "Tarball contents:" + tar -tvf nextcloud-release.tar.gz + echo "info.xml contents:" tar -xOf nextcloud-release.tar.gz ${{ env.APP_NAME }}/appinfo/info.xml \ No newline at end of file diff --git a/lib/Controller/UsersController.php b/lib/Controller/UsersController.php index 79b99a7..7e13fc8 100644 --- a/lib/Controller/UsersController.php +++ b/lib/Controller/UsersController.php @@ -1,76 +1,76 @@ -userSession->getUser(); - - try { - $data = [ - 'user' => [ - 'id' => $currentUser->getUID(), - 'displayName' => $currentUser->getDisplayName(), - 'email' => $currentUser->getEMailAddress(), - 'systemEmail' => $currentUser->getSystemEMailAddress(), - 'primaryEmail' => $currentUser->getPrimaryEMailAddress(), - 'lastLogin' => $currentUser->getLastLogin(), - 'quota' => $currentUser->getQuota(), - 'home' => $currentUser->getHome(), - 'backendClassName' => $currentUser->getBackendClassName(), - 'avatarImage' => $currentUser->getAvatarImage(64), - 'cloudId' => $currentUser->getCloudId(), - 'isEnabled' => $currentUser->isEnabled(), - 'canChangeDisplayName' => $currentUser->canChangeDisplayName(), - 'canChangePassword' => $currentUser->canChangePassword(), - 'canChangeAvatar' => $currentUser->canChangeAvatar(), - 'managerUids' => $currentUser->getManagerUids(), - ], - 'medewerker' => 'placeholder-todo' - ]; - return new JSONResponse($data); - } catch (\Exception $e) { - return new JSONResponse(['error' => $e->getMessage()], 500); - } - } -} +userSession->getUser(); + + try { + $data = [ + 'user' => [ + 'id' => $currentUser->getUID(), + 'displayName' => $currentUser->getDisplayName(), + 'email' => $currentUser->getEMailAddress(), + 'systemEmail' => $currentUser->getSystemEMailAddress(), + 'primaryEmail' => $currentUser->getPrimaryEMailAddress(), + 'lastLogin' => $currentUser->getLastLogin(), + 'quota' => $currentUser->getQuota(), + 'home' => $currentUser->getHome(), + 'backendClassName' => $currentUser->getBackendClassName(), + 'avatarImage' => $currentUser->getAvatarImage(64), + 'cloudId' => $currentUser->getCloudId(), + 'isEnabled' => $currentUser->isEnabled(), + 'canChangeDisplayName' => $currentUser->canChangeDisplayName(), + 'canChangePassword' => $currentUser->canChangePassword(), + 'canChangeAvatar' => $currentUser->canChangeAvatar(), + 'managerUids' => $currentUser->getManagerUids(), + ], + 'medewerker' => 'placeholder-todo' + ]; + return new JSONResponse($data); + } catch (\Exception $e) { + return new JSONResponse(['error' => $e->getMessage()], 500); + } + } +} diff --git a/src/entities/medewerkers/medewerkers.mock.ts b/src/entities/medewerkers/medewerkers.mock.ts index 6c45360..c1f4d55 100644 --- a/src/entities/medewerkers/medewerkers.mock.ts +++ b/src/entities/medewerkers/medewerkers.mock.ts @@ -1,15 +1,15 @@ -import { Medewerker } from './medewerkers' -import { TMedewerker } from './medewerkers.types' - -export const mockMedewerkerData = (): TMedewerker[] => [ - { - id: '15551d6f-44e3-43f3-a9d2-59e583c91eb0', - voornaam: 'John', - tussenvoegsel: 'de', - achternaam: 'Doe', - email: 'john.doe@example.com', - telefoonnummer: '0612345678', - }, -] - -export const mockMedewerker = (data: TMedewerker[] = mockMedewerkerData()): TMedewerker[] => data.map(item => new Medewerker(item)) +import { Medewerker } from './medewerkers' +import { TMedewerker } from './medewerkers.types' + +export const mockMedewerkerData = (): TMedewerker[] => [ + { + id: '15551d6f-44e3-43f3-a9d2-59e583c91eb0', + voornaam: 'John', + tussenvoegsel: 'de', + achternaam: 'Doe', + email: 'john.doe@example.com', + telefoonnummer: '0612345678', + }, +] + +export const mockMedewerker = (data: TMedewerker[] = mockMedewerkerData()): TMedewerker[] => data.map(item => new Medewerker(item)) diff --git a/src/entities/medewerkers/medewerkers.ts b/src/entities/medewerkers/medewerkers.ts index 302c6aa..29e01e7 100644 --- a/src/entities/medewerkers/medewerkers.ts +++ b/src/entities/medewerkers/medewerkers.ts @@ -1,35 +1,35 @@ -import { SafeParseReturnType, z } from 'zod' -import { TMedewerker } from './medewerkers.types' - -export class Medewerker implements TMedewerker { - - public id: string - public voornaam: string - public tussenvoegsel: string - public achternaam: string - public email: string - public telefoonnummer: string - - constructor(source: TMedewerker) { - this.id = source.id || '' - this.voornaam = source.voornaam || '' - this.tussenvoegsel = source.tussenvoegsel || '' - this.achternaam = source.achternaam || '' - this.email = source.email || '' - this.telefoonnummer = source.telefoonnummer || '' - } - - public validate(): SafeParseReturnType { - const schema = z.object({ - id: z.string().optional(), - voornaam: z.string().min(1), - tussenvoegsel: z.string(), - achternaam: z.string(), - email: z.string().email(), - telefoonnummer: z.string().min(1), - }) - - return schema.safeParse(this) - } - -} +import { SafeParseReturnType, z } from 'zod' +import { TMedewerker } from './medewerkers.types' + +export class Medewerker implements TMedewerker { + + public id: string + public voornaam: string + public tussenvoegsel: string + public achternaam: string + public email: string + public telefoonnummer: string + + constructor(source: TMedewerker) { + this.id = source.id || '' + this.voornaam = source.voornaam || '' + this.tussenvoegsel = source.tussenvoegsel || '' + this.achternaam = source.achternaam || '' + this.email = source.email || '' + this.telefoonnummer = source.telefoonnummer || '' + } + + public validate(): SafeParseReturnType { + const schema = z.object({ + id: z.string().optional(), + voornaam: z.string().min(1), + tussenvoegsel: z.string(), + achternaam: z.string(), + email: z.string().email(), + telefoonnummer: z.string().min(1), + }) + + return schema.safeParse(this) + } + +} diff --git a/src/entities/medewerkers/medewerkers.types.ts b/src/entities/medewerkers/medewerkers.types.ts index 3face2b..df6ec55 100644 --- a/src/entities/medewerkers/medewerkers.types.ts +++ b/src/entities/medewerkers/medewerkers.types.ts @@ -1,8 +1,8 @@ -export type TMedewerker = { - id: string; - voornaam: string; - tussenvoegsel: string; - achternaam: string; - email: string; - telefoonnummer: string; -} +export type TMedewerker = { + id: string; + voornaam: string; + tussenvoegsel: string; + achternaam: string; + email: string; + telefoonnummer: string; +} diff --git a/src/modals/contactMomenten/ContactMomentenForm.vue b/src/modals/contactMomenten/ContactMomentenForm.vue index d296226..422209a 100644 --- a/src/modals/contactMomenten/ContactMomentenForm.vue +++ b/src/modals/contactMomenten/ContactMomentenForm.vue @@ -1,1032 +1,1032 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/modals/klantRegister/ViewKlantRegister.vue b/src/modals/klantRegister/ViewKlantRegister.vue index 074da71..5d75e4d 100644 --- a/src/modals/klantRegister/ViewKlantRegister.vue +++ b/src/modals/klantRegister/ViewKlantRegister.vue @@ -1,437 +1,437 @@ - - - - - - + + + + + + diff --git a/src/modals/klanten/SearchKlantModal.vue b/src/modals/klanten/SearchKlantModal.vue index e18b0c7..6b2d802 100644 --- a/src/modals/klanten/SearchKlantModal.vue +++ b/src/modals/klanten/SearchKlantModal.vue @@ -1,402 +1,402 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/modals/medewerkers/EditMedewerker.vue b/src/modals/medewerkers/EditMedewerker.vue index 563f726..0d0f98b 100644 --- a/src/modals/medewerkers/EditMedewerker.vue +++ b/src/modals/medewerkers/EditMedewerker.vue @@ -1,166 +1,166 @@ - - - - - - - + + + + + + + diff --git a/src/modals/zaakTypen/DeleteZaaktype.vue b/src/modals/zaakTypen/DeleteZaaktype.vue index 514ddbb..fe1edff 100644 --- a/src/modals/zaakTypen/DeleteZaaktype.vue +++ b/src/modals/zaakTypen/DeleteZaaktype.vue @@ -1,98 +1,98 @@ - - - - - + + + + + diff --git a/src/modals/zaakTypen/ZaaktypeForm.vue b/src/modals/zaakTypen/ZaaktypeForm.vue index 38cd3dc..088181d 100644 --- a/src/modals/zaakTypen/ZaaktypeForm.vue +++ b/src/modals/zaakTypen/ZaaktypeForm.vue @@ -1,290 +1,290 @@ - - - - - + + + + + diff --git a/src/modals/zaken/AddBerichtToZaak.vue b/src/modals/zaken/AddBerichtToZaak.vue index fffed4a..4a7849e 100644 --- a/src/modals/zaken/AddBerichtToZaak.vue +++ b/src/modals/zaken/AddBerichtToZaak.vue @@ -1,146 +1,146 @@ - - - - - - - + + + + + + + diff --git a/src/modals/zaken/AddRolToZaak.vue b/src/modals/zaken/AddRolToZaak.vue index b62c9e7..433a6e4 100644 --- a/src/modals/zaken/AddRolToZaak.vue +++ b/src/modals/zaken/AddRolToZaak.vue @@ -1,149 +1,149 @@ - - - - - - - + + + + + + + diff --git a/src/modals/zaken/AddTaakToZaak.vue b/src/modals/zaken/AddTaakToZaak.vue index b9799e1..ec919b5 100644 --- a/src/modals/zaken/AddTaakToZaak.vue +++ b/src/modals/zaken/AddTaakToZaak.vue @@ -1,150 +1,150 @@ - - - - - - - + + + + + + + diff --git a/src/services/icons/icon/icon-calendar-check-outline.js b/src/services/icons/icon/icon-calendar-check-outline.js index 1124ab5..7b1a74c 100644 --- a/src/services/icons/icon/icon-calendar-check-outline.js +++ b/src/services/icons/icon/icon-calendar-check-outline.js @@ -1,13 +1,13 @@ -import { getTheme } from '../../getTheme.js' - -/** - * Returns the correct 'calendar-check-outline' icon based on the theme as a class name. - * - * this class name can be put into a component that accepts an 'icon' prop - * @return {string} - */ -export function iconCalendarCheckOutline() { - const theme = getTheme() - - return theme === 'light' ? 'icon-calendar-check-outline-dark' : 'icon-calendar-check-outline-light' -} +import { getTheme } from '../../getTheme.js' + +/** + * Returns the correct 'calendar-check-outline' icon based on the theme as a class name. + * + * this class name can be put into a component that accepts an 'icon' prop + * @return {string} + */ +export function iconCalendarCheckOutline() { + const theme = getTheme() + + return theme === 'light' ? 'icon-calendar-check-outline-dark' : 'icon-calendar-check-outline-light' +} diff --git a/src/services/icons/icons.css b/src/services/icons/icons.css index 5b381ca..98d9e3f 100644 --- a/src/services/icons/icons.css +++ b/src/services/icons/icons.css @@ -1,23 +1,23 @@ -/* progress close */ -.icon-progress-close-dark { - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+DQogICAgPHBhdGgNCiAgICAgICAgZD0iTTEzIDIuMDNWNC4wNUMxNy4zOSA0LjU5IDIwLjUgOC41OCAxOS45NiAxMi45N0MxOS41IDE2LjYxIDE2LjY0IDE5LjUgMTMgMTkuOTNWMjEuOTNDMTguNSAyMS4zOCAyMi41IDE2LjUgMjEuOTUgMTFDMjEuNSA2LjI1IDE3LjczIDIuNSAxMyAyLjAzTTExIDIuMDZDOS4wNSAyLjI1IDcuMTkgMyA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DkuNTcgNC4yNiAxMSA0LjA2VjIuMDZNNC4yNiA1LjY3QzMgNy4xOSAyLjI1IDkuMDQgMi4wNSAxMUg0LjA1QzQuMjQgOS41OCA0LjggOC4yMyA1LjY5IDcuMUw0LjI2IDUuNjdNMi4wNiAxM0MyLjI2IDE0Ljk2IDMuMDMgMTYuODEgNC4yNyAxOC4zM0w1LjY5IDE2LjlDNC44MSAxNS43NyA0LjI0IDE0LjQyIDQuMDYgMTNIMi4wNk03LjEgMTguMzdMNS42NyAxOS43NEM3LjE4IDIxIDkuMDQgMjEuNzkgMTEgMjJWMjBDOS41OCAxOS44MiA4LjIzIDE5LjI1IDcuMSAxOC4zN00xNC41OSA4TDEyIDEwLjU5TDkuNDEgOEw4IDkuNDFMMTAuNTkgMTJMOCAxNC41OUw5LjQxIDE2TDEyIDEzLjQxTDE0LjU5IDE2TDE2IDE0LjU5TDEzLjQxIDEyTDE2IDkuNDFMMTQuNTkgOFoiDQogICAgICAgIHN0eWxlPSJmaWxsLXJ1bGU6bm9uemVybyIgZmlsbD0iI2ZmZmZmZiIgLz4NCjwvc3ZnPg==); -} - -/* pencil */ -.icon-pencil-dark { - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIwLjcxLDcuMDRDMjEuMSw2LjY1IDIxLjEsNiAyMC43MSw1LjYzTDE4LjM3LDMuMjlDMTgsMi45IDE3LjM1LDIuOSAxNi45NiwzLjI5TDE1LjEyLDUuMTJMMTguODcsOC44N00zLDE3LjI1VjIxSDYuNzVMMTcuODEsOS45M0wxNC4wNiw2LjE4TDMsMTcuMjVaIiAvPjwvc3ZnPg==); -} -.icon-pencil-light { - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIwLjcxLDcuMDRDMjEuMSw2LjY1IDIxLjEsNiAyMC43MSw1LjYzTDE4LjM3LDMuMjlDMTgsMi45IDE3LjM1LDIuOSAxNi45NiwzLjI5TDE1LjEyLDUuMTJMMTguODcsOC44N00zLDE3LjI1VjIxSDYuNzVMMTcuODEsOS45M0wxNC4wNiw2LjE4TDMsMTcuMjVaIiBmaWxsPSIjZmZmZmZmIiAvPjwvc3ZnPg==); -} - -/* CalendarCheckOutline */ -.icon-calendar-check-outline-dark { - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTE5IDNIMThWMUgxNlYzSDhWMUg2VjNINUMzLjkgMyAzIDMuOSAzIDVWMTlDMyAyMC4xMSAzLjkgMjEgNSAyMUgxOUMyMC4xMSAyMSAyMSAyMC4xMSAyMSAxOVY1QzIxIDMuOSAyMC4xMSAzIDE5IDNNMTkgMTlINVY5SDE5VjE5TTUgN1Y1SDE5VjdINU0xMC41NiAxNy40NkwxNi41IDExLjUzTDE1LjQzIDEwLjQ3TDEwLjU2IDE1LjM0TDguNDUgMTMuMjNMNy4zOSAxNC4yOUwxMC41NiAxNy40NloiIC8+PC9zdmc+); -} -.icon-calendar-check-outline-light { - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTE5IDNIMThWMUgxNlYzSDhWMUg2VjNINUMzLjkgMyAzIDMuOSAzIDVWMTlDMyAyMC4xMSAzLjkgMjEgNSAyMUgxOUMyMC4xMSAyMSAyMSAyMC4xMSAyMSAxOVY1QzIxIDMuOSAyMC4xMSAzIDE5IDNNMTkgMTlINVY5SDE5VjE5TTUgN1Y1SDE5VjdINU0xMC41NiAxNy40NkwxNi41IDExLjUzTDE1LjQzIDEwLjQ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g==); +} + +/* pencil */ +.icon-pencil-dark { + background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIwLjcxLDcuMDRDMjEuMSw2LjY1IDIxLjEsNiAyMC43MSw1LjYzTDE4LjM3LDMuMjlDMTgsMi45IDE3LjM1LDIuOSAxNi45NiwzLjI5TDE1LjEyLDUuMTJMMTguODcsOC44N00zLDE3LjI1VjIxSDYuNzVMMTcuODEsOS45M0wxNC4wNiw2LjE4TDMsMTcuMjVaIiAvPjwvc3ZnPg==); +} +.icon-pencil-light { + background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIwLjcxLDcuMDRDMjEuMSw2LjY1IDIxLjEsNiAyMC43MSw1LjYzTDE4LjM3LDMuMjlDMTgsMi45IDE3LjM1LDIuOSAxNi45NiwzLjI5TDE1LjEyLDUuMTJMMTguODcsOC44N00zLDE3LjI1VjIxSDYuNzVMMTcuODEsOS45M0wxNC4wNiw2LjE4TDMsMTcuMjVaIiBmaWxsPSIjZmZmZmZmIiAvPjwvc3ZnPg==); +} + +/* CalendarCheckOutline */ +.icon-calendar-check-outline-dark { + background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTE5IDNIMThWMUgxNlYzSDhWMUg2VjNINUMzLjkgMyAzIDMuOSAzIDVWMTlDMyAyMC4xMSAzLjkgMjEgNSAyMUgxOUMyMC4xMSAyMSAyMSAyMC4xMSAyMSAxOVY1QzIxIDMuOSAyMC4xMSAzIDE5IDNNMTkgMTlINVY5SDE5VjE5TTUgN1Y1SDE5VjdINU0xMC41NiAxNy40NkwxNi41IDExLjUzTDE1LjQzIDEwLjQ3TDEwLjU2IDE1LjM0TDguNDUgMTMuMjNMNy4zOSAxNC4yOUwxMC41NiAxNy40NloiIC8+PC9zdmc+); +} +.icon-calendar-check-outline-light { + background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTE5IDNIMThWMUgxNlYzSDhWMUg2VjNINUMzLjkgMyAzIDMuOSAzIDVWMTlDMyAyMC4xMSAzLjkgMjEgNSAyMUgxOUMyMC4xMSAyMSAyMSAyMC4xMSAyMSAxOVY1QzIxIDMuOSAyMC4xMSAzIDE5IDNNMTkgMTlINVY5SDE5VjE5TTUgN1Y1SDE5VjdINU0xMC41NiAxNy40NkwxNi41IDExLjUzTDE1LjQzIDEwLjQ3TDEwLjU2IDE1LjM0TDguNDUgMTMuMjNMNy4zOSAxNC4yOUwxMC41NiAxNy40NloiIGZpbGw9IiNmZmZmZmYiIC8+PC9zdmc+); } \ No newline at end of file diff --git a/src/services/icons/index.js b/src/services/icons/index.js index f2e0c7d..38f5d85 100644 --- a/src/services/icons/index.js +++ b/src/services/icons/index.js @@ -1,7 +1,7 @@ -import { iconProgressClose as _iconProgressClose } from './icon/icon-progress-close.js' -import { iconPencil as _iconPencil } from './icon/icon-pencil.js' -import { iconCalendarCheckOutline as _iconCalendarCheckOutline } from './icon/icon-calendar-check-outline.js' - -export const iconProgressClose = _iconProgressClose() -export const iconPencil = _iconPencil() -export const iconCalendarCheckOutline = _iconCalendarCheckOutline() +import { iconProgressClose as _iconProgressClose } from './icon/icon-progress-close.js' +import { iconPencil as _iconPencil } from './icon/icon-pencil.js' +import { iconCalendarCheckOutline as _iconCalendarCheckOutline } from './icon/icon-calendar-check-outline.js' + +export const iconProgressClose = _iconProgressClose() +export const iconPencil = _iconPencil() +export const iconCalendarCheckOutline = _iconCalendarCheckOutline() diff --git a/src/views/contactMomenten/ContactMomentDetails.vue b/src/views/contactMomenten/ContactMomentDetails.vue index 79e5d53..d29f2ce 100644 --- a/src/views/contactMomenten/ContactMomentDetails.vue +++ b/src/views/contactMomenten/ContactMomentDetails.vue @@ -1,224 +1,224 @@ - - - - - - - + + + + + + + diff --git a/src/views/contactMomenten/ContactMomentenIndex.vue b/src/views/contactMomenten/ContactMomentenIndex.vue index f985d80..9955d9a 100644 --- a/src/views/contactMomenten/ContactMomentenIndex.vue +++ b/src/views/contactMomenten/ContactMomentenIndex.vue @@ -1,46 +1,46 @@ - - - - - + + + + + diff --git a/src/views/contactMomenten/ContactMomentenList.vue b/src/views/contactMomenten/ContactMomentenList.vue index 2be1a1f..3f067b7 100644 --- a/src/views/contactMomenten/ContactMomentenList.vue +++ b/src/views/contactMomenten/ContactMomentenList.vue @@ -1,190 +1,190 @@ - - - - - + + + + + diff --git a/src/views/medewerkers/MedewerkerDetails.vue b/src/views/medewerkers/MedewerkerDetails.vue index 4252e52..c73873e 100644 --- a/src/views/medewerkers/MedewerkerDetails.vue +++ b/src/views/medewerkers/MedewerkerDetails.vue @@ -1,164 +1,164 @@ - - - - - - - + + + + + + + diff --git a/src/views/medewerkers/MedewerkerList.vue b/src/views/medewerkers/MedewerkerList.vue index b43f6f4..f556bf8 100644 --- a/src/views/medewerkers/MedewerkerList.vue +++ b/src/views/medewerkers/MedewerkerList.vue @@ -1,189 +1,189 @@ - - - - - + + + + + diff --git a/src/views/widgets/ContactMomentenWidget.vue b/src/views/widgets/ContactMomentenWidget.vue index 761e906..6db5d9b 100644 --- a/src/views/widgets/ContactMomentenWidget.vue +++ b/src/views/widgets/ContactMomentenWidget.vue @@ -1,211 +1,211 @@ - - - - - - + + + + + + diff --git a/src/views/widgets/TakenWidget.vue b/src/views/widgets/TakenWidget.vue index ca60f47..e5e1a16 100644 --- a/src/views/widgets/TakenWidget.vue +++ b/src/views/widgets/TakenWidget.vue @@ -1,225 +1,225 @@ - - - - - - + + + + + + From 9a7baedc7292e8081b9e6d186964ce539762a730 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Wed, 18 Dec 2024 10:18:55 +0100 Subject: [PATCH 3/4] Operationalise objects controller --- appinfo/routes.php | 6 ++++++ lib/Controller/ObjectsController.php | 10 +++++++--- lib/Service/ObjectService.php | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index cf4db34..cae6f6d 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -58,5 +58,11 @@ ['name' => 'settings#create', 'url' => '/settings', 'verb' => 'POST'], // User ['name' => 'users#me', 'url' => '/me', 'verb' => 'GET'], + ['name' => 'objects#index', 'url' => '/api/objects/{_objectType}', 'verb' => 'GET', 'requirements' => ['_objectType' => '[^/]+']], + ['name' => 'objects#show', 'url' => '/api/objects/{_objectType}/{id}', 'verb' => 'GET', 'requirements' => ['_objectType' => '[^/]+', 'id' => '[^/]+']], + ['name' => 'objects#getAuditTrail', 'url' => '/api/objects/{_objectType}/{id}/audit_trail', 'verb' => 'GET', 'requirements' => ['_objectType' => '[^/]+', 'id' => '[^/]+']], + ['name' => 'objects#create', 'url' => '/api/objects/{_objectType}', 'verb' => 'POST', 'requirements' => ['_objectType' => '[^/]+', 'id' => '[^/]+']], + ['name' => 'objects#update', 'url' => '/api/objects/{_objectType}/{id}', 'verb' => 'PUT', 'requirements' => ['_objectType' => '[^/]+', 'id' => '[^/]+']], + ['name' => 'objects#destroy', 'url' => '/api/objects/{_objectType}/{id}', 'verb' => 'DELETE', 'requirements' => ['_objectType' => '[^/]+', 'id' => '[^/]+']] ] ]; diff --git a/lib/Controller/ObjectsController.php b/lib/Controller/ObjectsController.php index f39ee49..900fc1e 100644 --- a/lib/Controller/ObjectsController.php +++ b/lib/Controller/ObjectsController.php @@ -36,7 +36,7 @@ private function validateObjectType(array $requestParams): string { } $objectType = $requestParams['_objectType']; - + try { // This will throw an exception if object type is not properly configured $this->objectService->getMapper($objectType); @@ -64,6 +64,8 @@ public function index(): JSONResponse // Validate object type configuration $objectType = $this->validateObjectType($requestParams); + unset($requestParams['_objectType']); + // Fetch objects based on filters and order using provided objectType $data = $this->objectService->getResultArrayForRequest( objectType: $objectType, @@ -132,10 +134,11 @@ public function create(): JSONResponse // Remove the 'id' field if it exists, as we're creating a new object unset($data['id']); unset($data['_objectType']); + unset($data['_route']); // Save the new object $object = $this->objectService->saveObject($objectType, $data); - + // Return the created object as a JSON response return new JSONResponse($object); } catch (Exception $e) { @@ -164,10 +167,11 @@ public function update(string $id): JSONResponse // Ensure ID in data matches URL parameter $data['id'] = $id; unset($data['_objectType']); + unset($data['_route']); // Save the updated object $object = $this->objectService->saveObject($objectType, $data); - + // Return the updated object as a JSON response return new JSONResponse($object); } catch (Exception $e) { diff --git a/lib/Service/ObjectService.php b/lib/Service/ObjectService.php index ab77564..4d89ef8 100644 --- a/lib/Service/ObjectService.php +++ b/lib/Service/ObjectService.php @@ -49,7 +49,7 @@ public function __construct( * @throws NotFoundExceptionInterface|ContainerExceptionInterface If OpenRegister service is not available or if register/schema is not configured. * @throws Exception */ - private function getMapper(string $objectType): mixed + public function getMapper(string $objectType): mixed { $objectTypeLower = strtolower($objectType); From bc42bd03c3061a56575608054467778b39442e10 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Wed, 18 Dec 2024 10:21:33 +0100 Subject: [PATCH 4/4] Add producten to settings --- lib/Controller/SettingsController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 31f7270..5c92b85 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -105,7 +105,10 @@ public function index(): JSONResponse 'contactmomenten_register' => '', 'medewerkers_source' => 'internal', 'medewerkers_schema' => '', - 'medewerkers_register' => '' + 'medewerkers_register' => '', + 'producten_source' => 'internal', + 'producten_schema' => '', + 'producten_register' => '', ]; // Get the current values for the object types from the configuration