49 lines
2.4 KiB
PHP
49 lines
2.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/*
|
|
// MODULE_CONTRACT: Defines the data structure for the request payload when creating a new requisite.
|
|
// RESPONSIBILITY: To hold and validate all necessary information for registering a new payment requisite for a beneficiary.
|
|
// INPUTS: Payment type, digest signatures, and various optional requisite details (PAN, account number, phone, etc.).
|
|
// OUTPUTS: A structured, type-safe object for the `AddRequisiteRequest` payload.
|
|
// LINKS: Requests/NominalAccounts/Beneficiaries/Requisites/AddRequisiteRequest.php
|
|
*/
|
|
|
|
namespace Apoloz\AlfaBank\Data\NominalAccounts\Beneficiaries\Requisites;
|
|
|
|
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
|
// <BELIEF_STATE "This DTO requires `DigestSignatureData` as a collection for security, utilizing `DataCollectionOf` for type safety.">
|
|
use Apoloz\AlfaBank\Data\NominalAccounts\Payouts\DigestSignatureData;
|
|
use Apoloz\AlfaBank\Traits\SignableData;
|
|
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
|
use Spatie\LaravelData\Data;
|
|
use Spatie\LaravelData\DataCollection;
|
|
|
|
// </SECTION>
|
|
|
|
// <SECTION name="class_definition" intent="Define a DTO for creating a new requisite.">
|
|
// <BELIEF_STATE "This DTO ensures the request payload for creating a requisite is strictly typed and complete, preventing malformed requests for a critical financial operation.">
|
|
class CreateRequisiteRequestData extends Data
|
|
{
|
|
use SignableData;
|
|
|
|
// <SECTION name="constructor_properties" intent="Define all properties for the requisite creation request.">
|
|
// <BELIEF_STATE "The constructor includes mandatory fields like `type` and `digestSignatures`. Optional fields cover various payment methods (`pan`, `phoneNumber`, `accountNumber`) and identifiers (`bankId`, `bik`, `name`, `inn`, `kpp`, `beneficiaryId`, `isMain`).">
|
|
public function __construct(
|
|
public string $type,
|
|
#[DataCollectionOf(DigestSignatureData::class)]
|
|
public ?DataCollection $digestSignatures = null,
|
|
public ?string $beneficiaryId = null,
|
|
public ?string $pan = null,
|
|
public ?string $phoneNumber = null,
|
|
public ?string $bankId = null,
|
|
public ?string $accountNumber = null,
|
|
public ?string $bik = null,
|
|
public ?string $name = null,
|
|
public ?string $inn = null,
|
|
public ?string $kpp = null,
|
|
public ?bool $isMain = null,
|
|
) {}
|
|
// </SECTION>
|
|
}
|