All files / src/constants support.ts

100% Statements 300/300
100% Branches 0/0
100% Functions 0/0
100% Lines 300/300

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 3011x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * Customer Support System Constants
 */
 
import {
  TicketStatus,
  TicketPriority,
  TicketCategory,
  MessageSenderType} from '@/types/support';
 
// Status display configuration
export const TICKET_STATUS_CONFIG: Record<
  TicketStatus,
  { label: string; color: string; bgColor: string; description: string }
> = {
  [TicketStatus.OPEN]: {
    label: 'Open',
    color: 'text-blue-700',
    bgColor: 'bg-blue-100',
    description: 'Ticket is awaiting initial response'},
  [TicketStatus.IN_PROGRESS]: {
    label: 'In Progress',
    color: 'text-yellow-700',
    bgColor: 'bg-yellow-100',
    description: 'Agent is actively working on this ticket'},
  [TicketStatus.AWAITING_CUSTOMER]: {
    label: 'Awaiting Customer',
    color: 'text-orange-700',
    bgColor: 'bg-orange-100',
    description: 'Waiting for customer response'},
  [TicketStatus.AWAITING_AGENT]: {
    label: 'Awaiting Agent',
    color: 'text-purple-700',
    bgColor: 'bg-purple-100',
    description: 'Waiting for agent response'},
  [TicketStatus.RESOLVED]: {
    label: 'Resolved',
    color: 'text-green-700',
    bgColor: 'bg-green-100',
    description: 'Issue has been resolved'},
  [TicketStatus.CLOSED]: {
    label: 'Closed',
    color: 'text-gray-700',
    bgColor: 'bg-gray-100',
    description: 'Ticket is closed'},
  [TicketStatus.CANCELLED]: {
    label: 'Cancelled',
    color: 'text-red-700',
    bgColor: 'bg-red-100',
    description: 'Ticket was cancelled'}};
 
// Priority display configuration
export const TICKET_PRIORITY_CONFIG: Record<
  TicketPriority,
  { label: string; color: string; bgColor: string; icon: string; order: number }
> = {
  [TicketPriority.LOW]: {
    label: 'Low',
    color: 'text-gray-600',
    bgColor: 'bg-gray-100',
    icon: 'arrow-down',
    order: 1},
  [TicketPriority.MEDIUM]: {
    label: 'Medium',
    color: 'text-blue-600',
    bgColor: 'bg-blue-100',
    icon: 'minus',
    order: 2},
  [TicketPriority.HIGH]: {
    label: 'High',
    color: 'text-orange-600',
    bgColor: 'bg-orange-100',
    icon: 'arrow-up',
    order: 3},
  [TicketPriority.URGENT]: {
    label: 'Urgent',
    color: 'text-red-600',
    bgColor: 'bg-red-100',
    icon: 'alert-triangle',
    order: 4}};
 
// Category display configuration
export const TICKET_CATEGORY_CONFIG: Record<
  TicketCategory,
  { label: string; icon: string; description: string }
> = {
  [TicketCategory.ORDER_ISSUE]: {
    label: 'Order Issue',
    icon: 'package',
    description: 'Problems with your order'},
  [TicketCategory.PRODUCT_INQUIRY]: {
    label: 'Product Inquiry',
    icon: 'help-circle',
    description: 'Questions about products'},
  [TicketCategory.SHIPPING]: {
    label: 'Shipping',
    icon: 'truck',
    description: 'Shipping and delivery questions'},
  [TicketCategory.RETURNS_REFUNDS]: {
    label: 'Returns & Refunds',
    icon: 'refresh-cw',
    description: 'Return or refund requests'},
  [TicketCategory.PAYMENT]: {
    label: 'Payment',
    icon: 'credit-card',
    description: 'Payment and billing issues'},
  [TicketCategory.ACCOUNT]: {
    label: 'Account',
    icon: 'user',
    description: 'Account-related issues'},
  [TicketCategory.TECHNICAL]: {
    label: 'Technical',
    icon: 'settings',
    description: 'Technical problems'},
  [TicketCategory.FEEDBACK]: {
    label: 'Feedback',
    icon: 'message-square',
    description: 'General feedback or suggestions'},
  [TicketCategory.OTHER]: {
    label: 'Other',
    icon: 'more-horizontal',
    description: 'Other inquiries'}};
 
// Sender type display configuration
export const MESSAGE_SENDER_CONFIG: Record<
  MessageSenderType,
  { label: string; color: string; bgColor: string }
> = {
  [MessageSenderType.CUSTOMER]: {
    label: 'Customer',
    color: 'text-blue-700',
    bgColor: 'bg-blue-50'},
  [MessageSenderType.AGENT]: {
    label: 'Support Agent',
    color: 'text-green-700',
    bgColor: 'bg-green-50'},
  [MessageSenderType.SYSTEM]: {
    label: 'System',
    color: 'text-gray-700',
    bgColor: 'bg-gray-50'},
  [MessageSenderType.BOT]: {
    label: 'Assistant',
    color: 'text-purple-700',
    bgColor: 'bg-purple-50'}};
 
// Ticket number prefix
export const TICKET_NUMBER_PREFIX = 'TKT';
 
// SLA (Service Level Agreement) targets in hours
export const SLA_TARGETS = {
  [TicketPriority.URGENT]: {
    firstResponse: 1, // 1 hour
    resolution: 4, // 4 hours
  },
  [TicketPriority.HIGH]: {
    firstResponse: 4, // 4 hours
    resolution: 24, // 24 hours
  },
  [TicketPriority.MEDIUM]: {
    firstResponse: 8, // 8 hours
    resolution: 48, // 48 hours
  },
  [TicketPriority.LOW]: {
    firstResponse: 24, // 24 hours
    resolution: 72, // 72 hours
  }};
 
