clarion-shared-types 1.0.90 → 1.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +27 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js +1 -0
- package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
- package/dist/cjs/modules/support/enums/support-enums.js +375 -0
- package/dist/cjs/modules/support/enums/support-enums.js.map +1 -0
- package/dist/cjs/modules/support/index.js +27 -0
- package/dist/cjs/modules/support/index.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/customer-feedback.dto.js +3 -0
- package/dist/cjs/modules/support/interfaces/customer-feedback.dto.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-configuration.dto.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-configuration.dto.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-reports.dto.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-reports.dto.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-sync.dto.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-sync.dto.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-ticket.dto.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-ticket.dto.js.map +1 -0
- package/dist/cjs/modules/support/utils/support-display.util.js +364 -0
- package/dist/cjs/modules/support/utils/support-display.util.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +27 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-moudule.enum.js +1 -0
- package/dist/esm/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
- package/dist/esm/modules/support/enums/support-enums.js +372 -0
- package/dist/esm/modules/support/enums/support-enums.js.map +1 -0
- package/dist/esm/modules/support/index.js +11 -0
- package/dist/esm/modules/support/index.js.map +1 -0
- package/dist/esm/modules/support/interfaces/customer-feedback.dto.js +2 -0
- package/dist/esm/modules/support/interfaces/customer-feedback.dto.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-configuration.dto.js +2 -0
- package/dist/esm/modules/support/interfaces/support-configuration.dto.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-reports.dto.js +2 -0
- package/dist/esm/modules/support/interfaces/support-reports.dto.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-sync.dto.js +2 -0
- package/dist/esm/modules/support/interfaces/support-sync.dto.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-ticket.dto.js +2 -0
- package/dist/esm/modules/support/interfaces/support-ticket.dto.js.map +1 -0
- package/dist/esm/modules/support/utils/support-display.util.js +351 -0
- package/dist/esm/modules/support/utils/support-display.util.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +22 -1
- package/dist/types/modules/permission/enums/permissions-moudule.enum.d.ts +2 -1
- package/dist/types/modules/support/enums/support-enums.d.ts +341 -0
- package/dist/types/modules/support/index.d.ts +7 -0
- package/dist/types/modules/support/interfaces/customer-feedback.dto.d.ts +151 -0
- package/dist/types/modules/support/interfaces/support-configuration.dto.d.ts +244 -0
- package/dist/types/modules/support/interfaces/support-reports.dto.d.ts +146 -0
- package/dist/types/modules/support/interfaces/support-sync.dto.d.ts +92 -0
- package/dist/types/modules/support/interfaces/support-ticket.dto.d.ts +275 -0
- package/dist/types/modules/support/utils/support-display.util.d.ts +67 -0
- package/package.json +1 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { CountryCode } from '../../country/enums/country-code.enum';
|
|
2
|
+
import { SupportProviderCapability, SupportProviderCode, SupportQueueAssignmentStrategy, SupportRelatedEntityType, SupportRoutingMatchType, SupportSlaClock, SupportTeamMemberRole, SupportTicketChannel, SupportTicketPriority } from '../enums/support-enums';
|
|
3
|
+
export interface SupportCategoryDto {
|
|
4
|
+
id: string;
|
|
5
|
+
organizationId: number | null;
|
|
6
|
+
parentId: string | null;
|
|
7
|
+
name: string;
|
|
8
|
+
code: string;
|
|
9
|
+
description: string | null;
|
|
10
|
+
defaultPriority: SupportTicketPriority | null;
|
|
11
|
+
defaultQueueId: string | null;
|
|
12
|
+
expectedRelatedEntityType: SupportRelatedEntityType | null;
|
|
13
|
+
displayOrder: number;
|
|
14
|
+
active: boolean;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CreateSupportCategoryDto {
|
|
19
|
+
name: string;
|
|
20
|
+
code: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
parentId?: string;
|
|
23
|
+
defaultPriority?: SupportTicketPriority;
|
|
24
|
+
defaultQueueId?: string;
|
|
25
|
+
expectedRelatedEntityType?: SupportRelatedEntityType;
|
|
26
|
+
displayOrder?: number;
|
|
27
|
+
organizationId?: number;
|
|
28
|
+
}
|
|
29
|
+
export type UpdateSupportCategoryDto = Partial<Omit<CreateSupportCategoryDto, 'code' | 'organizationId'>> & {
|
|
30
|
+
active?: boolean;
|
|
31
|
+
};
|
|
32
|
+
export interface SupportQueueDto {
|
|
33
|
+
id: string;
|
|
34
|
+
organizationId: number;
|
|
35
|
+
controlCentreId: number | null;
|
|
36
|
+
countryCode: CountryCode | null;
|
|
37
|
+
name: string;
|
|
38
|
+
code: string;
|
|
39
|
+
description: string | null;
|
|
40
|
+
teamId: string | null;
|
|
41
|
+
teamName: string | null;
|
|
42
|
+
assignmentStrategy: SupportQueueAssignmentStrategy;
|
|
43
|
+
slaPolicyId: string | null;
|
|
44
|
+
displayOrder: number;
|
|
45
|
+
active: boolean;
|
|
46
|
+
/** Live counts, filled on a list read so a supervisor sees the board at a glance. */
|
|
47
|
+
openTicketCount?: number;
|
|
48
|
+
unassignedTicketCount?: number;
|
|
49
|
+
breachedTicketCount?: number;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
}
|
|
53
|
+
export interface CreateSupportQueueDto {
|
|
54
|
+
name: string;
|
|
55
|
+
code: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
teamId?: string;
|
|
58
|
+
countryCode?: CountryCode;
|
|
59
|
+
controlCentreId?: number;
|
|
60
|
+
assignmentStrategy?: SupportQueueAssignmentStrategy;
|
|
61
|
+
slaPolicyId?: string;
|
|
62
|
+
displayOrder?: number;
|
|
63
|
+
organizationId?: number;
|
|
64
|
+
}
|
|
65
|
+
export type UpdateSupportQueueDto = Partial<Omit<CreateSupportQueueDto, 'code' | 'organizationId'>> & {
|
|
66
|
+
active?: boolean;
|
|
67
|
+
};
|
|
68
|
+
export interface SupportTeamDto {
|
|
69
|
+
id: string;
|
|
70
|
+
organizationId: number;
|
|
71
|
+
name: string;
|
|
72
|
+
code: string;
|
|
73
|
+
description: string | null;
|
|
74
|
+
supervisorUserIds: number[];
|
|
75
|
+
active: boolean;
|
|
76
|
+
memberCount?: number;
|
|
77
|
+
createdAt: string;
|
|
78
|
+
updatedAt: string;
|
|
79
|
+
}
|
|
80
|
+
export interface CreateSupportTeamDto {
|
|
81
|
+
name: string;
|
|
82
|
+
code: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
supervisorUserIds?: number[];
|
|
85
|
+
organizationId?: number;
|
|
86
|
+
}
|
|
87
|
+
export type UpdateSupportTeamDto = Partial<Omit<CreateSupportTeamDto, 'code' | 'organizationId'>> & {
|
|
88
|
+
active?: boolean;
|
|
89
|
+
};
|
|
90
|
+
export interface SupportTeamMemberDto {
|
|
91
|
+
id: string;
|
|
92
|
+
teamId: string;
|
|
93
|
+
userId: number;
|
|
94
|
+
userName: string | null;
|
|
95
|
+
role: SupportTeamMemberRole;
|
|
96
|
+
active: boolean;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
}
|
|
100
|
+
export interface UpsertSupportTeamMemberDto {
|
|
101
|
+
userId: number;
|
|
102
|
+
role: SupportTeamMemberRole;
|
|
103
|
+
active?: boolean;
|
|
104
|
+
}
|
|
105
|
+
export interface SupportSlaPolicyTargetDto {
|
|
106
|
+
priority: SupportTicketPriority;
|
|
107
|
+
firstResponseMinutes: number;
|
|
108
|
+
resolutionMinutes: number;
|
|
109
|
+
clock: SupportSlaClock;
|
|
110
|
+
}
|
|
111
|
+
export interface SupportBusinessCalendarDto {
|
|
112
|
+
/** ISO weekday numbers, Monday = 1. */
|
|
113
|
+
workingDays: number[];
|
|
114
|
+
startMinuteOfDay: number;
|
|
115
|
+
endMinuteOfDay: number;
|
|
116
|
+
timezone: string | null;
|
|
117
|
+
holidays: string[];
|
|
118
|
+
}
|
|
119
|
+
export interface SupportSlaPolicyDto {
|
|
120
|
+
id: string;
|
|
121
|
+
organizationId: number | null;
|
|
122
|
+
name: string;
|
|
123
|
+
description: string | null;
|
|
124
|
+
targets: SupportSlaPolicyTargetDto[];
|
|
125
|
+
businessCalendar: SupportBusinessCalendarDto | null;
|
|
126
|
+
isDefault: boolean;
|
|
127
|
+
active: boolean;
|
|
128
|
+
createdAt: string;
|
|
129
|
+
updatedAt: string;
|
|
130
|
+
}
|
|
131
|
+
export interface CreateSupportSlaPolicyDto {
|
|
132
|
+
name: string;
|
|
133
|
+
description?: string;
|
|
134
|
+
targets: SupportSlaPolicyTargetDto[];
|
|
135
|
+
businessCalendar?: SupportBusinessCalendarDto;
|
|
136
|
+
isDefault?: boolean;
|
|
137
|
+
organizationId?: number;
|
|
138
|
+
}
|
|
139
|
+
export type UpdateSupportSlaPolicyDto = Partial<Omit<CreateSupportSlaPolicyDto, 'organizationId'>> & {
|
|
140
|
+
active?: boolean;
|
|
141
|
+
};
|
|
142
|
+
export interface SupportRoutingRuleDto {
|
|
143
|
+
id: string;
|
|
144
|
+
organizationId: number;
|
|
145
|
+
name: string;
|
|
146
|
+
matchType: SupportRoutingMatchType;
|
|
147
|
+
matchCategoryId: string | null;
|
|
148
|
+
matchPriority: SupportTicketPriority | null;
|
|
149
|
+
matchChannel: SupportTicketChannel | null;
|
|
150
|
+
matchCountryCode: CountryCode | null;
|
|
151
|
+
matchControlCentreId: number | null;
|
|
152
|
+
matchAppId: string | null;
|
|
153
|
+
matchRelatedEntityType: SupportRelatedEntityType | null;
|
|
154
|
+
targetQueueId: string;
|
|
155
|
+
targetQueueName: string | null;
|
|
156
|
+
forcePriority: SupportTicketPriority | null;
|
|
157
|
+
/** Lower runs first. First match wins - there is no scoring. */
|
|
158
|
+
priority: number;
|
|
159
|
+
active: boolean;
|
|
160
|
+
createdAt: string;
|
|
161
|
+
updatedAt: string;
|
|
162
|
+
}
|
|
163
|
+
export interface CreateSupportRoutingRuleDto {
|
|
164
|
+
name: string;
|
|
165
|
+
matchType: SupportRoutingMatchType;
|
|
166
|
+
matchCategoryId?: string;
|
|
167
|
+
matchPriority?: SupportTicketPriority;
|
|
168
|
+
matchChannel?: SupportTicketChannel;
|
|
169
|
+
matchCountryCode?: CountryCode;
|
|
170
|
+
matchControlCentreId?: number;
|
|
171
|
+
matchAppId?: string;
|
|
172
|
+
matchRelatedEntityType?: SupportRelatedEntityType;
|
|
173
|
+
targetQueueId: string;
|
|
174
|
+
forcePriority?: SupportTicketPriority;
|
|
175
|
+
priority?: number;
|
|
176
|
+
organizationId?: number;
|
|
177
|
+
}
|
|
178
|
+
export type UpdateSupportRoutingRuleDto = Partial<Omit<CreateSupportRoutingRuleDto, 'organizationId'>> & {
|
|
179
|
+
active?: boolean;
|
|
180
|
+
};
|
|
181
|
+
/** One non-secret setting an adapter needs, described so a form can render it. */
|
|
182
|
+
export interface SupportProviderConfigFieldDto {
|
|
183
|
+
key: string;
|
|
184
|
+
label: string;
|
|
185
|
+
description: string | null;
|
|
186
|
+
type: 'string' | 'number' | 'boolean' | 'select';
|
|
187
|
+
required: boolean;
|
|
188
|
+
options?: {
|
|
189
|
+
value: string;
|
|
190
|
+
label: string;
|
|
191
|
+
}[];
|
|
192
|
+
example: string | null;
|
|
193
|
+
defaultValue: string | number | boolean | null;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* A credential the adapter needs, described by NAME only.
|
|
197
|
+
*
|
|
198
|
+
* The form collects the REFERENCE - the name of a secret in the deployment's
|
|
199
|
+
* secret store - never the credential. Nothing in the platform accepts a
|
|
200
|
+
* helpdesk API token over HTTP: a token typed into a browser is a token in a
|
|
201
|
+
* browser history, a proxy log and somebody's clipboard.
|
|
202
|
+
*/
|
|
203
|
+
export interface SupportProviderCredentialFieldDto {
|
|
204
|
+
key: string;
|
|
205
|
+
label: string;
|
|
206
|
+
description: string | null;
|
|
207
|
+
required: boolean;
|
|
208
|
+
}
|
|
209
|
+
export interface SupportProviderDescriptorDto {
|
|
210
|
+
code: SupportProviderCode;
|
|
211
|
+
name: string;
|
|
212
|
+
description: string;
|
|
213
|
+
capabilities: SupportProviderCapability[];
|
|
214
|
+
allowedHosts: string[];
|
|
215
|
+
available: boolean;
|
|
216
|
+
unavailableReason: string | null;
|
|
217
|
+
configFields: SupportProviderConfigFieldDto[];
|
|
218
|
+
credentialFields: SupportProviderCredentialFieldDto[];
|
|
219
|
+
verifiesWebhookSignature: boolean;
|
|
220
|
+
webhookPath: string | null;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Which helpdesk the deployment is running, as the admin sees it.
|
|
224
|
+
*
|
|
225
|
+
* Read-only on purpose. Switching provider is a deployment decision with a
|
|
226
|
+
* documented migration procedure, not a button - a screen that flipped the
|
|
227
|
+
* platform's helpdesk in one click would orphan every open ticket.
|
|
228
|
+
*/
|
|
229
|
+
export interface SupportProviderStatusDto {
|
|
230
|
+
activeProvider: SupportProviderCode;
|
|
231
|
+
providers: SupportProviderDescriptorDto[];
|
|
232
|
+
pendingSyncCount: number;
|
|
233
|
+
deadLetterSyncCount: number;
|
|
234
|
+
circuitOpen: boolean;
|
|
235
|
+
lastSuccessfulSyncAt: string | null;
|
|
236
|
+
lastFailedSyncAt: string | null;
|
|
237
|
+
}
|
|
238
|
+
export interface SupportProviderConnectionTestResultDto {
|
|
239
|
+
provider: SupportProviderCode;
|
|
240
|
+
success: boolean;
|
|
241
|
+
message: string;
|
|
242
|
+
latencyMs: number | null;
|
|
243
|
+
checkedAt: string;
|
|
244
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { CountryCode } from '../../country/enums/country-code.enum';
|
|
2
|
+
import { CustomerFeedbackStatus, CustomerFeedbackType, SupportRealtimeEventType, SupportSlaState, SupportTicketChannel, SupportTicketMessageType, SupportTicketPriority, SupportTicketStatus } from '../enums/support-enums';
|
|
3
|
+
/** A count against a dimension value. The shape every breakdown uses. */
|
|
4
|
+
export interface SupportMetricBucketDto {
|
|
5
|
+
key: string;
|
|
6
|
+
/** Resolved server-side, so no chart has to own a label map. */
|
|
7
|
+
label: string;
|
|
8
|
+
count: number;
|
|
9
|
+
}
|
|
10
|
+
/** A count at a point in time, for the trend charts. */
|
|
11
|
+
export interface SupportTimeSeriesPointDto {
|
|
12
|
+
at: string;
|
|
13
|
+
count: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The support overview.
|
|
17
|
+
*
|
|
18
|
+
* Durations are in MINUTES throughout. One unit across the whole contract,
|
|
19
|
+
* because a mixed seconds-and-minutes API is how a dashboard ends up silently
|
|
20
|
+
* reporting a sixty-fold error.
|
|
21
|
+
*/
|
|
22
|
+
export interface SupportDashboardMetricsDto {
|
|
23
|
+
from: string;
|
|
24
|
+
to: string;
|
|
25
|
+
totalTickets: number;
|
|
26
|
+
newTickets: number;
|
|
27
|
+
openTickets: number;
|
|
28
|
+
resolvedTickets: number;
|
|
29
|
+
closedTickets: number;
|
|
30
|
+
unassignedTickets: number;
|
|
31
|
+
breachedTickets: number;
|
|
32
|
+
atRiskTickets: number;
|
|
33
|
+
byStatus: SupportMetricBucketDto[];
|
|
34
|
+
byPriority: SupportMetricBucketDto[];
|
|
35
|
+
byChannel: SupportMetricBucketDto[];
|
|
36
|
+
byCategory: SupportMetricBucketDto[];
|
|
37
|
+
byQueue: SupportMetricBucketDto[];
|
|
38
|
+
byCountry: SupportMetricBucketDto[];
|
|
39
|
+
/** Populated only for a super-admin, the only caller who spans tenants. */
|
|
40
|
+
byOrganization: SupportMetricBucketDto[];
|
|
41
|
+
firstResponseComplianceRate: number;
|
|
42
|
+
resolutionComplianceRate: number;
|
|
43
|
+
slaBreachCount: number;
|
|
44
|
+
averageFirstResponseMinutes: number | null;
|
|
45
|
+
averageResolutionMinutes: number | null;
|
|
46
|
+
reopenRate: number;
|
|
47
|
+
feedbackCount: number;
|
|
48
|
+
averageRating: number | null;
|
|
49
|
+
feedbackByType: SupportMetricBucketDto[];
|
|
50
|
+
feedbackResponseRate: number;
|
|
51
|
+
feedbackConversionRate: number;
|
|
52
|
+
ticketsCreatedTrend: SupportTimeSeriesPointDto[];
|
|
53
|
+
ticketsResolvedTrend: SupportTimeSeriesPointDto[];
|
|
54
|
+
}
|
|
55
|
+
/** One agent's board. */
|
|
56
|
+
export interface SupportAgentDashboardMetricsDto {
|
|
57
|
+
agentUserId: number;
|
|
58
|
+
from: string;
|
|
59
|
+
to: string;
|
|
60
|
+
assignedToMe: number;
|
|
61
|
+
overdue: number;
|
|
62
|
+
atRisk: number;
|
|
63
|
+
waitingOnCustomer: number;
|
|
64
|
+
waitingOnInternalTeam: number;
|
|
65
|
+
resolvedInRange: number;
|
|
66
|
+
closedInRange: number;
|
|
67
|
+
averageFirstResponseMinutes: number | null;
|
|
68
|
+
averageResolutionMinutes: number | null;
|
|
69
|
+
/** Assigned but never replied to. The number a supervisor actually acts on. */
|
|
70
|
+
awaitingFirstResponse: number;
|
|
71
|
+
}
|
|
72
|
+
/** Feedback analytics, which stand alone because feedback is its own domain. */
|
|
73
|
+
export interface SupportFeedbackAnalyticsDto {
|
|
74
|
+
from: string;
|
|
75
|
+
to: string;
|
|
76
|
+
total: number;
|
|
77
|
+
byType: SupportMetricBucketDto[];
|
|
78
|
+
byStatus: SupportMetricBucketDto[];
|
|
79
|
+
byCountry: SupportMetricBucketDto[];
|
|
80
|
+
byOrganization: SupportMetricBucketDto[];
|
|
81
|
+
byApp: SupportMetricBucketDto[];
|
|
82
|
+
byAppVersion: SupportMetricBucketDto[];
|
|
83
|
+
byPlatform: SupportMetricBucketDto[];
|
|
84
|
+
bySentiment: SupportMetricBucketDto[];
|
|
85
|
+
averageRating: number | null;
|
|
86
|
+
ratingDistribution: SupportMetricBucketDto[];
|
|
87
|
+
responseRate: number;
|
|
88
|
+
conversionRate: number;
|
|
89
|
+
volumeTrend: SupportTimeSeriesPointDto[];
|
|
90
|
+
}
|
|
91
|
+
/** Filters every support report accepts. */
|
|
92
|
+
export interface SupportReportQueryParams {
|
|
93
|
+
from?: string;
|
|
94
|
+
to?: string;
|
|
95
|
+
organizationId?: number;
|
|
96
|
+
controlCentreId?: number;
|
|
97
|
+
countryCode?: CountryCode;
|
|
98
|
+
queueId?: string;
|
|
99
|
+
teamId?: string;
|
|
100
|
+
categoryId?: string;
|
|
101
|
+
agentUserId?: number;
|
|
102
|
+
status?: SupportTicketStatus;
|
|
103
|
+
priority?: SupportTicketPriority;
|
|
104
|
+
channel?: SupportTicketChannel;
|
|
105
|
+
feedbackType?: CustomerFeedbackType;
|
|
106
|
+
feedbackStatus?: CustomerFeedbackStatus;
|
|
107
|
+
granularity?: 'DAY' | 'WEEK' | 'MONTH';
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The live update the socket delivers.
|
|
111
|
+
*
|
|
112
|
+
* The payload is client-safe and minimal - enough to update a row or append a
|
|
113
|
+
* bubble, never enough to be an unauthorized read. An internal note reaches only
|
|
114
|
+
* the queue and agent rooms, and its body is not in the envelope at all: a
|
|
115
|
+
* client that needs it re-reads the ticket through the authorized REST path.
|
|
116
|
+
*/
|
|
117
|
+
export interface SupportRealtimeEnvelopeDto {
|
|
118
|
+
eventId: string;
|
|
119
|
+
eventType: SupportRealtimeEventType;
|
|
120
|
+
occurredAt: string;
|
|
121
|
+
organizationId: number;
|
|
122
|
+
controlCentreId: number | null;
|
|
123
|
+
rooms: string[];
|
|
124
|
+
ticketId?: string;
|
|
125
|
+
ticketNumber?: string;
|
|
126
|
+
feedbackId?: string;
|
|
127
|
+
actorUserId: number | null;
|
|
128
|
+
payload: SupportRealtimePayloadDto;
|
|
129
|
+
}
|
|
130
|
+
export interface SupportRealtimePayloadDto {
|
|
131
|
+
status?: SupportTicketStatus;
|
|
132
|
+
previousStatus?: SupportTicketStatus | null;
|
|
133
|
+
priority?: SupportTicketPriority;
|
|
134
|
+
assignedAgentId?: number | null;
|
|
135
|
+
queueId?: string | null;
|
|
136
|
+
messageId?: string;
|
|
137
|
+
messageType?: SupportTicketMessageType;
|
|
138
|
+
customerVisible?: boolean;
|
|
139
|
+
authorName?: string | null;
|
|
140
|
+
firstResponseSlaState?: SupportSlaState;
|
|
141
|
+
resolutionSlaState?: SupportSlaState;
|
|
142
|
+
externalSyncPending?: boolean;
|
|
143
|
+
externalSyncFailed?: boolean;
|
|
144
|
+
/** Server time the record last changed, so a client can discard a stale update. */
|
|
145
|
+
updatedAt?: string;
|
|
146
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { SupportProviderCode, SupportSyncEntityType, SupportSyncFailureReason, SupportSyncOperation, SupportSyncStatus, SupportWebhookStatus } from '../enums/support-enums';
|
|
2
|
+
/** One unit of outbound work against a helpdesk, as the sync dashboard shows it. */
|
|
3
|
+
export interface SupportProviderSyncDto {
|
|
4
|
+
id: string;
|
|
5
|
+
organizationId: number;
|
|
6
|
+
provider: SupportProviderCode;
|
|
7
|
+
entityType: SupportSyncEntityType;
|
|
8
|
+
entityId: string;
|
|
9
|
+
ticketId: string | null;
|
|
10
|
+
ticketNumber: string | null;
|
|
11
|
+
externalId: string | null;
|
|
12
|
+
operation: SupportSyncOperation;
|
|
13
|
+
status: SupportSyncStatus;
|
|
14
|
+
attempts: number;
|
|
15
|
+
maxAttempts: number;
|
|
16
|
+
lastAttemptAt: string | null;
|
|
17
|
+
nextAttemptAt: string | null;
|
|
18
|
+
failureReason: SupportSyncFailureReason | null;
|
|
19
|
+
errorCode: string | null;
|
|
20
|
+
/** Already scrubbed and length-capped server-side. Safe to render. */
|
|
21
|
+
errorMessage: string | null;
|
|
22
|
+
correlationId: string | null;
|
|
23
|
+
/** How long the row has been outstanding, so the list can sort by pain. */
|
|
24
|
+
ageMinutes: number;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
/** A webhook delivery from a helpdesk. */
|
|
29
|
+
export interface SupportWebhookEventDto {
|
|
30
|
+
id: string;
|
|
31
|
+
provider: SupportProviderCode;
|
|
32
|
+
externalEventId: string;
|
|
33
|
+
externalEventType: string | null;
|
|
34
|
+
ticketId: string | null;
|
|
35
|
+
externalTicketId: string | null;
|
|
36
|
+
status: SupportWebhookStatus;
|
|
37
|
+
statusReason: string | null;
|
|
38
|
+
receivedAt: string;
|
|
39
|
+
processedAt: string | null;
|
|
40
|
+
durationMs: number | null;
|
|
41
|
+
}
|
|
42
|
+
/** What reconciling one ticket against the provider found and did. */
|
|
43
|
+
export interface SupportReconciliationResultDto {
|
|
44
|
+
ticketId: string;
|
|
45
|
+
ticketNumber: string;
|
|
46
|
+
provider: SupportProviderCode;
|
|
47
|
+
externalTicketId: string | null;
|
|
48
|
+
inSync: boolean;
|
|
49
|
+
differences: string[];
|
|
50
|
+
applied: string[];
|
|
51
|
+
/** Left alone for a human, with the reason. Reconciliation never guesses. */
|
|
52
|
+
unresolved: string[];
|
|
53
|
+
messagesImported: number;
|
|
54
|
+
reconciledAt: string;
|
|
55
|
+
}
|
|
56
|
+
/** Headline numbers for the synchronization panel. */
|
|
57
|
+
export interface SupportSyncHealthDto {
|
|
58
|
+
provider: SupportProviderCode;
|
|
59
|
+
pending: number;
|
|
60
|
+
inProgress: number;
|
|
61
|
+
failed: number;
|
|
62
|
+
deadLetter: number;
|
|
63
|
+
succeededLastHour: number;
|
|
64
|
+
circuitOpen: boolean;
|
|
65
|
+
oldestPendingAgeMinutes: number | null;
|
|
66
|
+
lastSuccessfulSyncAt: string | null;
|
|
67
|
+
lastFailedSyncAt: string | null;
|
|
68
|
+
}
|
|
69
|
+
export interface RetrySupportSyncDto {
|
|
70
|
+
reason?: string;
|
|
71
|
+
/** Off by default: a row that failed eight times usually needs a fix, not eight more tries. */
|
|
72
|
+
resetAttempts?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface ReconcileSupportTicketDto {
|
|
75
|
+
/** Defaults to true, so an operator sees what would change before it changes. */
|
|
76
|
+
dryRun?: boolean;
|
|
77
|
+
importMissingMessages?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface SupportSyncQueryParams {
|
|
80
|
+
page?: number;
|
|
81
|
+
limit?: number;
|
|
82
|
+
status?: SupportSyncStatus;
|
|
83
|
+
operation?: SupportSyncOperation;
|
|
84
|
+
entityType?: SupportSyncEntityType;
|
|
85
|
+
failureReason?: SupportSyncFailureReason;
|
|
86
|
+
provider?: SupportProviderCode;
|
|
87
|
+
ticketId?: string;
|
|
88
|
+
organizationId?: number;
|
|
89
|
+
needsAttentionOnly?: boolean;
|
|
90
|
+
from?: string;
|
|
91
|
+
to?: string;
|
|
92
|
+
}
|