{
"event": "PreToolUse",
"tool_name": "Write",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Command\/GenerateContentCommand.php",
"content": "<?php\n\nnamespace UseCases\\Command;\n\n\/**\n * Command for generating content for an existing order.\n *\/\nfinal class GenerateContentCommand\n{\n public function __construct(\n public readonly int $orderId,\n public readonly string $model,\n public readonly string $collection,\n public readonly int $contextLimit,\n ) {\n }\n\n \/**\n * @param array<string, mixed> $data\n *\/\n public static function fromRequest(int $orderId, array $data): self\n {\n return new self(\n orderId: $orderId,\n model: (string) ($data['model'] ?? 'claude-opus-4-5-20251101'),\n collection: (string) ($data['collection'] ?? 'documents'),\n contextLimit: (int) ($data['context_limit'] ?? 5),\n );\n }\n\n \/**\n * @return array<string>\n *\/\n public function validate(): array\n {\n $errors = [];\n\n if ($this->orderId < 1) {\n $errors[] = 'Ungültige Order-ID.';\n }\n\n if ($this->model === '') {\n $errors[] = 'Modell ist erforderlich.';\n }\n\n if ($this->collection === '') {\n $errors[] = 'Collection ist erforderlich.';\n }\n\n if ($this->contextLimit < 1 || $this->contextLimit > 20) {\n $errors[] = 'Context-Limit muss zwischen 1 und 20 liegen.';\n }\n\n return $errors;\n }\n\n public function isValid(): bool\n {\n return $this->validate() === [];\n }\n}\n"
}
}
{
"tool_response": {
"type": "create",
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/UseCases\/Command\/GenerateContentCommand.php",
"content": "<?php\n\nnamespace UseCases\\Command;\n\n\/**\n * Command for generating content for an existing order.\n *\/\nfinal class GenerateContentCommand\n{\n public function __construct(\n public readonly int $orderId,\n public readonly string $model,\n public readonly string $collection,\n public readonly int $contextLimit,\n ) {\n }\n\n \/**\n * @param array<string, mixed> $data\n *\/\n public static function fromRequest(int $orderId, array $data): self\n {\n return new self(\n orderId: $orderId,\n model: (string) ($data['model'] ?? 'claude-opus-4-5-20251101'),\n collection: (string) ($data['collection'] ?? 'documents'),\n contextLimit: (int) ($data['context_limit'] ?? 5),\n );\n }\n\n \/**\n * @return array<string>\n *\/\n public function validate(): array\n {\n $errors = [];\n\n if ($this->orderId < 1) {\n $errors[] = 'Ungültige Order-ID.';\n }\n\n if ($this->model === '') {\n $errors[] = 'Modell ist erforderlich.';\n }\n\n if ($this->collection === '') {\n $errors[] = 'Collection ist erforderlich.';\n }\n\n if ($this->contextLimit < 1 || $this->contextLimit > 20) {\n $errors[] = 'Context-Limit muss zwischen 1 und 20 liegen.';\n }\n\n return $errors;\n }\n\n public function isValid(): bool\n {\n return $this->validate() === [];\n }\n}\n",
"structuredPatch": [],
"originalFile": null
}
}