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 identifying an unidentified transaction.
|
||||
// RESPONSIBILITY: To hold and validate all necessary information for associating an unidentified transaction with specific beneficiaries.
|
||||
// INPUTS: Transaction ID, account number, amount distribution details, and digest signatures.
|
||||
// OUTPUTS: A structured, type-safe object for the `IdentifyTransactionRequest` payload.
|
||||
// LINKS: Requests/NominalAccounts/Identification/IdentifyTransactionRequest.php
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Data\NominalAccounts\Identification;
|
||||
|
||||
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components for complex nested structures.">
|
||||
// <BELIEF_STATE "This DTO orchestrates several other DTOs and collections (`AmountDistributionData`, `DigestSignatureData`), requiring `DataCollectionOf` for typed arrays.">
|
||||
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 identifying an unidentified transaction.">
|
||||
// <BELIEF_STATE "This DTO provides a robust contract for the complex payload required to identify a transaction. It ensures that critical financial and cryptographic data is correctly structured.">
|
||||
class IdentifyRequestData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define all properties for the transaction identification request.">
|
||||
// <BELIEF_STATE "The constructor meticulously lists all mandatory fields. `transactionId` and `accountNumber` pinpoint the transaction. `amountDistribution` and `digestSignatures` are critical for the financial and security aspects of the identification process, each being a typed collection.">
|
||||
public function __construct(
|
||||
public string $transactionId,
|
||||
public string $accountNumber,
|
||||
@@ -17,4 +31,5 @@ class IdentifyRequestData extends Data
|
||||
#[DataCollectionOf(DigestSignatureData::class)]
|
||||
public DataCollection $digestSignatures,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user