Skip to content
Open
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
24 changes: 10 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions build_release.sh
Original file line number Diff line number Diff line change
@@ -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"
84 changes: 84 additions & 0 deletions src/LookupResult/CprLookupResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down
3 changes: 3 additions & 0 deletions src/Plugin/os2web/DataLookup/ServiceplatformenCPRExtended.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down