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 an identification document.
|
||||
// RESPONSIBILITY: To hold and type-safely represent details of a document like passport or ID card.
|
||||
// INPUTS: Raw JSON object from the API response or internal input.
|
||||
// OUTPUTS: A structured object containing document information.
|
||||
// LINKS: CreateBeneficiaryRequestData.php (uses this DTO)
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Data\NominalAccounts\Beneficiaries;
|
||||
|
||||
// <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 an identification document.">
|
||||
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for document data, critical for KYC (Know Your Customer) and AML (Anti-Money Laundering) compliance.">
|
||||
class DocumentData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties of an identification document.">
|
||||
// <BELIEF_STATE "The constructor includes fields common to identification documents, such as `type`, `number`, `issueDate`, and `organization`. Optional fields allow flexibility for various document types.">
|
||||
public function __construct(
|
||||
public string $type,
|
||||
public string $number,
|
||||
@@ -15,4 +29,5 @@ class DocumentData extends Data
|
||||
public ?string $expireDate = null,
|
||||
public ?string $division = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user