63 lines
2.9 KiB
PHP
63 lines
2.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/*
|
|
// MODULE_CONTRACT: Defines the data structure for the request payload when updating an existing beneficiary.
|
|
// RESPONSIBILITY: To hold and validate all necessary information for updating a beneficiary, including partial changes.
|
|
// INPUTS: Raw data array for updated beneficiary details.
|
|
// OUTPUTS: A structured, type-safe object for the `UpdateBeneficiaryRequest` payload.
|
|
// LINKS: Requests/NominalAccounts/Beneficiaries/UpdateBeneficiaryRequest.php
|
|
*/
|
|
|
|
namespace Apoloz\AlfaBank\Data\NominalAccounts\Beneficiaries;
|
|
|
|
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
|
// <BELIEF_STATE "This DTO handles complex nested structures (`DigestSignatureData`, `AddressData`, `DocumentData`, `PersonalInformationData`), requiring `DataCollectionOf` for typed arrays.">
|
|
use Apoloz\AlfaBank\Data\NominalAccounts\Payouts\DigestSignatureData;
|
|
use Apoloz\AlfaBank\Traits\SignableData;
|
|
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
|
use Spatie\LaravelData\Attributes\Validation\Email;
|
|
use Spatie\LaravelData\Attributes\Validation\Numeric;
|
|
use Spatie\LaravelData\Data;
|
|
use Spatie\LaravelData\DataCollection;
|
|
|
|
// </SECTION>
|
|
|
|
// <SECTION name="class_definition" intent="Define a DTO for updating an existing beneficiary.">
|
|
// <BELIEF_STATE "This DTO provides a structured format for updating beneficiary details. By mirroring the structure of the creation DTO but making most fields optional, it supports partial updates while maintaining type safety.">
|
|
class UpdateBeneficiaryRequestData extends Data
|
|
{
|
|
use SignableData;
|
|
|
|
// <SECTION name="constructor_properties" intent="Define all properties for the beneficiary update request.">
|
|
// <BELIEF_STATE "The constructor includes mandatory `digestSignatures`. Most other fields are nullable to allow for partial updates, reflecting the flexibility often needed in update operations.">
|
|
public function __construct(
|
|
#[DataCollectionOf(DigestSignatureData::class)]
|
|
public ?DataCollection $digestSignatures = null,
|
|
public ?string $type = null,
|
|
public ?string $countryOfTaxResidence = null,
|
|
#[DataCollectionOf(AddressData::class)]
|
|
public ?DataCollection $addresses = null,
|
|
public ?string $accountNumber = null,
|
|
public ?bool $taxResidentUS = null,
|
|
public ?bool $foreignTaxResident = null,
|
|
public ?bool $financialActivities = null,
|
|
public ?string $name = null,
|
|
public ?string $registrationDate = null,
|
|
#[Numeric]
|
|
public ?string $inn = null,
|
|
#[Numeric]
|
|
public ?string $kpp = null,
|
|
#[Numeric]
|
|
public ?string $ogrn = null,
|
|
public ?PersonalInformationData $personalInformation = null,
|
|
public ?string $phoneNumber = null,
|
|
#[Email]
|
|
public ?string $email = null,
|
|
#[DataCollectionOf(DocumentData::class)]
|
|
public ?DataCollection $documents = null,
|
|
) {}
|
|
// </SECTION>
|
|
}
|
|
// </SECTION>
|