import { ChannelType } from "../Common/Channels/ChannelType"; import { ITicketAuditedEntity, ITicketProperty, TicketPriority } from "./Common"; import { ITicketMessageReference } from "./Conversation"; export declare enum TicketPortalAuthenticationMode { PUBLIC = "PUBLIC", OPTIONAL = "OPTIONAL", REQUIRED = "REQUIRED" } export declare enum TicketRequestDraftStatus { DRAFT = "DRAFT", VALIDATING = "VALIDATING", READY = "READY", SUBMITTED = "SUBMITTED", EXPIRED = "EXPIRED", CANCELLED = "CANCELLED" } export declare enum TicketCustomerAction { COMMENT = "COMMENT", ADD_ATTACHMENT = "ADD_ATTACHMENT", CANCEL = "CANCEL", REOPEN = "REOPEN", COMPLETE_FORM = "COMPLETE_FORM", APPROVE = "APPROVE" } export declare enum TicketAudienceRuleEffect { ALLOW = "ALLOW", DENY = "DENY" } export declare enum TicketNotificationEvent { CREATED = "CREATED", PUBLIC_REPLY = "PUBLIC_REPLY", PUBLIC_STATUS_CHANGED = "PUBLIC_STATUS_CHANGED", ACTION_REQUIRED = "ACTION_REQUIRED", RESOLVED = "RESOLVED", REOPENED = "REOPENED", SATISFACTION_REQUESTED = "SATISFACTION_REQUESTED" } export declare enum TicketDeflectionOutcome { SUGGESTION_SHOWN = "SUGGESTION_SHOWN", ARTICLE_OPENED = "ARTICLE_OPENED", KNOWN_ISSUE_OPENED = "KNOWN_ISSUE_OPENED", ABANDONED = "ABANDONED", TICKET_CREATED = "TICKET_CREATED" } export declare enum TicketKnowledgeReferenceType { ARTICLE = "ARTICLE", COLLECTION = "COLLECTION", FOLDER = "FOLDER" } export interface ITicketPortal extends ITicketAuditedEntity { name: string; slug: string; title: string; description?: string; logoUrl?: string; faviconUrl?: string; primaryColor?: string; defaultLocale: string; supportedLocales?: string[]; authenticationMode: TicketPortalAuthenticationMode; allowTicketCreation: boolean; allowTicketTracking: boolean; allowComments: boolean; allowReopen: boolean; allowCancellation: boolean; termsDocumentId?: string; privacyDocumentId?: string; enabled: boolean; } export interface ITicketRequestType extends ITicketAuditedEntity { name: string; description?: string; categoryId: string; icon?: string; formId: string; formVersion?: number; workflowId?: string; defaultPriority?: TicketPriority; defaultAssignedGroupId?: string; slaPolicyId?: string; publicStatusSchemeId?: string; fieldDefinitionIds?: string[]; layoutIds?: string[]; audiencePolicyId?: string; enabled: boolean; } export interface IServiceCatalog extends ITicketAuditedEntity { portalId: string; name: string; description?: string; order?: number; enabled: boolean; } export interface IServiceCatalogSection extends ITicketAuditedEntity { catalogId: string; parentSectionId?: string; name: string; description?: string; icon?: string; order: number; enabled: boolean; } export interface IServiceCatalogItem extends ITicketAuditedEntity { catalogId: string; sectionId?: string; requestTypeId: string; name: string; shortDescription?: string; imageUrl?: string; order: number; estimatedDeliveryMinutes?: number; audiencePolicyId?: string; enabled: boolean; } export interface ITicketAudienceRule { id: string; effect: TicketAudienceRuleEffect; authenticatedOnly?: boolean; organizationIds?: string[]; contactSegmentIds?: string[]; contactIds?: string[]; roleIds?: string[]; countries?: string[]; } export interface ITicketAudiencePolicy extends ITicketAuditedEntity { name: string; description?: string; defaultEffect: TicketAudienceRuleEffect; rules: ITicketAudienceRule[]; enabled: boolean; } export interface ITicketRequestDraft { id: string; spaceId: string; portalId: string; requestTypeId: string; contactId?: string; formId: string; formVersion?: number; formSubmissionId?: string; status: TicketRequestDraftStatus; createdAt: Date; updatedAt?: Date; expiresAt: Date; submittedTicketId?: string; } export interface ITicketPublicStatus extends ITicketAuditedEntity { name: string; description?: string; color?: string; icon?: string; order: number; } export interface ITicketPublicStatusMapping extends ITicketAuditedEntity { schemeId: string; publicStatusId: string; internalStatusIds: string[]; } export interface ITicketPublicStatusScheme extends ITicketAuditedEntity { name: string; description?: string; defaultPublicStatusId?: string; enabled: boolean; } /** Safe customer projection; internal activity, notes, routing and SLA details are intentionally excluded. */ export interface ICustomerTicketView { id: string; number: number; title: string; description?: string; requestTypeId?: string; categoryId: string; publicStatus: ITicketPublicStatus; priority?: TicketPriority; publicProperties?: ITicketProperty[]; createdAt: Date; updatedAt?: Date; resolvedAt?: Date; messages?: ITicketMessageReference[]; availableActions: TicketCustomerAction[]; } /** Reference only. Article content and lifecycle remain authoritative in Docs/Knowledge. */ export interface ITicketKnowledgeReference extends ITicketAuditedEntity { referenceType: TicketKnowledgeReferenceType; documentId: string; portalIds?: string[]; requestTypeIds?: string[]; categoryIds?: string[]; locales?: string[]; audiencePolicyId?: string; order?: number; enabled: boolean; } /** Rules may work globally at portal level and become more specific by request type/category. */ export interface ITicketDeflectionRule extends ITicketAuditedEntity { name: string; portalId: string; requestTypeIds?: string[]; categoryIds?: string[]; knowledgeReferenceIds?: string[]; includeKnownIssues?: boolean; minimumScore?: number; maximumSuggestions?: number; audiencePolicyId?: string; enabled: boolean; } export interface ITicketDeflectionSuggestion { knowledgeReferenceId?: string; knownIssueTicketId?: string; score?: number; position: number; } export interface ITicketDeflectionEvent { id: string; spaceId: string; portalId: string; sessionId: string; contactId?: string; requestTypeId?: string; categoryId?: string; query: string; suggestions: ITicketDeflectionSuggestion[]; selectedKnowledgeReferenceId?: string; selectedKnownIssueTicketId?: string; outcome: TicketDeflectionOutcome; createdTicketId?: string; occurredAt: Date; } export interface ITicketCustomerNotificationPreference { id: string; spaceId: string; contactId: string; portalId?: string; locale?: string; channelTypes: ChannelType[]; enabledEvents: TicketNotificationEvent[]; mutedTicketIds?: string[]; updatedAt: Date; } export interface ICreateTicketRequestDraftDto { portalId: string; requestTypeId: string; contactId?: string; } export interface ISubmitTicketRequestDto { draftId: string; formSubmissionId: string; idempotencyKey: string; } export interface ICustomerTicketActionDto { action: TicketCustomerAction; comment?: string; attachmentIds?: string[]; formSubmissionId?: string; }