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

@@ -1,13 +1,27 @@
<?php
/*
// MODULE_CONTRACT: Defines the data structure for a specific beneficiary's balance.
// RESPONSIBILITY: To hold and type-safely represent the financial balance details of a beneficiary for a given account and date.
// INPUTS: Raw JSON object from the API response.
// OUTPUTS: A structured object containing beneficiary balance information.
// LINKS: Requests/NominalAccounts/Beneficiaries/GetBeneficiaryBalanceRequest.php
*/
namespace Apoloz\AlfaBank\Data\NominalAccounts\Beneficiaries;
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
// <BELIEF_STATE "This DTO represents a balance which can be composed of multiple `WalletBalanceData` objects. `DataCollectionOf` is essential for auto-casting.">
use Spatie\LaravelData\Attributes\DataCollectionOf;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\DataCollection;
// </SECTION>
// <SECTION name="class_definition" intent="Define a DTO for a beneficiary's balance details.">
// <BELIEF_STATE "A dedicated DTO ensures the balance information is always accessed in a type-safe and consistent manner, preventing common errors when dealing with financial data.">
class BeneficiaryBalanceData extends Data
{
// <SECTION name="constructor_properties" intent="Define the properties related to a beneficiary's balance.">
// <BELIEF_STATE "Properties like `beneficiaryId`, `accountNumber`, and `date` are key identifiers for the balance. The `balances` property is a collection of `WalletBalanceData`, enabling a detailed breakdown of the balance across different wallet types.">
public function __construct(
public string $beneficiaryId,
public string $accountNumber,
@@ -15,4 +29,5 @@ class BeneficiaryBalanceData extends Data
#[DataCollectionOf(WalletBalanceData::class)]
public ?DataCollection $balances = null,
) {}
// </SECTION>
}