forked from apoloz/alfa-bank-sdk
refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -1,16 +1,30 @@
|
||||
<?php
|
||||
/*
|
||||
// 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 $id = null,
|
||||
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,
|
||||
@@ -20,4 +34,5 @@ class RequisiteData extends Data
|
||||
public ?string $inn = null,
|
||||
public ?string $kpp = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user