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,11 +1,25 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for payer information within an unidentified transaction.
|
||||
// RESPONSIBILITY: To hold and type-safely represent the details of the party who initiated a transaction that needs identification.
|
||||
// INPUTS: Raw JSON object from the API response.
|
||||
// OUTPUTS: A structured object containing payer details.
|
||||
// LINKS: UnidentifiedTransactionData.php (uses this DTO)
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Data\NominalAccounts\Identification;
|
||||
|
||||
// <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 payer details.">
|
||||
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for payer information, which is critical for identifying the origin of an unidentified transaction.">
|
||||
class PayerData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties of a payer.">
|
||||
// <BELIEF_STATE "The constructor includes various optional fields for identifying a payer, such as `inn`, `kpp`, `accountNumber`, `name`, and bank details (`bankAccount`, `bankBik`, `bankName`). All are optional as not all information may be available for an unidentified transaction.">
|
||||
public function __construct(
|
||||
public ?string $inn = null,
|
||||
public ?string $kpp = null,
|
||||
@@ -15,4 +29,5 @@ class PayerData extends Data
|
||||
public ?string $bankBik = null,
|
||||
public ?string $bankName = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user