- 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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user