/** * Dashboard Domain - Contract * * Shared types for dashboard summaries, activity feeds, and related data. */ import type { IsoDateTimeString } from "../common/types"; import type { Invoice } from "../billing/contract"; export type ActivityType = | "invoice_created" | "invoice_paid" | "service_activated" | "case_created" | "case_closed"; export interface Activity { id: string; type: ActivityType; title: string; description?: string; date: IsoDateTimeString; relatedId?: number; metadata?: Record; } export interface DashboardStats { activeSubscriptions: number; unpaidInvoices: number; openCases: number; recentOrders?: number; totalSpent?: number; currency: string; } export interface NextInvoice { id: number; dueDate: IsoDateTimeString; amount: number; currency: string; } export interface DashboardSummary { stats: DashboardStats; nextInvoice: NextInvoice | null; recentActivity: Activity[]; } export interface DashboardError { code: string; message: string; details?: Record; } export type ActivityFilter = "all" | "billing" | "orders" | "support"; export interface ActivityFilterConfig { key: ActivityFilter; label: string; types?: ActivityType[]; } export interface DashboardSummaryResponse extends DashboardSummary { invoices?: Invoice[]; }