diff --git a/CHANGELOG.md b/CHANGELOG.md index f3401d4..303b174 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +This is a hack so the CHANGELOG is messed up. +Generated by build_release.sh # Changelog All notable changes to this project will be documented in this file. @@ -7,23 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [3.3.1] - 2026-06-17 - Fixing Datafordeler "Remove place name" functionality - -## [3.3.0] - 2026-06-08 - -* [PR-33](https://github.com/OS2web/os2web_datalookup/pull/33) - Adding Datafordeler P-number lookup - -## [3.2.0] - 2026-05-29 - -* [PR-32](https://github.com/OS2web/os2web_datalookup/pull/32) - Adding Datafordeler address lookup +* [PR-31](https://github.com/OS2web/os2web_datalookup/pull/30) + Fetch first, middle and last name in CPR Lookup. ## [3.1.0] - 2026-04-27 * [PR-29](https://github.com/OS2web/os2web_datalookup/pull/29) - Datafordeler CVR service endpoint update - GraphQL. + Datafordeler CVR service endpoint update - GraphQL. ## [3.0.3] - 2025-11-19 @@ -68,7 +60,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Audit logging. -[Unreleased]: https://github.com/os2web/os2web_datalookup/compare/3.0.0...HEAD +[Unreleased]: https://github.com/os2web/os2web_datalookup/compare/3.1.0...HEAD +[3.1.0]: https://github.com/os2web/os2web_datalookup/compare/3.0.3...3.1.0 +[3.0.3]: https://github.com/os2web/os2web_datalookup/compare/3.0.2...3.0.3 +[3.0.2]: https://github.com/os2web/os2web_datalookup/compare/3.0.1...3.0.2 +[3.0.1]: https://github.com/os2web/os2web_datalookup/compare/3.0.0...3.0.1 [3.0.0]: https://github.com/os2web/os2web_datalookup/compare/2.0.4...3.0.0 [2.0.4]: https://github.com/os2web/os2web_datalookup/compare/2.0.3...2.0.4 [2.0.3]: https://github.com/os2web/os2web_datalookup/compare/2.0.2...2.0.3 diff --git a/build_release.sh b/build_release.sh new file mode 100755 index 0000000..a6e5662 --- /dev/null +++ b/build_release.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# selvbetjening.aarhuskommune.dk branch +# Setup upstream with OS2Web Datalookup +git remote add upstream https://github.com/OS2web/os2web_datalookup.git +git fetch +git reset --hard 3.3.1 +git merge --no-ff origin/feature/fetch-first-middle-and-last-name +git checkout --theirs CHANGELOG.md +git add CHANGELOG.md +git commit -m "Merge remote-tracking branch 'origin/feature/fetch-first-middle-and-last-name' into selvbetjening.aarhuskommune.dk" + +docker run --rm --volume .:/app itkdev/php8.4-fpm:latest sed --in-place '1i This is a hack so the CHANGELOG is messed up. \nGenerated by build_release.sh' CHANGELOG.md +git add CHANGELOG.md +git commit -m "Updated CHANGELOG" diff --git a/src/LookupResult/CprLookupResult.php b/src/LookupResult/CprLookupResult.php index 0b254d3..4bc0896 100644 --- a/src/LookupResult/CprLookupResult.php +++ b/src/LookupResult/CprLookupResult.php @@ -9,6 +9,9 @@ class CprLookupResult { const CPR = 'cpr'; const NAME = 'name'; + const FIRST_NAME = 'firstName'; + const MIDDLE_NAME = 'middleName'; + const LAST_NAME = 'lastName'; const STREET = 'street'; const HOUSE_NR = 'houseNr'; const FLOOR = 'floor'; @@ -47,6 +50,27 @@ class CprLookupResult { */ protected string $name; + /** + * First name of the person. + * + * @var string + */ + protected string $firstName; + + /** + * Middle name of the person. + * + * @var string + */ + protected string $middleName; + + /** + * Last name of the person. + * + * @var string + */ + protected string $lastName; + /** * Street of the person. * @@ -253,6 +277,66 @@ public function setName(string $name): void { $this->name = $name; } + /** + * Get first name. + * + * @return string + * The first name. + */ + public function getFirstName(): string { + return $this->firstName; + } + + /** + * Set first name. + * + * @param string $firstName + * The first name. + */ + public function setFirstName(string $firstName): void { + $this->firstName = $firstName; + } + + /** + * Get middle name. + * + * @return string + * The middle name. + */ + public function getMiddleName(): string { + return $this->middleName; + } + + /** + * Set middle name. + * + * @param string $middleName + * The middle name. + */ + public function setMiddleName(string $middleName): void { + $this->middleName = $middleName; + } + + /** + * Get last name. + * + * @return string + * The last name. + */ + public function getLastName(): string { + return $this->lastName; + } + + /** + * Set last name. + * + * @param string $lastName + * The last name. + */ + public function setLastName(string $lastName): void { + $this->lastName = $lastName; + } + /** * Get street. * diff --git a/src/Plugin/os2web/DataLookup/ServiceplatformenCPRExtended.php b/src/Plugin/os2web/DataLookup/ServiceplatformenCPRExtended.php index 4550140..301f896 100644 --- a/src/Plugin/os2web/DataLookup/ServiceplatformenCPRExtended.php +++ b/src/Plugin/os2web/DataLookup/ServiceplatformenCPRExtended.php @@ -154,6 +154,9 @@ public function lookup(string $cpr, $fetchChildren = TRUE, $allowCprTestModeRepl if ($persondata->navn) { $cprResult->setName($persondata->navn->personadresseringsnavn ?? ''); + $cprResult->setFirstName($persondata->navn->fornavn ?? ''); + $cprResult->setMiddleName($persondata->navn->mellemnavn ?? ''); + $cprResult->setLastName($persondata->navn->efternavn ?? ''); } if (isset($persondata->foedselsdato)) {