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

42 lines
1.9 KiB
PHP

<?php
declare(strict_types=1);
/*
// MODULE_CONTRACT: Defines the data structure for a single payment requisite.
// RESPONSIBILITY: To hold and type-safely represent the details of a registered payment method (e.g., bank account, card, phone).
// INPUTS: Raw JSON object from the API response.
// OUTPUTS: A structured object containing requisite details.
// LINKS: Requests/NominalAccounts/Beneficiaries/Requisites/GetRequisitesRequest.php
*/
namespace Apoloz\AlfaBank\Data\NominalAccounts\Beneficiaries\Requisites;
// <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 a single payment requisite.">
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for requisite data, crucial for managing payment methods reliably.">
class RequisiteData extends Data
{
// <SECTION name="constructor_properties" intent="Define the properties of a payment requisite.">
// <BELIEF_STATE "The constructor includes a mix of mandatory (`type`, `isMain`, `isActive`) and optional fields (`id`, `pan`, `phoneNumber`, `accountNumber`, `bankId`, `bik`, `name`, `inn`, `kpp`). These fields describe the payment method and its current status.">
public function __construct(
public string $type,
public bool $isMain,
public bool $isActive,
public ?string $id = null, // Requisite ID might be generated on creation
public ?string $pan = null,
public ?string $phoneNumber = null,
public ?string $bankId = null,
public ?string $accountNumber = null,
public ?string $bik = null,
public ?string $name = null,
public ?string $inn = null,
public ?string $kpp = null,
) {}
// </SECTION>
}