47 lines
2.2 KiB
PHP
47 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/*
|
|
// MODULE_CONTRACT: Defines the data structure for the request payload when creating a new universal recipient.
|
|
// RESPONSIBILITY: To hold and validate all necessary information for registering a universal recipient.
|
|
// INPUTS: Account number, type, and digest signatures.
|
|
// OUTPUTS: A structured, type-safe object for the `CreateUniversalRecipientRequest` payload.
|
|
// LINKS: Requests/NominalAccounts/UniversalRecipients/CreateUniversalRecipientRequest.php
|
|
*/
|
|
|
|
namespace Apoloz\AlfaBank\Data\NominalAccounts\UniversalRecipients;
|
|
|
|
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
|
// <BELIEF_STATE "This DTO requires `DigestSignatureData` as a collection, so `DataCollectionOf` is used.">
|
|
use Apoloz\AlfaBank\Data\NominalAccounts\Payouts\DigestSignatureData;
|
|
use Apoloz\AlfaBank\Traits\SignableData;
|
|
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
|
use Spatie\LaravelData\Attributes\Validation\Numeric;
|
|
use Spatie\LaravelData\Data;
|
|
use Spatie\LaravelData\DataCollection;
|
|
// </SECTION>
|
|
|
|
// <SECTION name="class_definition" intent="Define a DTO for creating a universal recipient.">
|
|
// <BELIEF_STATE "This DTO handles the data for universal recipients, which are a specialized type of counterparty. It ensures all necessary identification and banking details are provided.">
|
|
class CreateUniversalRecipientRequestData extends Data
|
|
{
|
|
use SignableData;
|
|
|
|
// <SECTION name="constructor_properties" intent="Define the properties of the universal recipient creation request.">
|
|
// <BELIEF_STATE "The constructor includes mandatory fields: `accountNumber` and `type` to identify the recipient and its context, and `digestSignatures` for security and authorization.">
|
|
public function __construct(
|
|
public string $accountNumber,
|
|
public string $type,
|
|
#[DataCollectionOf(DigestSignatureData::class)]
|
|
public ?DataCollection $digestSignatures = null,
|
|
public ?string $inn = null,
|
|
public ?string $kpp = null,
|
|
public ?string $ogrn = null,
|
|
public ?string $name = null,
|
|
public ?string $bankName = null,
|
|
public ?string $bankBic = null,
|
|
public ?string $bankCorrespondentAccount = null,
|
|
) {}
|
|
// </SECTION>
|
|
}
|