refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -1,18 +1,33 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for the request payload when creating a new universal recipient.
|
||||
// RESPONSIBILITY: To hold and validate all necessary information for registering a universal recipient.
|
||||
// INPUTS: Account number, type, and digest signatures.
|
||||
// OUTPUTS: A structured, type-safe object for the `CreateUniversalRecipientRequest` payload.
|
||||
// LINKS: Requests/NominalAccounts/UniversalRecipients/CreateUniversalRecipientRequest.php
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Data\NominalAccounts\UniversalRecipients;
|
||||
|
||||
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
||||
// <BELIEF_STATE "This DTO requires `DigestSignatureData` as a collection, so `DataCollectionOf` is used.">
|
||||
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 universal recipient.">
|
||||
// <BELIEF_STATE "This DTO ensures the request payload is strictly typed and complete for creating a universal recipient.">
|
||||
class CreateUniversalRecipientRequestData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define all properties for the universal recipient creation request.">
|
||||
// <BELIEF_STATE "The constructor includes mandatory fields: `accountNumber` and `type` to identify the recipient and its context, and `digestSignatures` for security and authorization.">
|
||||
public function __construct(
|
||||
public string $accountNumber,
|
||||
public string $type,
|
||||
#[DataCollectionOf(DigestSignatureData::class)]
|
||||
public DataCollection $digestSignatures,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user