feat: add domains, ideas, layouts, widgets API modules

- Add DomainsModule with full CRUD, search, and activity logging
- Add IdeasModule with quick capture endpoint
- Add LayoutsModule for user dashboard layouts
- Add WidgetsModule for widget definitions (read-only)
- Update ActivityService with domain/idea logging methods
- Register all new modules in AppModule
This commit is contained in:
Jason Woltje
2026-01-29 13:47:03 -06:00
parent 973502f26e
commit f47dd8bc92
66 changed files with 4277 additions and 29 deletions

View File

@@ -128,3 +128,6 @@ export * from "./database.types";
// Export authentication types
export * from "./auth.types";
// Export widget types
export * from "./widget.types";

View File

@@ -0,0 +1,81 @@
/**
* Widget and layout type definitions for HUD system
*/
import type { BaseEntity } from "./index";
/**
* Widget placement in the grid
*/
export interface WidgetPlacement {
i: string; // Widget ID
x: number; // Column position
y: number; // Row position
w: number; // Width in grid units
h: number; // Height in grid units
minW?: number;
maxW?: number;
minH?: number;
maxH?: number;
static?: boolean;
isDraggable?: boolean;
isResizable?: boolean;
}
/**
* Widget definition from database
*/
export interface WidgetDefinition extends BaseEntity {
name: string;
displayName: string;
description: string | null;
component: string;
defaultWidth: number;
defaultHeight: number;
minWidth: number;
minHeight: number;
maxWidth: number | null;
maxHeight: number | null;
configSchema: Record<string, unknown>;
isActive: boolean;
}
/**
* User layout configuration
*/
export interface UserLayout extends BaseEntity {
workspaceId: string;
userId: string;
name: string;
isDefault: boolean;
layout: WidgetPlacement[];
metadata: Record<string, unknown>;
}
/**
* Layout configuration for editor
*/
export interface LayoutConfig {
id: string;
name: string;
layout: WidgetPlacement[];
}
/**
* Available widget types (component names)
*/
export type WidgetComponentType =
| "TasksWidget"
| "CalendarWidget"
| "QuickCaptureWidget"
| "AgentStatusWidget";
/**
* Props for individual widgets
*/
export interface WidgetProps {
id: string;
config?: Record<string, unknown>;
onEdit?: () => void;
onRemove?: () => void;
}