import { IContactInfo } from "../Contacts/contacts"; export declare enum TicketStage { NEW = "NEW", ACTIVE = "ACTIVE", RESOLVED = "RESOLVED", CLOSED = "CLOSED", CANCELLED = "CANCELLED" } export declare enum TicketPriority { LOW = "LOW", MEDIUM = "MEDIUM", HIGH = "HIGH", URGENT = "URGENT" } export declare enum TicketOrigin { MANUAL = "MANUAL", API = "API", IMPORT = "IMPORT", AUTOMATION = "AUTOMATION", CONVERSATION = "CONVERSATION", WEB_FORM = "WEB_FORM", SOCIAL_MEDIA = "SOCIAL_MEDIA", EMAIL = "EMAIL", PHONE = "PHONE", OTHER = "OTHER" } export declare enum TicketAccessLevel { ALL = "ALL", GROUP = "GROUP", AGENT = "AGENT", OWN = "OWN" } export type TicketPropertyPrimitive = string | number | boolean | Date | null; export type TicketPropertyValue = TicketPropertyPrimitive | TicketPropertyValue[] | { [key: string]: TicketPropertyValue; }; export interface ITicketProperty { nameKey: string; value: TicketPropertyValue; } /** * Referencia liviana de una etiqueta tal como aparece embebida en un ticket * (solo lo necesario para pintarla). El catálogo administrable usa ITicketTag. */ export interface ITicketTagInfo { id: string; name: string; color?: string; } /** * Etiqueta administrable del catálogo. Shape propio (no extiende * ITicketAuditedEntity a propósito): solo expone lo necesario para administrar * el catálogo, sin `spaceId` ni autores (createdBy/updatedBy), que quedan * internos al backend. Las fechas son opcionales porque una etiqueta recién * creada aún no tiene `updatedAt`. La unicidad de nombre (con espacios * normalizados e insensible a mayúsculas/minúsculas) es responsabilidad del * backend, no del contrato. */ export interface ITicketTag { id: string; name: string; color?: string; description?: string; enabled: boolean; createdAt?: Date; updatedAt?: Date; } export interface ICreateTicketTagDto { name: string; color?: string; description?: string; } export interface IUpdateTicketTagDto { name?: string; color?: string | null; description?: string | null; } /** * Proyección de consulta: el catálogo con la cantidad de usos y la última * utilización. No se persiste en la entidad; el backend la calcula por join * sobre las asociaciones ticket↔etiqueta. */ export interface ITicketTagWithUsage extends ITicketTag { usageCount?: number; lastUsedAt?: Date; } /** * Dependencias de una etiqueta: dónde se usa. Sirve para mostrar el impacto * antes de desactivarla o eliminarla. */ export interface ITicketTagDependencies { tagId: string; tickets: number; views: number; automations: number; macros: number; } /** Reemplaza/fusiona una etiqueta por otra: reasigna los usos y desactiva la fuente. */ export interface IMergeTicketTagsDto { sourceTagId: string; targetTagId: string; } export interface IMergeTicketTagsResult { targetTagId: string; mergedSourceTagId: string; reassignedUsages: number; } export interface ITicketExternalReference { system: string; externalId: string; externalUrl?: string; lastSyncedAt?: Date; } export interface ITicketAttachment { id: string; spaceId: string; ticketId: string; fileName: string; mimeType: string; sizeBytes: number; storageKey: string; downloadUrl?: string; checksum?: string; createdAt: Date; createdBy: string; deletedAt?: Date; deletedBy?: string; } export interface ITicketAuditedEntity { id: string; spaceId: string; createdAt: Date; createdBy: string; updatedAt?: Date; updatedBy?: string; deletedAt?: Date; deletedBy?: string; } export type ITicketContactProjection = IContactInfo; export interface ITicketDateRange { from: Date; to: Date; } export interface ITicketMetricPoint { date: Date; value: number; } export interface ITicketMetricGroup { key: string; label: string; value: number; } /** The stored value of a FILE custom field. The blob lives under * tickets/{ticketId}/files/ and is written through media-api. */ export interface ITicketFileValue { url: string; storageKey: string; fileName: string; mimeType: string; sizeBytes: number; }