feat: add knowledge version history (closes #75, closes #76)

- Added EntryVersion model with author relation
- Implemented automatic versioning on entry create/update
- Added API endpoints for version history:
  - GET /api/knowledge/entries/:slug/versions - list versions
  - GET /api/knowledge/entries/:slug/versions/:version - get specific
  - POST /api/knowledge/entries/:slug/restore/:version - restore version
- Created VersionHistory.tsx component with timeline view
- Added History tab to entry detail page
- Supports version viewing and restoring
- Includes comprehensive tests for version operations
- All TypeScript types are explicit and type-safe
This commit is contained in:
Jason Woltje
2026-01-29 23:27:03 -06:00
parent 59aec28d5c
commit 7465d0a3c2
14 changed files with 2450 additions and 24 deletions

View File

@@ -185,6 +185,32 @@ export interface KnowledgeEntryWithTags extends KnowledgeEntry {
tags: KnowledgeTag[];
}
/**
* Knowledge entry version entity
*/
export interface KnowledgeEntryVersion {
readonly id: string;
entryId: string;
version: number;
title: string;
content: string;
summary: string | null;
readonly createdAt: Date;
createdBy: string;
changeNote: string | null;
}
/**
* Knowledge entry version with author information
*/
export interface KnowledgeEntryVersionWithAuthor extends KnowledgeEntryVersion {
author: {
id: string;
name: string;
email: string;
};
}
/**
* Domain entity
*/