forked from apoloz/alfa-bank-sdk
39 lines
1.9 KiB
PHP
39 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/*
|
|
// MODULE_CONTRACT: Defines the data structure for a single client consent record.
|
|
// RESPONSIBILITY: To hold and type-safely represent the details of a user's consent given to a client application.
|
|
// INPUTS: Raw JSON object from the API response.
|
|
// OUTPUTS: A structured object containing client consent information.
|
|
// LINKS: ClientConsentCollectionData.php
|
|
*/
|
|
|
|
namespace Apoloz\AlfaBank\Data\Auth\UserInfo;
|
|
|
|
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
|
// <BELIEF_STATE "This DTO represents a single consent entry. The `PaginationData` import here is likely due to prior usage or template, but not directly used within this single DTO.">
|
|
use Apoloz\AlfaBank\Data\PaginationData; // This import is likely extraneous for a single DTO, but kept for context consistency.
|
|
// This is also likely extraneous for a single DTO.
|
|
use Spatie\LaravelData\Data;
|
|
|
|
// This is also likely extraneous for a single DTO.
|
|
// </SECTION>
|
|
|
|
// <SECTION name="class_definition" intent="Define a DTO for a single client consent.">
|
|
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for an individual consent record, which is crucial for managing access permissions within an OAuth/OIDC system.">
|
|
class ClientConsentData extends Data
|
|
{
|
|
// <SECTION name="constructor_properties" intent="Define the properties of a client consent record.">
|
|
// <BELIEF_STATE "The constructor includes key information such as `createDateTime`, `sub` (subject ID), `clientId`, `isActive` status, and `expireDate`. The `organizationIdHash` provides additional context. These fields define the scope and validity of the consent.">
|
|
public function __construct(
|
|
public string $createDateTime,
|
|
public string $sub,
|
|
public string $clientId,
|
|
public bool $isActive,
|
|
public string $expireDate,
|
|
public ?string $organizationIdHash = null,
|
|
) {}
|
|
// </SECTION>
|
|
}
|