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 a specific amount allocated to a contractor's wallet.
|
||||
// RESPONSIBILITY: To hold and type-safely represent an amount designated for a particular wallet type (e.g., nominal, tax).
|
||||
// INPUTS: Raw JSON object or internal input.
|
||||
// OUTPUTS: A structured object containing amount and wallet type.
|
||||
// LINKS: ContractorActionRequestData.php (uses this DTO)
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Data\NominalAccounts\Deals\Steps;
|
||||
|
||||
// <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 an amount allocated to a contractor's wallet.">
|
||||
// <BELIEF_STATE "This DTO provides a precise, type-safe contract for specifying how funds are distributed across different wallet types for a contractor within a deal step, ensuring granular control over financial flows.">
|
||||
class ContractorAmountData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties of a contractor amount allocation.">
|
||||
// <BELIEF_STATE "The constructor includes optional fields for `walletType` (e.g., 'NOMINAL', 'TAX') and the `amount` to be allocated. Both are optional to allow for flexible usage, potentially being part of a larger distribution scheme where these properties might be inferred or contextually dependent.">
|
||||
public function __construct(
|
||||
public ?string $walletType = null,
|
||||
public ?string $amount = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user