<?php

namespace App\Classes\Modules\KeyValuePairs\DataTransferObjects;


use App\Classes\General\Interfaces\DataTransferObject;

class UpdateChatGPTPromptDTO implements DataTransferObject
{
    public int $id;
    public string $title;
    public string $prompt;

    public function __construct(array $data)
    {
        $this->id = (int) ($data['id'] ?? 0);
        $this->title = (string) ($data['key'] ?? '');
        $this->prompt = (string) ($data['value'] ?? '');
    }

    public function toArray(): array
    {
        return [
            'id' => $this->id,
            'title' => $this->title,
            'prompt' => $this->prompt,
        ];
    }

    public function getId(): int
    {
        return $this->id;
    }

    public function getTitle(): string
    {
        return $this->title;
    }

    public function getPrompt(): string
    {
        return $this->prompt;
    }
}
