refactor(core): enhance SDK structure and documentation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-01-18 21:48:25 +03:00
parent 3da69c03e1
commit d214eecebe
378 changed files with 10514 additions and 496 deletions

View File

@@ -0,0 +1,36 @@
<?php
/*
// MODULE_CONTRACT: Defines the data structure for a single transaction record.
// RESPONSIBILITY: To hold and type-safely represent the details of an individual account transaction.
// INPUTS: Raw JSON object from the API response.
// OUTPUTS: A structured object containing transaction details.
// LINKS: TransactionCollectionData.php
*/
namespace Apoloz\AlfaBank\Data\Statement;
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
// <BELIEF_STATE "This DTO includes nested `AmountData` for monetary values and `RurTransferData` for detailed transfer information.">
use Spatie\LaravelData\Data;
// </SECTION>
// <SECTION name="class_definition" intent="Define a DTO for a single account transaction.">
// <BELIEF_STATE "This DTO provides a comprehensive, type-safe representation of a transaction, essential for consistent data handling and financial reporting.">
class TransactionData extends Data
{
// <SECTION name="constructor_properties" intent="Define all properties that describe an account transaction.">
// <BELIEF_STATE "The constructor includes key identifiers like `uuid`, `transactionId`, `operationDate`, `number`, and `direction` (DEBIT/CREDIT). Crucially, `amount` and `amountRub` use the nested `AmountData` DTO to ensure monetary values are correctly associated with their currencies. `paymentPurpose` and `rurTransfer` provide additional context, with `rurTransfer` being another nested DTO for specific RUR details.">
public function __construct(
public string $uuid,
public string $transactionId,
public string $operationDate,
public string $number,
public string $direction, // DEBIT, CREDIT
public AmountData $amount, // Nested DTO for amount
public AmountData $amountRub, // Nested DTO for amount in RUB
public ?string $paymentPurpose = null,
public ?RurTransferData $rurTransfer = null, // Nested DTO for RUR specific transfer details
public ?string $correspondingAccount = null,
) {}
// </SECTION>
}