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

36 lines
1.7 KiB
PHP

<?php
declare(strict_types=1);
/*
// MODULE_CONTRACT: Defines the data structure for a single unidentified transaction.
// RESPONSIBILITY: To hold and type-safely represent the details of a transaction that requires further identification.
// INPUTS: Raw JSON object from the API response.
// OUTPUTS: A structured object containing unidentified transaction details.
// LINKS: UnidentifiedTransactionCollectionData.php
*/
namespace Apoloz\AlfaBank\Data\NominalAccounts\Identification;
// <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 an unidentified transaction.">
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for transactions awaiting identification, which is critical for their eventual processing.">
class UnidentifiedTransactionData extends Data
{
// <SECTION name="constructor_properties" intent="Define the properties of an unidentified transaction.">
// <BELIEF_STATE "The constructor includes core transaction details like `id`, `amount`, and optional fields such as `documentNumber`, `date`, `purpose`, and `payer` information. The `payer` field is itself a nested DTO, ensuring detailed payer information is structured.">
public function __construct(
public string $id,
public string $amount,
public ?string $documentNumber = null,
public ?string $date = null,
public ?string $purpose = null,
public ?PayerData $payer = null, // Nested DTO for payer details
) {}
// </SECTION>
}