{
"event": "PreToolUse",
"tool_name": "Write",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Domain\/DTO\/ContentVersionDTO.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Domain\\DTO;\n\n\/\/ @responsibility: DTO für Content-Version-Daten aus Repository\n\nfinal readonly class ContentVersionDTO\n{\n public function __construct(\n public int $id,\n public int $orderId,\n public int $versionNumber,\n public string $content,\n public string $model,\n public int $tokensInput,\n public int $tokensOutput,\n public float $costUsd,\n public int $durationMs,\n public \\DateTimeImmutable $createdAt,\n public ?string $title = null,\n ) {}\n\n \/**\n * Create from database row.\n *\n * @param array<string, mixed> $row\n *\/\n public static function fromDatabaseRow(array $row): self\n {\n return new self(\n id: (int) $row['id'],\n orderId: (int) $row['order_id'],\n versionNumber: (int) $row['version_number'],\n content: (string) $row['content'],\n model: (string) ($row['model'] ?? 'unknown'),\n tokensInput: (int) ($row['tokens_input'] ?? 0),\n tokensOutput: (int) ($row['tokens_output'] ?? 0),\n costUsd: (float) ($row['cost_usd'] ?? 0.0),\n durationMs: (int) ($row['duration_ms'] ?? 0),\n createdAt: new \\DateTimeImmutable($row['created_at'] ?? 'now'),\n title: $row['title'] ?? null,\n );\n }\n\n \/**\n * Get total tokens used.\n *\/\n public function totalTokens(): int\n {\n return $this->tokensInput + $this->tokensOutput;\n }\n\n \/**\n * Get content preview (first N characters).\n *\/\n public function preview(int $length = 200): string\n {\n if (mb_strlen($this->content) <= $length) {\n return $this->content;\n }\n\n return mb_substr($this->content, 0, $length) . '...';\n }\n}\n"
}
}
{
"tool_response": {
"type": "create",
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/Domain\/DTO\/ContentVersionDTO.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Domain\\DTO;\n\n\/\/ @responsibility: DTO für Content-Version-Daten aus Repository\n\nfinal readonly class ContentVersionDTO\n{\n public function __construct(\n public int $id,\n public int $orderId,\n public int $versionNumber,\n public string $content,\n public string $model,\n public int $tokensInput,\n public int $tokensOutput,\n public float $costUsd,\n public int $durationMs,\n public \\DateTimeImmutable $createdAt,\n public ?string $title = null,\n ) {}\n\n \/**\n * Create from database row.\n *\n * @param array<string, mixed> $row\n *\/\n public static function fromDatabaseRow(array $row): self\n {\n return new self(\n id: (int) $row['id'],\n orderId: (int) $row['order_id'],\n versionNumber: (int) $row['version_number'],\n content: (string) $row['content'],\n model: (string) ($row['model'] ?? 'unknown'),\n tokensInput: (int) ($row['tokens_input'] ?? 0),\n tokensOutput: (int) ($row['tokens_output'] ?? 0),\n costUsd: (float) ($row['cost_usd'] ?? 0.0),\n durationMs: (int) ($row['duration_ms'] ?? 0),\n createdAt: new \\DateTimeImmutable($row['created_at'] ?? 'now'),\n title: $row['title'] ?? null,\n );\n }\n\n \/**\n * Get total tokens used.\n *\/\n public function totalTokens(): int\n {\n return $this->tokensInput + $this->tokensOutput;\n }\n\n \/**\n * Get content preview (first N characters).\n *\/\n public function preview(int $length = 200): string\n {\n if (mb_strlen($this->content) <= $length) {\n return $this->content;\n }\n\n return mb_substr($this->content, 0, $length) . '...';\n }\n}\n",
"structuredPatch": [],
"originalFile": null
}
}