Files
alfa-bank-sdk/src/Data/NominalAccounts/Identification/IdentifyRequestData.php
Anatoliy Poloz b15d29f8e9 fix(formating)
2026-01-28 03:36:26 +03:00

42 lines
2.3 KiB
PHP

<?php
declare(strict_types=1);
/*
// MODULE_CONTRACT: Defines the data structure for the request payload when identifying an unidentified transaction.
// RESPONSIBILITY: To hold and validate all necessary information for associating an unidentified transaction with specific beneficiaries.
// INPUTS: Transaction ID, account number, amount distribution details, and digest signatures.
// OUTPUTS: A structured, type-safe object for the `IdentifyTransactionRequest` payload.
// LINKS: Requests/NominalAccounts/Identification/IdentifyTransactionRequest.php
*/
namespace Apoloz\AlfaBank\Data\NominalAccounts\Identification;
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components for complex nested structures.">
// <BELIEF_STATE "This DTO orchestrates several other DTOs and collections (`AmountDistributionData`, `DigestSignatureData`), 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\Data;
use Spatie\LaravelData\DataCollection;
// </SECTION>
// <SECTION name="class_definition" intent="Define a DTO for identifying a transaction.">
// <BELIEF_STATE "This DTO encapsulates the data required to link an incoming transaction to a specific beneficiary and distribute the funds. It serves as the payload for the IdentifyTransactionRequest. ">
class IdentifyRequestData extends Data
{
use SignableData;
// <SECTION name="constructor_properties" intent="Define the properties of the identification request.">
// <BELIEF_STATE "The constructor meticulously lists all mandatory fields. `transactionId` and `accountNumber` pinpoint the transaction. `amountDistribution` and `digestSignatures` are critical for the financial and security aspects of the identification process, each being a typed collection.">
public function __construct(
public string $transactionId,
public string $accountNumber,
#[DataCollectionOf(AmountDistributionData::class)]
public DataCollection $amountDistribution,
#[DataCollectionOf(DigestSignatureData::class)]
public ?DataCollection $digestSignatures = null,
) {}
// </SECTION>
}