forked from apoloz/alfa-bank-sdk
40 lines
2.0 KiB
PHP
40 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/*
|
|
// 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,
|
|
public ?string $amount = null,
|
|
public ?string $purpose = null,
|
|
public ?string $requisiteId = null,
|
|
public ?bool $keepOnNominalAccount = null,
|
|
#[DataCollectionOf(ContractorAmountData::class)]
|
|
public ?DataCollection $amounts = null,
|
|
) {}
|
|
// </SECTION>
|
|
}
|