// Proposed production domain contracts. These are not implemented server models. export type ID = string; export type Product = 'os' | 'analytics' | 'mentor' | 'launch' | 'academy'; export interface RecordBase { id: ID; workspaceId: ID; createdAt: string; updatedAt: string; revision: number } export interface User { id: ID; email: string; name: string; status: 'invited' | 'active' | 'suspended' } export interface Membership { userId: ID; workspaceId: ID; role: 'owner' | 'admin' | 'manager' | 'member' | 'viewer' } export interface DemoEntitlement { userId: ID; product: Product; expiresAt: string; status: 'active' | 'revoked'; grantedBy: ID } export interface Customer extends RecordBase { name: string; contactName: string; email: string; industry: string; ownerId: ID } export interface Opportunity extends RecordBase { customerId: ID; title: string; valueMinor: number; currency: string; ownerId: ID; stage: 'discovery' | 'qualified' | 'proposal' | 'won' | 'lost' } export interface Project extends RecordBase { customerId?: ID; title: string; ownerId: ID; dueDate: string; status: 'planning' | 'active' | 'completed' | 'archived' } export interface Task extends RecordBase { projectId: ID; title: string; assigneeId: ID; status: 'todo' | 'doing' | 'done'; priority: 'low' | 'medium' | 'high' } export interface InvoiceDraft extends RecordBase { customerId: ID; currency: string; lines: Array<{ description: string; quantity: number; unitAmountMinor: number }>; dueDate: string; status: 'draft' | 'issued' | 'paid' | 'void' } export interface DataSource extends RecordBase { kind: 'file' | 'database' | 'connector'; name: string; status: 'pending' | 'ready' | 'failed'; lastRefreshedAt?: string } export interface Dataset extends RecordBase { sourceId: ID; name: string; schema: Array<{ name: string; type: string; nullable: boolean }>; rowCount: number; qualitySummary: string } export interface AnalysisQuery extends RecordBase { datasetId: ID; question: string; filters: Record; status: 'queued' | 'running' | 'complete' | 'failed'; result?: { rows: unknown[]; narrative: string; sources: string[]; queryText?: string } } export interface Dashboard extends RecordBase { name: string; widgets: Array<{ type: string; queryId: ID; position: number }> } export interface CareerGoal extends RecordBase { userId: ID; targetRole: string; hoursPerWeek: number; objective: string } export interface RoadmapItem extends RecordBase { goalId: ID; title: string; order: number; status: 'planned' | 'complete' } export interface PracticeSession extends RecordBase { userId: ID; goalId: ID; question: string; answer: string; reflection?: string; rubricVersion: string; feedbackSource: 'self' | 'model' | 'mentor' } export interface PortfolioProject extends RecordBase { userId: ID; name: string; technologies: string[]; evidenceUrl?: string; reflection: string; status: 'planned' | 'active' | 'complete' } export interface Startup extends RecordBase { name: string; audience: string; stage: 'idea' | 'prototype' | 'early-users' } export interface CanvasEntry extends RecordBase { startupId: ID; category: string; hypothesis: string; evidenceIds: ID[] } export interface Experiment extends RecordBase { startupId: ID; title: string; hypothesis: string; method: string; successSignal: string; evidence: string; status: 'planned' | 'running' | 'complete' } export interface Course extends RecordBase { title: string; description: string; level: string; publishedVersion: string; moduleIds: ID[] } export interface Enrollment extends RecordBase { userId: ID; courseId: ID; version: string; completedLessonIds: ID[]; enrolledAt: string } export interface AssessmentAttempt extends RecordBase { userId: ID; courseId: ID; assessmentVersion: string; answers: Record; score: number; maxScore: number } export interface Cohort extends RecordBase { name: string; managerIds: ID[]; learnerIds: ID[]; assignedCourseIds: ID[] } export interface AuditEvent { id: ID; workspaceId: ID; actorId: ID; action: string; targetType: string; targetId?: ID; outcome: string; timestamp: string; requestId: string } export interface AnalyticsEvent { eventId: ID; anonymousSessionId: string; eventName: string; path: string; product?: Product; timestamp: string; consentState: string }