refactor(core): enhance SDK structure and documentation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-01-18 21:48:25 +03:00
parent 3da69c03e1
commit d214eecebe
378 changed files with 10514 additions and 496 deletions

View File

@@ -1,16 +1,30 @@
<?php
/*
// MODULE_CONTRACT: Defines the data structure for the request payload to perform an action on a deal contractor.
// RESPONSIBILITY: To hold and validate all necessary information for actions such as adding or managing contractors within a deal step.
// INPUTS: Action type, deal ID, step ID, beneficiary ID, signatures, and optional financial details.
// OUTPUTS: A structured, type-safe object for the `ManageContractorRequest` payload.
// LINKS: Requests/NominalAccounts/Deals/Steps/ManageContractorRequest.php
*/
namespace Apoloz\AlfaBank\Data\NominalAccounts\Deals\Steps;
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components for complex nested data structures.">
// <BELIEF_STATE "This DTO orchestrates several other DTOs and collections (`DigestSignatureData`, `ContractorAmountData`), 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 performing an action on a deal contractor.">
// <BELIEF_STATE "This DTO provides a robust contract for managing contractors within deal steps. It ensures that critical financial and security-related data is strictly typed and correctly structured for actions like adding funds or changing status.">
class ContractorActionRequestData extends Data
{
// <SECTION name="constructor_properties" intent="Define all properties for the contractor action request.">
// <BELIEF_STATE "The constructor includes mandatory fields like `action`, `dealId`, `stepId`, `beneficiaryId`, and `digestSignatures`. Optional fields like `amount`, `purpose`, `amounts` (for detailed distribution), `keepOnNominalAccount`, and `requisiteId` provide flexibility for various contractor management scenarios.">
public function __construct(
public string $action,
public string $action, // e.g., ADD_AMOUNT, REMOVE_AMOUNT, SET_REQUISITE
public string $dealId,
public string $stepId,
public string $beneficiaryId,
@@ -19,8 +33,9 @@ class ContractorActionRequestData extends Data
public ?string $amount = null,
public ?string $purpose = null,
#[DataCollectionOf(ContractorAmountData::class)]
public ?DataCollection $amounts = null,
public ?DataCollection $amounts = null, // For detailed amount distribution
public ?bool $keepOnNominalAccount = null,
public ?string $requisiteId = null,
) {}
// </SECTION>
}