forked from apoloz/alfa-bank-sdk
refactor(core): enhance SDK structure and documentation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -1,14 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
// 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;
|
||||
|
||||
use Apoloz\AlfaBank\Data\PaginationData;
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
// <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.
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf; // This is also likely extraneous for a single DTO.
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
use Spatie\LaravelData\DataCollection; // 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,
|
||||
@@ -17,4 +31,5 @@ class ClientConsentData extends Data
|
||||
public string $expireDate,
|
||||
public ?string $organizationIdHash = null,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user