Files
alfa-bank-sdk/src/Data/NominalAccounts/Payouts/PayoffListItemData.php
Anatoliy Poloz 3437cba042 payoff list
2026-06-16 22:25:04 +03:00

59 lines
2.7 KiB
PHP

<?php
declare(strict_types=1);
/*
// MODULE_CONTRACT: Defines the data structure for a single payoff item in the list response from GET /payoffs.
// RESPONSIBILITY: To hold and type-safely represent comprehensive information about a single payoff from the list endpoint.
// INPUTS: Raw JSON object from the API response.
// OUTPUTS: A structured object containing payoff details.
// LINKS: PayOffsListResponseData.php, Requests/NominalAccounts/Payouts/GetPayoffsRequest.php
*/
namespace Apoloz\AlfaBank\Data\NominalAccounts\Payouts;
use Spatie\LaravelData\Data;
/**
* DTO for a single payoff item in the GET /payoffs list response.
*
* Based on OpenAPI PayoffItemResponse schema.
* Поля payer и recipient — array (raw JSON) вместо typed DTO, потому что
* существующие PayerInfoData/RecipientInfoData имеют другую структуру полей
* (accountNumber вместо bankAccount, нет bankName/bankBik/beneficiaryId в нужных местах)
* и их модификация может сломать DetailedPayoffData.
*
* @property-read string $id Идентификатор платежа (UUID)
* @property-read string|null $dealId Идентификатор сделки (UUID)
* @property-read string|null $stepId Идентификатор этапа сделки (UUID)
* @property-read string $payoffType Тип платежа
* @property-read string $type Тип платежа (PayoffType)
* @property-read string $channel Направление: INTERNAL|EXTERNAL
* @property-read string $requisiteType Тип реквизитов
* @property-read int $amount Сумма в рублях
* @property-read string|null $purpose Назначение платежа
* @property-read array|null $payer Плательщик (raw JSON)
* @property-read array|null $recipient Получатель (raw JSON)
* @property-read string $status Статус
* @property-read string|null $createdAt Дата создания (YYYY-MM-DD)
* @property-read string|null $updatedAt Дата обновления (YYYY-MM-DD)
*/
class PayoffListItemData extends Data
{
public function __construct(
public string $id,
public ?string $dealId = null,
public ?string $stepId = null,
public string $payoffType = 'REGULAR',
public string $type = 'REGULAR',
public string $channel = 'EXTERNAL',
public string $requisiteType = 'ACCOUNT',
public int $amount = 0,
public ?string $purpose = null,
public ?array $payer = null,
public ?array $recipient = null,
public string $status = 'NEW',
public ?string $createdAt = null,
public ?string $updatedAt = null,
) {}
}