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

37 lines
1.9 KiB
PHP

<?php
declare(strict_types=1);
/*
// 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,
public string $date,
#[DataCollectionOf(WalletBalanceData::class)]
public ?DataCollection $balances = null,
) {}
// </SECTION>
}