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,29 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for the status of a deal-related request.
|
||||
// RESPONSIBILITY: To hold and type-safely represent the outcome and details of an asynchronous operation related to deals.
|
||||
// INPUTS: Raw JSON object from the API response.
|
||||
// OUTPUTS: A structured object containing request status information.
|
||||
// LINKS: Requests/NominalAccounts/Deals/GetDealRequestStatusRequest.php
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Data\NominalAccounts\Deals;
|
||||
|
||||
// <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 status of a deal request.">
|
||||
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for tracking the status of asynchronous deal operations, which is common for complex business processes.">
|
||||
class DealRequestStatusData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties of a deal request status.">
|
||||
// <BELIEF_STATE "The `requestId` and `status` are fundamental for tracking any asynchronous operation. An optional `description` can provide further details about the status.">
|
||||
public function __construct(
|
||||
public string $requestId,
|
||||
public string $status,
|
||||
public ?string $description = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user