forked from apoloz/alfa-bank-sdk
38 lines
1.8 KiB
PHP
38 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/*
|
|
// MODULE_CONTRACT: Defines the data structure for a beneficiary's personal identification information.
|
|
// RESPONSIBILITY: To hold and type-safely represent an individual's personal details like name, INN, birthdate, etc.
|
|
// INPUTS: Raw JSON object from the API response or internal input.
|
|
// OUTPUTS: A structured object containing personal information.
|
|
// LINKS: CreateBeneficiaryRequestData.php (uses this DTO)
|
|
*/
|
|
|
|
namespace Apoloz\AlfaBank\Data\NominalAccounts\Beneficiaries;
|
|
|
|
// <SECTION name="module_imports" intent="Import the base Spatie Laravel Data class.">
|
|
// <BELIEF_STATE "Extending `Spatie\LaravelData\Data` enables automatic casting from JSON and provides other DTO benefits.">
|
|
use Spatie\LaravelData\Data;
|
|
|
|
// </SECTION>
|
|
|
|
// <SECTION name="class_definition" intent="Define a DTO for personal identification details.">
|
|
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for personal information, ensuring consistency and validation when handling sensitive data.">
|
|
class PersonalInformationData extends Data
|
|
{
|
|
// <SECTION name="constructor_properties" intent="Define the properties of an individual's personal information.">
|
|
// <BELIEF_STATE "The constructor includes common personal identifiers. All fields are marked as nullable, indicating they might be optional depending on the specific beneficiary type or API call. This flexibility is important when dealing with diverse data requirements.">
|
|
public function __construct(
|
|
public ?string $inn = null,
|
|
public ?string $firstName = null,
|
|
public ?string $middleName = null,
|
|
public ?string $lastName = null,
|
|
public ?string $citizenship = null,
|
|
public ?string $birthDate = null,
|
|
public ?string $birthPlace = null,
|
|
public ?string $snils = null,
|
|
) {}
|
|
// </SECTION>
|
|
}
|