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,27 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for a contractor associated with a deal step.
|
||||
// RESPONSIBILITY: To hold and type-safely represent details of a beneficiary acting as a contractor within a specific deal step.
|
||||
// INPUTS: Raw JSON object from the API response.
|
||||
// OUTPUTS: A structured object containing contractor details for a deal step.
|
||||
// LINKS: Requests/NominalAccounts/Deals/Steps/GetStepContractorsRequest.php
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Data\NominalAccounts\Deals\Steps;
|
||||
|
||||
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
||||
// <BELIEF_STATE "This DTO uses `ContractorAmountData` within a collection, requiring `DataCollectionOf` for type safety.">
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define a DTO for a contractor in a deal step.">
|
||||
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for contractor details, including their role, associated amounts, and other relevant information within the context of a deal step.">
|
||||
class StepContractorData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties of a step contractor.">
|
||||
// <BELIEF_STATE "The constructor includes the `beneficiaryId`, `role` (e.g., 'DEBTOR', 'CREDITOR'), `amount`, `purpose`, `requisiteId`, and `keepOnNominalAccount` flag. The `amounts` property, if present, is a collection of `ContractorAmountData` for detailed amount distribution.">
|
||||
public function __construct(
|
||||
public ?string $beneficiaryId = null,
|
||||
public ?string $role = null,
|
||||
@@ -18,4 +32,5 @@ class StepContractorData extends Data
|
||||
#[DataCollectionOf(ContractorAmountData::class)]
|
||||
public ?DataCollection $amounts = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user