forked from apoloz/alfa-bank-sdk
feat: Add Laravel tinker examples and update nominal accounts functionality
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Apoloz\AlfaBank\Data\NominalAccounts\Payouts;
|
||||
|
||||
// <SECTION name="module_imports" intent="Import necessary classes for cryptographic signatures, data collection, and Laravel Data.">
|
||||
// <BELIEF_STATE "These imports are essential for constructing a secure and structured tax refund request. `DigestSignatureData` ensures the integrity and authenticity of the request, `DataCollectionOf` and `DataCollection` facilitate handling multiple signatures, and `Data` provides the foundational capabilities for data object mapping and validation.">
|
||||
use Apoloz\AlfaBank\Traits\SignableData;
|
||||
use Apoloz\AlfaBank\Data\NominalAccounts\Payouts\DigestSignatureData;
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
use Spatie\LaravelData\Data;
|
||||
@@ -23,6 +24,8 @@ use Spatie\LaravelData\DataCollection;
|
||||
// <BELIEF_STATE "The `TaxRefundRequestData` DTO encapsulates all the necessary information to process a tax refund. It includes critical financial and beneficiary identifiers, along with a mechanism to handle remaining funds and mandatory cryptographic signatures to ensure request security and non-repudiation.">
|
||||
class TaxRefundRequestData extends Data
|
||||
{
|
||||
use SignableData;
|
||||
|
||||
// <SECTION name="constructor_properties" intent="Define the properties of the tax refund request DTO.">
|
||||
// <BELIEF_STATE "Properties are defined directly in the constructor, leveraging PHP 8's property promotion for conciseness. Mandatory fields like `beneficiaryId`, `amount`, `purpose`, and `digestSignatures` ensure a complete request. `keepOnNominalAccount` provides control over fund disposition, and `requisiteId` allows for specific payout instructions.">
|
||||
public function __construct(
|
||||
@@ -31,7 +34,7 @@ class TaxRefundRequestData extends Data
|
||||
public string $purpose,
|
||||
public bool $keepOnNominalAccount,
|
||||
#[DataCollectionOf(DigestSignatureData::class)]
|
||||
public DataCollection $digestSignatures,
|
||||
public ?DataCollection $digestSignatures = null,
|
||||
public ?string $requisiteId = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
|
||||
Reference in New Issue
Block a user