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:
@@ -14,31 +14,28 @@ namespace Apoloz\AlfaBank\Data\NominalAccounts\Beneficiaries;
|
||||
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
||||
// <BELIEF_STATE "This DTO handles complex nested structures (`DigestSignatureData`, `AddressData`, `DocumentData`, `PersonalInformationData`), requiring `DataCollectionOf` for typed arrays.">
|
||||
use Apoloz\AlfaBank\Data\NominalAccounts\Payouts\DigestSignatureData;
|
||||
use Apoloz\AlfaBank\Traits\SignableData;
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
use Spatie\LaravelData\Attributes\Validation\Email;
|
||||
use Spatie\LaravelData\Attributes\Validation\Numeric;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define a DTO for updating an existing beneficiary.">
|
||||
// <BELIEF_STATE "This DTO provides a robust contract for updating beneficiary details. By making most fields nullable, it supports partial updates (PATCH-like behavior) even if the API uses PUT.">
|
||||
// <BELIEF_STATE "This DTO provides a structured format for updating beneficiary details. By mirroring the structure of the creation DTO but making most fields optional, it supports partial updates while maintaining type safety.">
|
||||
class UpdateBeneficiaryRequestData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define all properties for the beneficiary update request, including nested DTOs and collections.">
|
||||
// <BELIEF_STATE "Similar to `CreateBeneficiaryRequestData`, this constructor lists all updatable fields. Mandatory fields are `type` and `digestSignatures`. Most other fields are nullable to allow for partial updates, reflecting the flexibility often needed in update operations.">
|
||||
use SignableData;
|
||||
|
||||
// <SECTION name="constructor_properties" intent="Define all properties for the beneficiary update request.">
|
||||
// <BELIEF_STATE "The constructor includes mandatory `digestSignatures`. Most other fields are nullable to allow for partial updates, reflecting the flexibility often needed in update operations.">
|
||||
public function __construct(
|
||||
public string $type,
|
||||
#[DataCollectionOf(DigestSignatureData::class)]
|
||||
public DataCollection $digestSignatures,
|
||||
public ?string $name = null,
|
||||
public ?string $registrationDate = null,
|
||||
public ?PersonalInformationData $personalInformation = null,
|
||||
public ?string $phoneNumber = null,
|
||||
public ?string $email = null,
|
||||
public ?DataCollection $digestSignatures = null,
|
||||
public ?string $type = null,
|
||||
public ?string $countryOfTaxResidence = null,
|
||||
#[DataCollectionOf(AddressData::class)]
|
||||
public ?DataCollection $addresses = null,
|
||||
#[DataCollectionOf(DocumentData::class)]
|
||||
public ?DataCollection $documents = null,
|
||||
public ?bool $isActive = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
public ?string $accountNumber = null,
|
||||
public ?bool $taxResidentUS = null,
|
||||
|
||||
Reference in New Issue
Block a user