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,13 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for the response when creating a new beneficiary.
|
||||
// RESPONSIBILITY: To provide a structured, type-safe object representing the outcome of a beneficiary creation request.
|
||||
// INPUTS: Raw JSON object from the API response.
|
||||
// OUTPUTS: An object containing the request ID and status of the creation operation.
|
||||
// LINKS: Requests/NominalAccounts/Beneficiaries/CreateBeneficiaryRequest.php
|
||||
*/
|
||||
|
||||
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 the response of creating a beneficiary.">
|
||||
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for the API's response to a beneficiary creation request, allowing developers to easily access the `requestId` and `status`.">
|
||||
class CreateBeneficiaryResponseData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties of the beneficiary creation response.">
|
||||
// <BELIEF_STATE "The response primarily contains a `requestId` for tracking the operation and a `status` indicating its immediate outcome.">
|
||||
public function __construct(
|
||||
public string $requestId,
|
||||
public string $status,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user