/** * Serializable view types for the support Svelte surfaces. * * Components take plain view objects (not model instances) so hosts can pass * data across the server/client boundary; `toSupportCaseView` / * `toCaseTimelineItemView` adapt the models. Explicit interfaces (not inline * intersections) keep Svelte 5 prop type evaluation cheap. */ import type { ServiceTimeEntry } from '../models/service-time-entry.js'; import type { SupportCase } from '../models/support-case.js'; import type { SupportServiceTarget } from '../models/support-service-target.js'; import type { SupportCharge } from '../models/support-settlement.js'; import type { CaseTimelineItem } from '../services/support-case-service.js'; export interface SupportCaseView { id: string; caseNumber: string; subject: string; status: string; priority: string; severity: string; channelKind: string; clientProfileId: string | null; projectId: string | null; assignedSpecialistId: string | null; assignedSpecialistName: string | null; reopenCount: number; createdAt: string | null; updatedAt: string | null; resolutionSummary: string; } export interface CaseTimelineItemView { kind: 'interaction' | 'event'; occurredAt: string; actorKind: string; summary: string; body: string; direction: string | null; channelKind: string | null; eventType: string | null; } export interface SupportWorkLinkView { id: string; linkKind: string; targetLabel: string; externalUrl: string; status: string; } /** * View shape for a Service Time Entry in approval/review surfaces. The first * eight fields deliberately match `smrt-projects`' presentation `TimeEntry` * contract (`packages/projects/src/svelte/utils.ts`) — smrt-support promotes * that presentation-only shape into persisted models, so hosts can reuse * either package's time surfaces over the same view rows. */ export interface SupportTimeEntryView { id: string; /** ISO date part (`YYYY-MM-DD`) of the work period start. */ date: string; /** Worked duration in decimal hours, rounded to 2 decimals. */ hours: number; description: string; status: string; /** * Client charge in integer minor units, when a derived * {@link SupportCharge} is supplied — `$19.99` is `1999` (#2401). */ amount?: number; /** * ISO 4217 code `amount` / `hourlyRate` are denominated in, when a charge is * supplied. Carried on the view because the minor-unit exponent is a property * of the currency, not a constant: `¥1999` is 1999 minor units, not 19.99 * (#2401). */ currency?: string; workerName?: string; /** * Hourly rate from the charge's frozen `rateSnapshot`, when supplied, in * minor units per hour (#2401). */ hourlyRate?: number; source: string; participantKind: string; caseId: string | null; } /** Adapt a SupportCase model to the queue/detail view shape. */ export declare function toSupportCaseView(supportCase: SupportCase, options?: { assignedSpecialistName?: string | null; }): SupportCaseView; /** Adapt one merged timeline item (interaction or event) to its view. */ export declare function toCaseTimelineItemView(item: CaseTimelineItem): CaseTimelineItemView; /** * Map a case status onto smrt-ui `StatusBadge`'s default color-scheme keys * (`active` | `inactive` | `pending` | `error` | `success` | `warning`); pass * the real status as the badge `label`. */ export declare function caseStatusBadgeKey(status: string): string; /** Map a case priority onto `StatusBadge` default color-scheme keys. */ export declare function priorityBadgeKey(priority: string): string; /** Human-readable label for a snake_case status value. */ export declare function humanizeStatus(value: string): string; /** Adapt a ServiceTimeEntry model (plus its optional charge) to the view. */ export declare function toSupportTimeEntryView(entry: ServiceTimeEntry, opts?: { charge?: SupportCharge | null; workerName?: string | null; }): SupportTimeEntryView; /** Map a time-entry status onto `StatusBadge` default color-scheme keys. */ export declare function timeEntryStatusBadgeKey(status: string): string; /** Serializable Service Target clock view for `TargetList` (#1929). */ export interface ServiceTargetView { id: string; targetType: string; cycle: number; status: string; severity: string; baseMinutes: number; startedAt: string | null; dueAt: string | null; satisfiedAt: string | null; breachedAt: string | null; /** Whether the clock is currently frozen by the plan's pause rules. */ paused: boolean; } /** Adapt a SupportServiceTarget model to the `TargetList` view shape. */ export declare function toServiceTargetView(target: SupportServiceTarget): ServiceTargetView; /** * Map a Service Target status onto smrt-ui `StatusBadge` default * color-scheme keys: running/paused clocks read as attention-colored, * satisfied as success, breached as error. */ export declare function targetStatusBadgeKey(status: string): string; /** * Serializable ranked-specialist view for `RoutingRationale` (#1929) — * mirrors the routing service's `RankedSpecialist` result shape. */ export interface RankedSpecialistView { specialistId: string; displayName: string; score: number; eligible: boolean; factors: Record; } //# sourceMappingURL=types.d.ts.map