// Auto-close settings
export const AUTO_CLOSE = {
  // Auto-close resolved tickets after X days of inactivity
  resolvedAfterDays: 7,
  // Auto-close awaiting customer tickets after X days
  awaitingCustomerAfterDays: 14};
 
// Pagination defaults
export const SUPPORT_PAGINATION = {
  defaultPageSize: 20,
  maxPageSize: 100,
  messageBatchSize: 50};
 
// File upload constraints
export const FILE_UPLOAD = {
  maxSizeBytes: 10 * 1024 * 1024, // 10MB
  maxFilesPerTicket: 10,
  maxFilesPerMessage: 5,
  allowedTypes: [
    'image/jpeg',
    'image/png',
    'image/gif',
    'image/webp',
    'application/pdf',
    'text/plain',
    'application/msword',
    'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  ],
  allowedExtensions: ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.pdf', '.txt', '.doc', '.docx']};
 
// Chatbot settings
export const CHATBOT = {
  // Number of articles to suggest
  maxSuggestedArticles: 3,
  // Minimum keyword match score to suggest article (0-1)
  minMatchScore: 0.3,
  // Quick actions available in chatbot
  quickActions: [
    { id: 'track_order', label: 'Track Order', icon: 'package' },
    { id: 'view_faq', label: 'View FAQ', icon: 'book-open' },
    { id: 'create_ticket', label: 'Create Ticket', icon: 'ticket' },
    { id: 'contact_agent', label: 'Contact Agent', icon: 'headphones' },
  ],
  // Welcome message
  welcomeMessage:
    "Hello! I'm here to help. You can ask me a question, or choose one of the options below.",
  // Fallback message when no match found
  fallbackMessage:
    "I'm sorry, I couldn't find an answer to your question. Would you like to create a support ticket to speak with one of our agents?"};
 
// Default FAQ categories
export const FAQ_CATEGORIES = [
  { id: 'orders', label: 'Orders & Shipping', icon: 'package' },
  { id: 'returns', label: 'Returns & Refunds', icon: 'refresh-cw' },
  { id: 'payments', label: 'Payments & Billing', icon: 'credit-card' },
  { id: 'account', label: 'Account & Profile', icon: 'user' },
  { id: 'products', label: 'Products', icon: 'box' },
  { id: 'general', label: 'General', icon: 'info' },
];
 
// Default canned response categories
export const CANNED_RESPONSE_CATEGORIES = [
  'Greetings',
  'Acknowledgment',
  'Order Issues',
  'Shipping',
  'Returns & Refunds',
  'Payment',
  'Technical Support',
  'Closing',
  'Escalation',
];
 
// History action types
export const TICKET_HISTORY_ACTIONS = {
  CREATED: 'created',
  STATUS_CHANGED: 'status_changed',
  PRIORITY_CHANGED: 'priority_changed',
  ASSIGNED: 'assigned',
  UNASSIGNED: 'unassigned',
  CATEGORY_CHANGED: 'category_changed',
  MESSAGE_ADDED: 'message_added',
  ATTACHMENT_ADDED: 'attachment_added',
  TAGS_CHANGED: 'tags_changed',
  MERGED: 'merged',
  ESCALATED: 'escalated'} as const;
 
// Rating labels
export const RATING_LABELS: Record<number, string> = {
  1: 'Very Poor',
  2: 'Poor',
  3: 'Average',
  4: 'Good',
  5: 'Excellent'};
 
// Status transitions (what statuses can transition to what)
export const STATUS_TRANSITIONS: Record<TicketStatus, TicketStatus[]> = {
  [TicketStatus.OPEN]: [
    TicketStatus.IN_PROGRESS,
    TicketStatus.AWAITING_CUSTOMER,
    TicketStatus.RESOLVED,
    TicketStatus.CANCELLED,
  ],
  [TicketStatus.IN_PROGRESS]: [
    TicketStatus.AWAITING_CUSTOMER,
    TicketStatus.AWAITING_AGENT,
    TicketStatus.RESOLVED,
    TicketStatus.CANCELLED,
  ],
  [TicketStatus.AWAITING_CUSTOMER]: [
    TicketStatus.IN_PROGRESS,
    TicketStatus.AWAITING_AGENT,
    TicketStatus.RESOLVED,
    TicketStatus.CLOSED,
    TicketStatus.CANCELLED,
  ],
  [TicketStatus.AWAITING_AGENT]: [
    TicketStatus.IN_PROGRESS,
    TicketStatus.AWAITING_CUSTOMER,
    TicketStatus.RESOLVED,
    TicketStatus.CANCELLED,
  ],
  [TicketStatus.RESOLVED]: [TicketStatus.CLOSED, TicketStatus.IN_PROGRESS],
  [TicketStatus.CLOSED]: [TicketStatus.OPEN],
  [TicketStatus.CANCELLED]: []};
 
// Notification types for support events
export const SUPPORT_NOTIFICATION_TYPES = {
  TICKET_CREATED: 'support_ticket_created',
  TICKET_UPDATED: 'support_ticket_updated',
  TICKET_ASSIGNED: 'support_ticket_assigned',
  TICKET_RESOLVED: 'support_ticket_resolved',
  MESSAGE_RECEIVED: 'support_message_received'} as const;