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,14 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for the request payload when creating a new requisite.
|
||||
// RESPONSIBILITY: To hold and validate all necessary information for registering a new payment requisite for a beneficiary.
|
||||
// INPUTS: Payment type, digest signatures, and various optional requisite details (PAN, account number, phone, etc.).
|
||||
// OUTPUTS: A structured, type-safe object for the `AddRequisiteRequest` payload.
|
||||
// LINKS: Requests/NominalAccounts/Beneficiaries/Requisites/AddRequisiteRequest.php
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Data\NominalAccounts\Beneficiaries\Requisites;
|
||||
|
||||
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
||||
// <BELIEF_STATE "This DTO requires `DigestSignatureData` as a collection for security, utilizing `DataCollectionOf` for type safety.">
|
||||
use Apoloz\AlfaBank\Data\NominalAccounts\Payouts\DigestSignatureData;
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define a DTO for creating a new requisite.">
|
||||
// <BELIEF_STATE "This DTO ensures the request payload for creating a requisite is strictly typed and complete, preventing malformed requests for a critical financial operation.">
|
||||
class CreateRequisiteRequestData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define all properties for the requisite creation request.">
|
||||
// <BELIEF_STATE "The constructor includes mandatory fields like `type` and `digestSignatures`. Optional fields cover various payment methods (`pan`, `phoneNumber`, `accountNumber`) and identifiers (`bankId`, `bik`, `name`, `inn`, `kpp`, `beneficiaryId`, `isMain`).">
|
||||
public function __construct(
|
||||
public string $type,
|
||||
#[DataCollectionOf(DigestSignatureData::class)]
|
||||
@@ -24,4 +38,5 @@ class CreateRequisiteRequestData extends Data
|
||||
public ?string $kpp = null,
|
||||
public ?bool $isMain = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user