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,15 +1,30 @@
|
||||
<?php
|
||||
/*
|
||||
// MODULE_CONTRACT: Defines the data structure for the response of a file upload request.
|
||||
// RESPONSIBILITY: To hold and type-safely represent the links necessary to perform a file upload.
|
||||
// INPUTS: Raw JSON object from the API response.
|
||||
// OUTPUTS: An object containing a collection of file upload links.
|
||||
// LINKS: Requests/FileExchange/UploadFileRequest.php
|
||||
*/
|
||||
|
||||
namespace Apoloz\AlfaBank\Data\FileExchange;
|
||||
|
||||
// <SECTION name="module_imports" intent="Import necessary DTOs and Spatie Laravel Data components.">
|
||||
// <BELIEF_STATE "This DTO represents a collection of `FileLinkData` objects, so `DataCollectionOf` is used for type safety.">
|
||||
use Spatie\LaravelData\Attributes\DataCollectionOf;
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\DataCollection;
|
||||
// </SECTION>
|
||||
|
||||
// <SECTION name="class_definition" intent="Define a DTO for file upload response data.">
|
||||
// <BELIEF_STATE "This DTO provides a clear, type-safe contract for handling file upload instructions, ensuring that the process of sending files is well-defined.">
|
||||
class UploadFileResponseData extends Data
|
||||
{
|
||||
// <SECTION name="constructor_properties" intent="Define the properties of the file upload response.">
|
||||
// <BELIEF_STATE "The response primarily contains an `uploadFileLinks` property, which is a collection of `FileLinkData` objects, each detailing how to upload a part of the file or its signature.">
|
||||
public function __construct(
|
||||
#[DataCollectionOf(FileLinkData::class)]
|
||||
public DataCollection $uploadFileLinks,
|
||||
) {}
|
||||
// </SECTION>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user