-
Notifications
You must be signed in to change notification settings - Fork 73
Add support for Related party identification structure #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Genkgo\Camt\DTO; | ||
|
||
class PrivateIdentification extends Identification | ||
{ | ||
private ?string $birthDate = null; | ||
|
||
private ?string $provinceOfBirth = null; | ||
|
||
private ?string $cityOfBirth = null; | ||
|
||
private ?string $countryOfBirth = null; | ||
|
||
private ?string $otherId = null; | ||
|
||
private ?string $otherIssuer = null; | ||
|
||
private ?string $otherSchemeName = null; | ||
|
||
public function getBirthDate(): ?string | ||
{ | ||
return $this->birthDate; | ||
} | ||
|
||
public function setBirthDate(?string $birthDate): void | ||
{ | ||
$this->birthDate = $birthDate; | ||
} | ||
|
||
public function getProvinceOfBirth(): ?string | ||
{ | ||
return $this->provinceOfBirth; | ||
} | ||
|
||
public function setProvinceOfBirth(?string $provinceOfBirth): void | ||
{ | ||
$this->provinceOfBirth = $provinceOfBirth; | ||
} | ||
|
||
public function getCityOfBirth(): ?string | ||
{ | ||
return $this->cityOfBirth; | ||
} | ||
|
||
public function setCityOfBirth(?string $cityOfBirth): void | ||
{ | ||
$this->cityOfBirth = $cityOfBirth; | ||
} | ||
|
||
public function getCountryOfBirth(): ?string | ||
{ | ||
return $this->countryOfBirth; | ||
} | ||
|
||
public function setCountryOfBirth(?string $countryOfBirth): void | ||
{ | ||
$this->countryOfBirth = $countryOfBirth; | ||
} | ||
|
||
public function getOtherId(): ?string | ||
{ | ||
return $this->otherId; | ||
} | ||
|
||
public function setOtherId(?string $otherId): void | ||
{ | ||
$this->otherId = $otherId; | ||
} | ||
|
||
public function getOtherIssuer(): ?string | ||
{ | ||
return $this->otherIssuer; | ||
} | ||
|
||
public function setOtherIssuer(?string $otherIssuer): void | ||
{ | ||
$this->otherIssuer = $otherIssuer; | ||
} | ||
|
||
public function getOtherSchemeName(): ?string | ||
{ | ||
return $this->otherSchemeName; | ||
} | ||
|
||
public function setOtherSchemeName(?string $otherSchemeName): void | ||
{ | ||
$this->otherSchemeName = $otherSchemeName; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Genkgo\Camt\Decoder\Factory\DTO; | ||
|
||
use Genkgo\Camt\DTO; | ||
use SimpleXMLElement; | ||
|
||
class PrivateIdentification | ||
{ | ||
public static function createFromXml(SimpleXMLElement $xmlPrivateIdentification): DTO\PrivateIdentification | ||
{ | ||
$privateIdentification = new DTO\PrivateIdentification(); | ||
if (isset($xmlPrivateIdentification->DtAndPlcOfBirth)) { | ||
if (isset($xmlPrivateIdentification->DtAndPlcOfBirth->BirthDt)) { | ||
$privateIdentification->setBirthDate((string) $xmlPrivateIdentification->DtAndPlcOfBirth->BirthDt); | ||
} | ||
if (isset($xmlPrivateIdentification->DtAndPlcOfBirth->PrvcOfBirth)) { | ||
$privateIdentification->setProvinceOfBirth((string) $xmlPrivateIdentification->DtAndPlcOfBirth->PrvcOfBirth); | ||
} | ||
if (isset($xmlPrivateIdentification->DtAndPlcOfBirth->CityOfBirth)) { | ||
$privateIdentification->setCityOfBirth((string) $xmlPrivateIdentification->DtAndPlcOfBirth->CityOfBirth); | ||
} | ||
if (isset($xmlPrivateIdentification->DtAndPlcOfBirth->CtryOfBirth)) { | ||
$privateIdentification->setCountryOfBirth((string) $xmlPrivateIdentification->DtAndPlcOfBirth->CtryOfBirth); | ||
} | ||
} | ||
if (isset($xmlPrivateIdentification->Othr)) { | ||
if (isset($xmlPrivateIdentification->Othr->Id)) { | ||
$privateIdentification->setOtherId((string) $xmlPrivateIdentification->Othr->Id); | ||
} | ||
|
||
if (isset($xmlPrivateIdentification->Othr->SchmeNm)) { | ||
if (isset($xmlPrivateIdentification->Othr->SchmeNm->Cd)) { | ||
$privateIdentification->setOtherSchemeName((string) $xmlPrivateIdentification->Othr->SchmeNm->Cd); | ||
} | ||
if (isset($xmlPrivateIdentification->Othr->SchmeNm->Prtry)) { | ||
$privateIdentification->setOtherSchemeName((string) $xmlPrivateIdentification->Othr->SchmeNm->Prtry); | ||
} | ||
} | ||
if (isset($xmlPrivateIdentification->Othr->Issr)) { | ||
$privateIdentification->setOtherIssuer((string) $xmlPrivateIdentification->Othr->Issr); | ||
} | ||
} | ||
|
||
return $privateIdentification; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,23 @@ | |
"getSubDepartment": null, | ||
"getTownName": null | ||
}, | ||
"getIdentification": { | ||
"__CLASS__": "Genkgo\\Camt\\DTO\\OrganisationIdentification", | ||
"getBankPartyId": null, | ||
"getBei": null, | ||
"getBic": null, | ||
"getChipsUniversalId": null, | ||
"getDuns": null, | ||
"getEangln": null, | ||
"getIbei": null, | ||
"getIdentification": "455454654", | ||
"getIssuer": null, | ||
"getOtherId": "455454654", | ||
"getOtherIssuer": "KBO-BCE", | ||
"getOtherSchemeName": null, | ||
"getOtherType": null, | ||
"getTaxId": null | ||
}, | ||
"getName": "Company Name" | ||
} | ||
}, | ||
|
@@ -160,6 +177,7 @@ | |
"getSubDepartment": null, | ||
"getTownName": null | ||
}, | ||
"getIdentification": null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an inconsistency in how identification is represented; in some sections it is defined as an object and here as null. It would be helpful to document the conditions under which each representation is used to avoid confusion. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
"getName": "NAME NAME" | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,6 +201,23 @@ | |
"getSubDepartment": null, | ||
"getTownName": null | ||
}, | ||
"getIdentification": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The JSON representation for identification here is provided as a full object, whereas in similar contexts it is set to null. Consider adding documentation or comments to clarify when a full identification object is expected versus a null value. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
"__CLASS__": "Genkgo\\Camt\\DTO\\OrganisationIdentification", | ||
"getBankPartyId": null, | ||
"getBei": null, | ||
"getBic": null, | ||
"getChipsUniversalId": null, | ||
"getDuns": null, | ||
"getEangln": null, | ||
"getIbei": null, | ||
"getIdentification": "455454654", | ||
"getIssuer": null, | ||
"getOtherId": "455454654", | ||
"getOtherIssuer": "KBO-BCE", | ||
"getOtherSchemeName": null, | ||
"getOtherType": null, | ||
"getTaxId": null | ||
}, | ||
"getName": "Company Name" | ||
} | ||
}, | ||
|
@@ -232,6 +249,7 @@ | |
"getSubDepartment": null, | ||
"getTownName": null | ||
}, | ||
"getIdentification": null, | ||
"getName": "NAME NAME" | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.