grm-shared-library 1.1.201 → 1.1.203
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/kafka/topics.js +26 -0
- package/dist/cjs/kafka/topics.js.map +1 -1
- package/dist/cjs/modules/common/constants/service.const.js +1 -0
- package/dist/cjs/modules/common/constants/service.const.js.map +1 -1
- package/dist/cjs/modules/permission/data/permissions.data.js +26 -0
- package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +40 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/cjs/modules/role/data/roles.data.js +85 -0
- package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
- package/dist/cjs/modules/socket/enums/redis-channel-name.enum.js +1 -0
- package/dist/cjs/modules/socket/enums/redis-channel-name.enum.js.map +1 -1
- package/dist/cjs/modules/socket/enums/room-type.enum.js +8 -0
- package/dist/cjs/modules/socket/enums/room-type.enum.js.map +1 -1
- package/dist/cjs/modules/socket/enums/socket-event-name.enum.js +5 -0
- package/dist/cjs/modules/socket/enums/socket-event-name.enum.js.map +1 -1
- package/dist/cjs/modules/support/constants/support-defaults.const.js +139 -0
- package/dist/cjs/modules/support/constants/support-defaults.const.js.map +1 -0
- package/dist/cjs/modules/support/constants/support-kafka.const.js +51 -0
- package/dist/cjs/modules/support/constants/support-kafka.const.js.map +1 -0
- package/dist/cjs/modules/support/dtos/create-support-ticket-message.dto.js +82 -0
- package/dist/cjs/modules/support/dtos/create-support-ticket-message.dto.js.map +1 -0
- package/dist/cjs/modules/support/dtos/create-support-ticket.dto.js +169 -0
- package/dist/cjs/modules/support/dtos/create-support-ticket.dto.js.map +1 -0
- package/dist/cjs/modules/support/dtos/customer-feedback.dto.js +401 -0
- package/dist/cjs/modules/support/dtos/customer-feedback.dto.js.map +1 -0
- package/dist/cjs/modules/support/dtos/support-configuration.dto.js +732 -0
- package/dist/cjs/modules/support/dtos/support-configuration.dto.js.map +1 -0
- package/dist/cjs/modules/support/dtos/support-related-entity.dto.js +38 -0
- package/dist/cjs/modules/support/dtos/support-related-entity.dto.js.map +1 -0
- package/dist/cjs/modules/support/dtos/support-report-query.dto.js +127 -0
- package/dist/cjs/modules/support/dtos/support-report-query.dto.js.map +1 -0
- package/dist/cjs/modules/support/dtos/support-sync.dto.js +175 -0
- package/dist/cjs/modules/support/dtos/support-sync.dto.js.map +1 -0
- package/dist/cjs/modules/support/dtos/support-ticket-actions.dto.js +191 -0
- package/dist/cjs/modules/support/dtos/support-ticket-actions.dto.js.map +1 -0
- package/dist/cjs/modules/support/dtos/support-ticket-query.dto.js +225 -0
- package/dist/cjs/modules/support/dtos/support-ticket-query.dto.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-audit-action.enum.js +87 -0
- package/dist/cjs/modules/support/enums/support-audit-action.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-feedback.enum.js +110 -0
- package/dist/cjs/modules/support/enums/support-feedback.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-provider-code.enum.js +66 -0
- package/dist/cjs/modules/support/enums/support-provider-code.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-related-entity-type.enum.js +50 -0
- package/dist/cjs/modules/support/enums/support-related-entity-type.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-routing.enum.js +58 -0
- package/dist/cjs/modules/support/enums/support-routing.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-sla.enum.js +55 -0
- package/dist/cjs/modules/support/enums/support-sla.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-sync.enum.js +133 -0
- package/dist/cjs/modules/support/enums/support-sync.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-ticket-channel.enum.js +36 -0
- package/dist/cjs/modules/support/enums/support-ticket-channel.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-ticket-message.enum.js +54 -0
- package/dist/cjs/modules/support/enums/support-ticket-message.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-ticket-priority.enum.js +41 -0
- package/dist/cjs/modules/support/enums/support-ticket-priority.enum.js.map +1 -0
- package/dist/cjs/modules/support/enums/support-ticket-status.enum.js +138 -0
- package/dist/cjs/modules/support/enums/support-ticket-status.enum.js.map +1 -0
- package/dist/cjs/modules/support/index.js +60 -0
- package/dist/cjs/modules/support/index.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/customer-feedback.js +3 -0
- package/dist/cjs/modules/support/interfaces/customer-feedback.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-configuration.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-configuration.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-events.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-events.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-provider-descriptor.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-provider-descriptor.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-realtime.js +18 -0
- package/dist/cjs/modules/support/interfaces/support-realtime.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-reports.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-reports.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-sync.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-sync.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-ticket-message.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-ticket-message.js.map +1 -0
- package/dist/cjs/modules/support/interfaces/support-ticket.js +3 -0
- package/dist/cjs/modules/support/interfaces/support-ticket.js.map +1 -0
- package/dist/cjs/modules/support/utils/support-feedback.util.js +66 -0
- package/dist/cjs/modules/support/utils/support-feedback.util.js.map +1 -0
- package/dist/cjs/modules/support/utils/support-redaction.util.js +173 -0
- package/dist/cjs/modules/support/utils/support-redaction.util.js.map +1 -0
- package/dist/cjs/modules/support/utils/support-routing.util.js +87 -0
- package/dist/cjs/modules/support/utils/support-routing.util.js.map +1 -0
- package/dist/cjs/modules/support/utils/support-sla.util.js +239 -0
- package/dist/cjs/modules/support/utils/support-sla.util.js.map +1 -0
- package/dist/cjs/modules/support/utils/support-status.util.js +93 -0
- package/dist/cjs/modules/support/utils/support-status.util.js.map +1 -0
- package/dist/cjs/modules/support/utils/support-sync.util.js +151 -0
- package/dist/cjs/modules/support/utils/support-sync.util.js.map +1 -0
- package/dist/cjs/modules/support/utils/support-ticket-number.util.js +61 -0
- package/dist/cjs/modules/support/utils/support-ticket-number.util.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/kafka/topics.js +26 -0
- package/dist/esm/kafka/topics.js.map +1 -1
- package/dist/esm/modules/common/constants/service.const.js +1 -0
- package/dist/esm/modules/common/constants/service.const.js.map +1 -1
- package/dist/esm/modules/permission/data/permissions.data.js +26 -0
- package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +40 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/esm/modules/role/data/roles.data.js +85 -0
- package/dist/esm/modules/role/data/roles.data.js.map +1 -1
- package/dist/esm/modules/socket/enums/redis-channel-name.enum.js +1 -0
- package/dist/esm/modules/socket/enums/redis-channel-name.enum.js.map +1 -1
- package/dist/esm/modules/socket/enums/room-type.enum.js +8 -0
- package/dist/esm/modules/socket/enums/room-type.enum.js.map +1 -1
- package/dist/esm/modules/socket/enums/socket-event-name.enum.js +5 -0
- package/dist/esm/modules/socket/enums/socket-event-name.enum.js.map +1 -1
- package/dist/esm/modules/support/constants/support-defaults.const.js +136 -0
- package/dist/esm/modules/support/constants/support-defaults.const.js.map +1 -0
- package/dist/esm/modules/support/constants/support-kafka.const.js +48 -0
- package/dist/esm/modules/support/constants/support-kafka.const.js.map +1 -0
- package/dist/esm/modules/support/dtos/create-support-ticket-message.dto.js +77 -0
- package/dist/esm/modules/support/dtos/create-support-ticket-message.dto.js.map +1 -0
- package/dist/esm/modules/support/dtos/create-support-ticket.dto.js +165 -0
- package/dist/esm/modules/support/dtos/create-support-ticket.dto.js.map +1 -0
- package/dist/esm/modules/support/dtos/customer-feedback.dto.js +392 -0
- package/dist/esm/modules/support/dtos/customer-feedback.dto.js.map +1 -0
- package/dist/esm/modules/support/dtos/support-configuration.dto.js +716 -0
- package/dist/esm/modules/support/dtos/support-configuration.dto.js.map +1 -0
- package/dist/esm/modules/support/dtos/support-related-entity.dto.js +34 -0
- package/dist/esm/modules/support/dtos/support-related-entity.dto.js.map +1 -0
- package/dist/esm/modules/support/dtos/support-report-query.dto.js +123 -0
- package/dist/esm/modules/support/dtos/support-report-query.dto.js.map +1 -0
- package/dist/esm/modules/support/dtos/support-sync.dto.js +169 -0
- package/dist/esm/modules/support/dtos/support-sync.dto.js.map +1 -0
- package/dist/esm/modules/support/dtos/support-ticket-actions.dto.js +180 -0
- package/dist/esm/modules/support/dtos/support-ticket-actions.dto.js.map +1 -0
- package/dist/esm/modules/support/dtos/support-ticket-query.dto.js +221 -0
- package/dist/esm/modules/support/dtos/support-ticket-query.dto.js.map +1 -0
- package/dist/esm/modules/support/enums/support-audit-action.enum.js +84 -0
- package/dist/esm/modules/support/enums/support-audit-action.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-feedback.enum.js +107 -0
- package/dist/esm/modules/support/enums/support-feedback.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-provider-code.enum.js +63 -0
- package/dist/esm/modules/support/enums/support-provider-code.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-related-entity-type.enum.js +47 -0
- package/dist/esm/modules/support/enums/support-related-entity-type.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-routing.enum.js +55 -0
- package/dist/esm/modules/support/enums/support-routing.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-sla.enum.js +52 -0
- package/dist/esm/modules/support/enums/support-sla.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-sync.enum.js +130 -0
- package/dist/esm/modules/support/enums/support-sync.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-ticket-channel.enum.js +33 -0
- package/dist/esm/modules/support/enums/support-ticket-channel.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-ticket-message.enum.js +51 -0
- package/dist/esm/modules/support/enums/support-ticket-message.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-ticket-priority.enum.js +38 -0
- package/dist/esm/modules/support/enums/support-ticket-priority.enum.js.map +1 -0
- package/dist/esm/modules/support/enums/support-ticket-status.enum.js +135 -0
- package/dist/esm/modules/support/enums/support-ticket-status.enum.js.map +1 -0
- package/dist/esm/modules/support/index.js +44 -0
- package/dist/esm/modules/support/index.js.map +1 -0
- package/dist/esm/modules/support/interfaces/customer-feedback.js +2 -0
- package/dist/esm/modules/support/interfaces/customer-feedback.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-configuration.js +2 -0
- package/dist/esm/modules/support/interfaces/support-configuration.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-events.js +2 -0
- package/dist/esm/modules/support/interfaces/support-events.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-provider-descriptor.js +2 -0
- package/dist/esm/modules/support/interfaces/support-provider-descriptor.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-realtime.js +15 -0
- package/dist/esm/modules/support/interfaces/support-realtime.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-reports.js +2 -0
- package/dist/esm/modules/support/interfaces/support-reports.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-sync.js +2 -0
- package/dist/esm/modules/support/interfaces/support-sync.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-ticket-message.js +2 -0
- package/dist/esm/modules/support/interfaces/support-ticket-message.js.map +1 -0
- package/dist/esm/modules/support/interfaces/support-ticket.js +2 -0
- package/dist/esm/modules/support/interfaces/support-ticket.js.map +1 -0
- package/dist/esm/modules/support/utils/support-feedback.util.js +60 -0
- package/dist/esm/modules/support/utils/support-feedback.util.js.map +1 -0
- package/dist/esm/modules/support/utils/support-redaction.util.js +164 -0
- package/dist/esm/modules/support/utils/support-redaction.util.js.map +1 -0
- package/dist/esm/modules/support/utils/support-routing.util.js +82 -0
- package/dist/esm/modules/support/utils/support-routing.util.js.map +1 -0
- package/dist/esm/modules/support/utils/support-sla.util.js +229 -0
- package/dist/esm/modules/support/utils/support-sla.util.js.map +1 -0
- package/dist/esm/modules/support/utils/support-status.util.js +81 -0
- package/dist/esm/modules/support/utils/support-status.util.js.map +1 -0
- package/dist/esm/modules/support/utils/support-sync.util.js +142 -0
- package/dist/esm/modules/support/utils/support-sync.util.js.map +1 -0
- package/dist/esm/modules/support/utils/support-ticket-number.util.js +56 -0
- package/dist/esm/modules/support/utils/support-ticket-number.util.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/kafka/topics.d.ts +21 -0
- package/dist/types/modules/common/constants/service.const.d.ts +4 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +21 -0
- package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +2 -1
- package/dist/types/modules/socket/enums/redis-channel-name.enum.d.ts +2 -1
- package/dist/types/modules/socket/enums/room-type.enum.d.ts +8 -0
- package/dist/types/modules/socket/enums/socket-event-name.enum.d.ts +2 -1
- package/dist/types/modules/support/constants/support-defaults.const.d.ts +129 -0
- package/dist/types/modules/support/constants/support-kafka.const.d.ts +47 -0
- package/dist/types/modules/support/dtos/create-support-ticket-message.dto.d.ts +30 -0
- package/dist/types/modules/support/dtos/create-support-ticket.dto.d.ts +35 -0
- package/dist/types/modules/support/dtos/customer-feedback.dto.d.ts +83 -0
- package/dist/types/modules/support/dtos/support-configuration.dto.d.ts +130 -0
- package/dist/types/modules/support/dtos/support-related-entity.dto.d.ts +13 -0
- package/dist/types/modules/support/dtos/support-report-query.dto.d.ts +29 -0
- package/dist/types/modules/support/dtos/support-sync.dto.d.ts +40 -0
- package/dist/types/modules/support/dtos/support-ticket-actions.dto.d.ts +61 -0
- package/dist/types/modules/support/dtos/support-ticket-query.dto.d.ts +41 -0
- package/dist/types/modules/support/enums/support-audit-action.enum.d.ts +80 -0
- package/dist/types/modules/support/enums/support-feedback.enum.d.ts +65 -0
- package/dist/types/modules/support/enums/support-provider-code.enum.d.ts +57 -0
- package/dist/types/modules/support/enums/support-related-entity-type.enum.d.ts +41 -0
- package/dist/types/modules/support/enums/support-routing.enum.d.ts +48 -0
- package/dist/types/modules/support/enums/support-sla.enum.d.ts +47 -0
- package/dist/types/modules/support/enums/support-sync.enum.d.ts +108 -0
- package/dist/types/modules/support/enums/support-ticket-channel.enum.d.ts +30 -0
- package/dist/types/modules/support/enums/support-ticket-message.enum.d.ts +42 -0
- package/dist/types/modules/support/enums/support-ticket-priority.enum.d.ts +24 -0
- package/dist/types/modules/support/enums/support-ticket-status.enum.d.ts +58 -0
- package/dist/types/modules/support/index.d.ts +38 -0
- package/dist/types/modules/support/interfaces/customer-feedback.d.ts +115 -0
- package/dist/types/modules/support/interfaces/support-configuration.d.ts +170 -0
- package/dist/types/modules/support/interfaces/support-events.d.ts +126 -0
- package/dist/types/modules/support/interfaces/support-provider-descriptor.d.ts +92 -0
- package/dist/types/modules/support/interfaces/support-realtime.d.ts +65 -0
- package/dist/types/modules/support/interfaces/support-reports.d.ts +122 -0
- package/dist/types/modules/support/interfaces/support-sync.d.ts +105 -0
- package/dist/types/modules/support/interfaces/support-ticket-message.d.ts +66 -0
- package/dist/types/modules/support/interfaces/support-ticket.d.ts +180 -0
- package/dist/types/modules/support/utils/support-feedback.util.d.ts +23 -0
- package/dist/types/modules/support/utils/support-redaction.util.d.ts +48 -0
- package/dist/types/modules/support/utils/support-routing.util.d.ts +50 -0
- package/dist/types/modules/support/utils/support-sla.util.d.ts +69 -0
- package/dist/types/modules/support/utils/support-status.util.d.ts +44 -0
- package/dist/types/modules/support/utils/support-sync.util.d.ts +76 -0
- package/dist/types/modules/support/utils/support-ticket-number.util.d.ts +39 -0
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/** Which Clarion record a synchronization row is mirroring. */
|
|
2
|
+
export declare enum SupportSyncEntityType {
|
|
3
|
+
TICKET = "TICKET",
|
|
4
|
+
MESSAGE = "MESSAGE",
|
|
5
|
+
ATTACHMENT = "ATTACHMENT",
|
|
6
|
+
/** The customer's contact record in the helpdesk. */
|
|
7
|
+
CONTACT = "CONTACT"
|
|
8
|
+
}
|
|
9
|
+
/** What the synchronization row is trying to do at the provider. */
|
|
10
|
+
export declare enum SupportSyncOperation {
|
|
11
|
+
UPSERT_CONTACT = "UPSERT_CONTACT",
|
|
12
|
+
CREATE_TICKET = "CREATE_TICKET",
|
|
13
|
+
UPDATE_TICKET = "UPDATE_TICKET",
|
|
14
|
+
ADD_PUBLIC_REPLY = "ADD_PUBLIC_REPLY",
|
|
15
|
+
ADD_INTERNAL_NOTE = "ADD_INTERNAL_NOTE",
|
|
16
|
+
ASSIGN_TICKET = "ASSIGN_TICKET",
|
|
17
|
+
CHANGE_STATUS = "CHANGE_STATUS",
|
|
18
|
+
ADD_ATTACHMENT = "ADD_ATTACHMENT",
|
|
19
|
+
CLOSE_TICKET = "CLOSE_TICKET",
|
|
20
|
+
REOPEN_TICKET = "REOPEN_TICKET",
|
|
21
|
+
/** Re-read the provider's copy to reconcile drift. Changes nothing outward. */
|
|
22
|
+
FETCH_TICKET = "FETCH_TICKET"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Operations that create something at the provider and therefore must never be
|
|
26
|
+
* blindly retried once the provider has answered 2xx.
|
|
27
|
+
*
|
|
28
|
+
* The same reasoning as a partner dispatch: a reply the customer has already
|
|
29
|
+
* been sent twice is a smaller harm than a duplicate ambulance, but it is still
|
|
30
|
+
* a harm, and an un-readable success is a question for a human.
|
|
31
|
+
*/
|
|
32
|
+
export declare const CREATING_SUPPORT_SYNC_OPERATIONS: readonly SupportSyncOperation[];
|
|
33
|
+
/** Where a synchronization row has got to. */
|
|
34
|
+
export declare enum SupportSyncStatus {
|
|
35
|
+
/** Queued, waiting for the worker. */
|
|
36
|
+
PENDING = "PENDING",
|
|
37
|
+
/** Claimed by a worker and in flight. */
|
|
38
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
39
|
+
/** The provider accepted it. */
|
|
40
|
+
SUCCEEDED = "SUCCEEDED",
|
|
41
|
+
/** Failed and will be retried. */
|
|
42
|
+
FAILED = "FAILED",
|
|
43
|
+
/** Out of attempts, or permanently failed. Waiting for a human. */
|
|
44
|
+
DEAD_LETTER = "DEAD_LETTER",
|
|
45
|
+
/** Deliberately not attempted - the provider is NONE, or lacks the capability. */
|
|
46
|
+
SKIPPED = "SKIPPED",
|
|
47
|
+
/** Superseded by a later operation on the same entity before it ever ran. */
|
|
48
|
+
SUPERSEDED = "SUPERSEDED"
|
|
49
|
+
}
|
|
50
|
+
/** Synchronization rows that no longer represent outstanding work. */
|
|
51
|
+
export declare const TERMINAL_SUPPORT_SYNC_STATUSES: readonly SupportSyncStatus[];
|
|
52
|
+
/**
|
|
53
|
+
* Why a synchronization attempt failed, in a taxonomy shared by every adapter.
|
|
54
|
+
*
|
|
55
|
+
* This is the single place the retry policy is decided. An adapter classifies;
|
|
56
|
+
* it never chooses whether to retry, because "should we call the helpdesk
|
|
57
|
+
* again?" must not be answered differently by Zammad and Freshdesk.
|
|
58
|
+
*/
|
|
59
|
+
export declare enum SupportSyncFailureReason {
|
|
60
|
+
/** The credential was refused. Retrying with the same credential cannot help. */
|
|
61
|
+
AUTHENTICATION_FAILED = "AUTHENTICATION_FAILED",
|
|
62
|
+
/** The account lacks the permission or the feature. */
|
|
63
|
+
AUTHORIZATION_FAILED = "AUTHORIZATION_FAILED",
|
|
64
|
+
/** The provider could not read the request. A retry sends the same bytes. */
|
|
65
|
+
INVALID_PAYLOAD = "INVALID_PAYLOAD",
|
|
66
|
+
/** The provider-side record is gone. */
|
|
67
|
+
NOT_FOUND = "NOT_FOUND",
|
|
68
|
+
/** The provider said no on the merits. */
|
|
69
|
+
PROVIDER_REJECTED = "PROVIDER_REJECTED",
|
|
70
|
+
/** Throttled. Retry after the advertised delay. */
|
|
71
|
+
RATE_LIMITED = "RATE_LIMITED",
|
|
72
|
+
/** 5xx, connection refused, DNS - the provider is down or unreachable. */
|
|
73
|
+
PROVIDER_UNAVAILABLE = "PROVIDER_UNAVAILABLE",
|
|
74
|
+
/** The request timed out with no answer, so the outcome is unknown. */
|
|
75
|
+
TIMEOUT = "TIMEOUT",
|
|
76
|
+
/** The circuit breaker is open; nothing was sent. */
|
|
77
|
+
CIRCUIT_OPEN = "CIRCUIT_OPEN",
|
|
78
|
+
/** No provider is configured, or its credential reference is missing. */
|
|
79
|
+
PROVIDER_NOT_CONFIGURED = "PROVIDER_NOT_CONFIGURED",
|
|
80
|
+
/** A 2xx whose body could not be understood. Permanent, and a human must look. */
|
|
81
|
+
UNREADABLE_SUCCESS = "UNREADABLE_SUCCESS",
|
|
82
|
+
/** Anything unrecognised. Treated as transient. */
|
|
83
|
+
UNKNOWN = "UNKNOWN"
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Failures a retry can never fix.
|
|
87
|
+
*
|
|
88
|
+
* Everything not listed here is transient, deliberately: a support message that
|
|
89
|
+
* arrives late is recoverable, and one that is dropped because an unfamiliar
|
|
90
|
+
* error looked fatal is not.
|
|
91
|
+
*
|
|
92
|
+
* UNREADABLE_SUCCESS is permanent for the opposite reason to the rest - the
|
|
93
|
+
* provider very likely DID accept it, and repeating a create would duplicate a
|
|
94
|
+
* ticket or double-send a reply to a customer.
|
|
95
|
+
*/
|
|
96
|
+
export declare const PERMANENT_SUPPORT_SYNC_FAILURE_REASONS: readonly SupportSyncFailureReason[];
|
|
97
|
+
/** How a provider webhook delivery was handled. */
|
|
98
|
+
export declare enum SupportWebhookStatus {
|
|
99
|
+
RECEIVED = "RECEIVED",
|
|
100
|
+
PROCESSED = "PROCESSED",
|
|
101
|
+
/** A duplicate delivery of an event already applied. */
|
|
102
|
+
DUPLICATE = "DUPLICATE",
|
|
103
|
+
/** Understood, and deliberately not acted on (an echo of our own write). */
|
|
104
|
+
IGNORED = "IGNORED",
|
|
105
|
+
/** Signature verification failed. Never processed. */
|
|
106
|
+
REJECTED = "REJECTED",
|
|
107
|
+
FAILED = "FAILED"
|
|
108
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** How a ticket reached Clarion. */
|
|
2
|
+
export declare enum SupportTicketChannel {
|
|
3
|
+
/** The Flutter customer app. */
|
|
4
|
+
MOBILE_APP = "MOBILE_APP",
|
|
5
|
+
/** The Angular admin / web application. */
|
|
6
|
+
WEB_APP = "WEB_APP",
|
|
7
|
+
/** Raised by an agent on a customer's behalf, e.g. after a phone call. */
|
|
8
|
+
AGENT_PORTAL = "AGENT_PORTAL",
|
|
9
|
+
/** Arrived at the helpdesk directly - an email to the support address - and synced in. */
|
|
10
|
+
PROVIDER = "PROVIDER",
|
|
11
|
+
EMAIL = "EMAIL",
|
|
12
|
+
PHONE = "PHONE",
|
|
13
|
+
SMS = "SMS",
|
|
14
|
+
CHAT = "CHAT",
|
|
15
|
+
/** Created by the platform itself, e.g. converted from customer feedback. */
|
|
16
|
+
SYSTEM = "SYSTEM",
|
|
17
|
+
API = "API"
|
|
18
|
+
}
|
|
19
|
+
/** Who or what caused the ticket to exist. Orthogonal to the channel it arrived on. */
|
|
20
|
+
export declare enum SupportTicketSource {
|
|
21
|
+
CUSTOMER = "CUSTOMER",
|
|
22
|
+
AGENT = "AGENT",
|
|
23
|
+
SYSTEM = "SYSTEM",
|
|
24
|
+
/** Promoted from a piece of customer feedback; keeps `feedback.convertedTicketId`. */
|
|
25
|
+
FEEDBACK_CONVERSION = "FEEDBACK_CONVERSION",
|
|
26
|
+
/** Found in the helpdesk during a sync or reconciliation, with no Clarion origin. */
|
|
27
|
+
PROVIDER_SYNC = "PROVIDER_SYNC",
|
|
28
|
+
/** Escalated out of a chat conversation. */
|
|
29
|
+
CHAT_ESCALATION = "CHAT_ESCALATION"
|
|
30
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What kind of entry a ticket message is.
|
|
3
|
+
*
|
|
4
|
+
* INTERNAL_NOTE is the load-bearing member: it is the only value that must
|
|
5
|
+
* never be visible to a customer, and every customer-facing read path filters
|
|
6
|
+
* on this enum rather than on a boolean somebody might forget to set.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum SupportTicketMessageType {
|
|
9
|
+
/** Written by the customer. */
|
|
10
|
+
CUSTOMER_MESSAGE = "CUSTOMER_MESSAGE",
|
|
11
|
+
/** Written by an agent and addressed to the customer. */
|
|
12
|
+
AGENT_REPLY = "AGENT_REPLY",
|
|
13
|
+
/** Agent to agent. NEVER returned on a customer-facing endpoint. */
|
|
14
|
+
INTERNAL_NOTE = "INTERNAL_NOTE",
|
|
15
|
+
/** Generated by Clarion, e.g. a first-response target being missed. */
|
|
16
|
+
SYSTEM_MESSAGE = "SYSTEM_MESSAGE",
|
|
17
|
+
/** A recorded state change, rendered inline in the conversation. */
|
|
18
|
+
STATUS_MESSAGE = "STATUS_MESSAGE"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The only message types a customer may ever be shown.
|
|
22
|
+
*
|
|
23
|
+
* Read this list rather than negating INTERNAL_NOTE: a message type added later
|
|
24
|
+
* is then invisible to customers until somebody decides otherwise, which is the
|
|
25
|
+
* safe direction for the mistake to fall.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CUSTOMER_VISIBLE_SUPPORT_MESSAGE_TYPES: readonly SupportTicketMessageType[];
|
|
28
|
+
/** Who wrote a message. Separate from the type, so a system note stays attributable. */
|
|
29
|
+
export declare enum SupportMessageAuthorType {
|
|
30
|
+
CUSTOMER = "CUSTOMER",
|
|
31
|
+
AGENT = "AGENT",
|
|
32
|
+
SYSTEM = "SYSTEM",
|
|
33
|
+
/** Authored in the helpdesk by somebody with no Clarion user id. */
|
|
34
|
+
PROVIDER_AGENT = "PROVIDER_AGENT"
|
|
35
|
+
}
|
|
36
|
+
/** Where a message originated, which decides whether it needs mirroring outward. */
|
|
37
|
+
export declare enum SupportMessageOrigin {
|
|
38
|
+
/** Written in Clarion. Must be pushed to the provider. */
|
|
39
|
+
CLARION = "CLARION",
|
|
40
|
+
/** Arrived from the provider. Must never be pushed back. */
|
|
41
|
+
PROVIDER = "PROVIDER"
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How urgently a ticket needs answering.
|
|
3
|
+
*
|
|
4
|
+
* CRITICAL exists because this is an emergency-response platform: "the panic
|
|
5
|
+
* button does not reach the control room" is not the same class of problem as
|
|
6
|
+
* "the invoice PDF has the wrong logo", and a support desk that cannot say so
|
|
7
|
+
* will end up treating them the same.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum SupportTicketPriority {
|
|
10
|
+
/** Emergency response is impaired for a live tenant. */
|
|
11
|
+
CRITICAL = "CRITICAL",
|
|
12
|
+
/** A core workflow is broken with no workaround. */
|
|
13
|
+
URGENT = "URGENT",
|
|
14
|
+
/** A significant problem with a workaround. */
|
|
15
|
+
HIGH = "HIGH",
|
|
16
|
+
/** The default. */
|
|
17
|
+
NORMAL = "NORMAL",
|
|
18
|
+
/** A question, or something cosmetic. */
|
|
19
|
+
LOW = "LOW"
|
|
20
|
+
}
|
|
21
|
+
/** Most urgent first. Used to order a queue and to order report axes. */
|
|
22
|
+
export declare const SUPPORT_TICKET_PRIORITY_ORDER: readonly SupportTicketPriority[];
|
|
23
|
+
/** Numeric rank for sorting in SQL and in the client. Lower is more urgent. */
|
|
24
|
+
export declare const SUPPORT_TICKET_PRIORITY_RANK: Readonly<Record<SupportTicketPriority, number>>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle of a support ticket inside Clarion.
|
|
3
|
+
*
|
|
4
|
+
* Clarion owns this state machine even when a helpdesk is the operational
|
|
5
|
+
* source of truth for agent workflow: a provider status arriving over a webhook
|
|
6
|
+
* is MAPPED onto one of these and then validated like any other transition, so
|
|
7
|
+
* a vendor can never put a Clarion ticket into a state the domain does not
|
|
8
|
+
* recognise.
|
|
9
|
+
*
|
|
10
|
+
* Nothing here is a free-text string, and no code outside
|
|
11
|
+
* {@link SUPPORT_TICKET_TRANSITIONS} decides whether a move is allowed.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum SupportTicketStatus {
|
|
14
|
+
/** Created and not yet triaged. The only entry state. */
|
|
15
|
+
NEW = "NEW",
|
|
16
|
+
/** Triaged into a queue; nobody has picked it up. */
|
|
17
|
+
OPEN = "OPEN",
|
|
18
|
+
/** An agent owns it but has not started. */
|
|
19
|
+
ASSIGNED = "ASSIGNED",
|
|
20
|
+
/** An agent is actively working it. */
|
|
21
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
22
|
+
/** Waiting for the customer. SLA clocks pause here. */
|
|
23
|
+
WAITING_ON_CUSTOMER = "WAITING_ON_CUSTOMER",
|
|
24
|
+
/** Waiting on another Clarion team. Clocks keep running - this delay is ours. */
|
|
25
|
+
WAITING_ON_INTERNAL_TEAM = "WAITING_ON_INTERNAL_TEAM",
|
|
26
|
+
/** The agent believes it is done; the customer has not confirmed. */
|
|
27
|
+
RESOLVED = "RESOLVED",
|
|
28
|
+
/** Finished. Reopening is possible and is recorded as such. */
|
|
29
|
+
CLOSED = "CLOSED",
|
|
30
|
+
/** Reopened after being closed. Distinct from OPEN so reopen rate is measurable. */
|
|
31
|
+
REOPENED = "REOPENED",
|
|
32
|
+
/** Withdrawn before any work happened - a duplicate, or raised by mistake. */
|
|
33
|
+
CANCELLED = "CANCELLED"
|
|
34
|
+
}
|
|
35
|
+
/** States from which no further transition is allowed. */
|
|
36
|
+
export declare const TERMINAL_SUPPORT_TICKET_STATUSES: readonly SupportTicketStatus[];
|
|
37
|
+
/** States a customer still counts as open on their own ticket list. */
|
|
38
|
+
export declare const ACTIVE_SUPPORT_TICKET_STATUSES: readonly SupportTicketStatus[];
|
|
39
|
+
/** States in which an SLA clock is deliberately not running. */
|
|
40
|
+
export declare const SLA_PAUSED_SUPPORT_TICKET_STATUSES: readonly SupportTicketStatus[];
|
|
41
|
+
/** States that stop every SLA clock for good. */
|
|
42
|
+
export declare const SLA_STOPPED_SUPPORT_TICKET_STATUSES: readonly SupportTicketStatus[];
|
|
43
|
+
/**
|
|
44
|
+
* Every transition the domain permits, keyed by the state being left.
|
|
45
|
+
*
|
|
46
|
+
* Deliberately more permissive in a few places than a textbook happy path, and
|
|
47
|
+
* each one is a real support-desk behaviour rather than a convenience:
|
|
48
|
+
*
|
|
49
|
+
* - Any live state may go straight to RESOLVED. An agent who fixes something
|
|
50
|
+
* while a ticket is merely OPEN should not have to assign it to themselves
|
|
51
|
+
* first in order to say so.
|
|
52
|
+
* - Any live state may go to CANCELLED. Duplicates are noticed at every stage.
|
|
53
|
+
* - RESOLVED may go back to IN_PROGRESS. A customer who says it did not work
|
|
54
|
+
* before the ticket auto-closes has not reopened a closed ticket, and
|
|
55
|
+
* counting that as a reopen would overstate the reopen rate.
|
|
56
|
+
* - CLOSED may only become REOPENED, so every return from closed is counted.
|
|
57
|
+
*/
|
|
58
|
+
export declare const SUPPORT_TICKET_TRANSITIONS: Readonly<Record<SupportTicketStatus, readonly SupportTicketStatus[]>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export * from './enums/support-provider-code.enum';
|
|
2
|
+
export * from './enums/support-ticket-status.enum';
|
|
3
|
+
export * from './enums/support-ticket-priority.enum';
|
|
4
|
+
export * from './enums/support-ticket-channel.enum';
|
|
5
|
+
export * from './enums/support-ticket-message.enum';
|
|
6
|
+
export * from './enums/support-sla.enum';
|
|
7
|
+
export * from './enums/support-feedback.enum';
|
|
8
|
+
export * from './enums/support-related-entity-type.enum';
|
|
9
|
+
export * from './enums/support-sync.enum';
|
|
10
|
+
export * from './enums/support-audit-action.enum';
|
|
11
|
+
export * from './enums/support-routing.enum';
|
|
12
|
+
export * from './interfaces/support-ticket';
|
|
13
|
+
export * from './interfaces/support-ticket-message';
|
|
14
|
+
export * from './interfaces/support-configuration';
|
|
15
|
+
export * from './interfaces/customer-feedback';
|
|
16
|
+
export * from './interfaces/support-provider-descriptor';
|
|
17
|
+
export * from './interfaces/support-sync';
|
|
18
|
+
export * from './interfaces/support-events';
|
|
19
|
+
export * from './interfaces/support-realtime';
|
|
20
|
+
export * from './interfaces/support-reports';
|
|
21
|
+
export * from './constants/support-defaults.const';
|
|
22
|
+
export * from './constants/support-kafka.const';
|
|
23
|
+
export * from './dtos/support-related-entity.dto';
|
|
24
|
+
export * from './dtos/create-support-ticket.dto';
|
|
25
|
+
export * from './dtos/support-ticket-actions.dto';
|
|
26
|
+
export * from './dtos/create-support-ticket-message.dto';
|
|
27
|
+
export * from './dtos/support-ticket-query.dto';
|
|
28
|
+
export * from './dtos/customer-feedback.dto';
|
|
29
|
+
export * from './dtos/support-configuration.dto';
|
|
30
|
+
export * from './dtos/support-sync.dto';
|
|
31
|
+
export * from './dtos/support-report-query.dto';
|
|
32
|
+
export * from './utils/support-ticket-number.util';
|
|
33
|
+
export * from './utils/support-status.util';
|
|
34
|
+
export * from './utils/support-redaction.util';
|
|
35
|
+
export * from './utils/support-sla.util';
|
|
36
|
+
export * from './utils/support-sync.util';
|
|
37
|
+
export * from './utils/support-feedback.util';
|
|
38
|
+
export * from './utils/support-routing.util';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { CountryCode } from '../../country/enums/country-code.enum';
|
|
2
|
+
import { IncidentAppId } from '../../incident/enums/incident-app-id.enum';
|
|
3
|
+
import { CustomerFeedbackChannel, CustomerFeedbackMessageAuthorType, CustomerFeedbackSentiment, CustomerFeedbackStatus, CustomerFeedbackType } from '../enums/support-feedback.enum';
|
|
4
|
+
import { SupportRelatedEntityRef } from './support-ticket';
|
|
5
|
+
/**
|
|
6
|
+
* Diagnostic context captured with a piece of feedback.
|
|
7
|
+
*
|
|
8
|
+
* Everything here is chosen so a bug report is actionable without being a
|
|
9
|
+
* privacy problem. There is no token, no OTP, no password, no request body and
|
|
10
|
+
* no response body - a client that tries to send one has it stripped, because
|
|
11
|
+
* "the whole failing request would be so useful" is exactly how credentials end
|
|
12
|
+
* up in a support table that a wide group of people can read.
|
|
13
|
+
*/
|
|
14
|
+
export interface CustomerFeedbackContext {
|
|
15
|
+
/** Client application, e.g. G4S. */
|
|
16
|
+
appId?: IncidentAppId | null;
|
|
17
|
+
appVersion?: string | null;
|
|
18
|
+
/** ios | android | web */
|
|
19
|
+
platform?: string | null;
|
|
20
|
+
osVersion?: string | null;
|
|
21
|
+
deviceModel?: string | null;
|
|
22
|
+
/** The screen or feature the customer was on. */
|
|
23
|
+
screen?: string | null;
|
|
24
|
+
locale?: string | null;
|
|
25
|
+
/** Ties the report to server-side logs without carrying any of their content. */
|
|
26
|
+
correlationId?: string | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A piece of customer feedback.
|
|
30
|
+
*
|
|
31
|
+
* A first-class Clarion domain, deliberately separate from tickets. Feedback is
|
|
32
|
+
* never owned by a helpdesk: it is how the product hears from its users, it has
|
|
33
|
+
* to stay queryable when the support provider changes, and most of it needs no
|
|
34
|
+
* agent at all. Where it does, it is CONVERTED into a ticket and the link is
|
|
35
|
+
* kept - the two records never merge.
|
|
36
|
+
*/
|
|
37
|
+
export interface CustomerFeedback {
|
|
38
|
+
id: string;
|
|
39
|
+
organizationId: number;
|
|
40
|
+
controlCentreId?: number | null;
|
|
41
|
+
countryCode: CountryCode;
|
|
42
|
+
submittedByUserId: number;
|
|
43
|
+
/** Resolved for display in the admin. Absent on customer-facing reads. */
|
|
44
|
+
submittedByName?: string | null;
|
|
45
|
+
type: CustomerFeedbackType;
|
|
46
|
+
channel: CustomerFeedbackChannel;
|
|
47
|
+
status: CustomerFeedbackStatus;
|
|
48
|
+
title?: string | null;
|
|
49
|
+
message: string;
|
|
50
|
+
/** 1-5, and only for the rating types. Null otherwise. */
|
|
51
|
+
rating?: number | null;
|
|
52
|
+
/** Derived from type and rating, never from the text. */
|
|
53
|
+
sentiment: CustomerFeedbackSentiment;
|
|
54
|
+
context?: CustomerFeedbackContext | null;
|
|
55
|
+
/** What the feedback is about, when it is about something specific. */
|
|
56
|
+
relatedEntities: SupportRelatedEntityRef[];
|
|
57
|
+
/** Set once the feedback has been promoted into a ticket. */
|
|
58
|
+
convertedTicketId?: string | null;
|
|
59
|
+
convertedTicketNumber?: string | null;
|
|
60
|
+
convertedAt?: string | null;
|
|
61
|
+
reviewedByUserId?: number | null;
|
|
62
|
+
reviewedByName?: string | null;
|
|
63
|
+
reviewedAt?: string | null;
|
|
64
|
+
/** When the customer was last replied to. */
|
|
65
|
+
respondedAt?: string | null;
|
|
66
|
+
/** Count of entries in the thread, so a list can show that a reply exists. */
|
|
67
|
+
messageCount: number;
|
|
68
|
+
/** Free-text labels for triage. */
|
|
69
|
+
tags: string[];
|
|
70
|
+
/** Optimistic concurrency, as on a ticket. */
|
|
71
|
+
version: number;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
}
|
|
75
|
+
/** The shape a feedback list returns. */
|
|
76
|
+
export interface CustomerFeedbackSummary {
|
|
77
|
+
id: string;
|
|
78
|
+
organizationId: number;
|
|
79
|
+
countryCode: CountryCode;
|
|
80
|
+
submittedByUserId: number;
|
|
81
|
+
submittedByName?: string | null;
|
|
82
|
+
type: CustomerFeedbackType;
|
|
83
|
+
channel: CustomerFeedbackChannel;
|
|
84
|
+
status: CustomerFeedbackStatus;
|
|
85
|
+
title?: string | null;
|
|
86
|
+
/** First line of the message, clamped, so a list is readable without the body. */
|
|
87
|
+
preview: string;
|
|
88
|
+
rating?: number | null;
|
|
89
|
+
sentiment: CustomerFeedbackSentiment;
|
|
90
|
+
appId?: IncidentAppId | null;
|
|
91
|
+
appVersion?: string | null;
|
|
92
|
+
platform?: string | null;
|
|
93
|
+
convertedTicketId?: string | null;
|
|
94
|
+
convertedTicketNumber?: string | null;
|
|
95
|
+
messageCount: number;
|
|
96
|
+
createdAt: string;
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* One entry in a feedback thread.
|
|
101
|
+
*
|
|
102
|
+
* Feedback is two-way where a reply is appropriate. It is not a ticket
|
|
103
|
+
* conversation and deliberately has no internal notes: a reviewer who needs to
|
|
104
|
+
* discuss something privately converts the feedback into a ticket, which is the
|
|
105
|
+
* record that supports that.
|
|
106
|
+
*/
|
|
107
|
+
export interface CustomerFeedbackMessage {
|
|
108
|
+
id: string;
|
|
109
|
+
feedbackId: string;
|
|
110
|
+
authorType: CustomerFeedbackMessageAuthorType;
|
|
111
|
+
authorUserId?: number | null;
|
|
112
|
+
authorName?: string | null;
|
|
113
|
+
body: string;
|
|
114
|
+
createdAt: string;
|
|
115
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { CountryCode } from '../../country/enums/country-code.enum';
|
|
2
|
+
import { IncidentAppId } from '../../incident/enums/incident-app-id.enum';
|
|
3
|
+
import { SupportRelatedEntityType } from '../enums/support-related-entity-type.enum';
|
|
4
|
+
import { SupportQueueAssignmentStrategy, SupportRoutingMatchType, SupportTeamMemberRole } from '../enums/support-routing.enum';
|
|
5
|
+
import { SupportSlaClock } from '../enums/support-sla.enum';
|
|
6
|
+
import { SupportTicketChannel } from '../enums/support-ticket-channel.enum';
|
|
7
|
+
import { SupportTicketPriority } from '../enums/support-ticket-priority.enum';
|
|
8
|
+
/**
|
|
9
|
+
* A ticket category.
|
|
10
|
+
*
|
|
11
|
+
* Two levels at most - a parent and its children - because a support taxonomy
|
|
12
|
+
* deeper than that stops being navigable in a dropdown and starts being a
|
|
13
|
+
* search problem.
|
|
14
|
+
*/
|
|
15
|
+
export interface SupportCategory {
|
|
16
|
+
id: string;
|
|
17
|
+
/** Null for a platform-wide category available to every tenant. */
|
|
18
|
+
organizationId?: number | null;
|
|
19
|
+
parentId?: string | null;
|
|
20
|
+
name: string;
|
|
21
|
+
/** Stable machine key, e.g. BILLING. Unique per organization. */
|
|
22
|
+
code: string;
|
|
23
|
+
description?: string | null;
|
|
24
|
+
/** Priority applied to a new ticket in this category when the client sends none. */
|
|
25
|
+
defaultPriority?: SupportTicketPriority | null;
|
|
26
|
+
/** Queue a new ticket lands in, unless a routing rule says otherwise. */
|
|
27
|
+
defaultQueueId?: string | null;
|
|
28
|
+
/** Which Clarion record this category expects tickets to be about. */
|
|
29
|
+
expectedRelatedEntityType?: SupportRelatedEntityType | null;
|
|
30
|
+
displayOrder: number;
|
|
31
|
+
active: boolean;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
}
|
|
35
|
+
/** A shared inbox tickets are routed into. */
|
|
36
|
+
export interface SupportQueue {
|
|
37
|
+
id: string;
|
|
38
|
+
organizationId: number;
|
|
39
|
+
/** Narrows the queue to one control centre when set. */
|
|
40
|
+
controlCentreId?: number | null;
|
|
41
|
+
/** Narrows the queue to one country. A KE queue never sees a UG ticket. */
|
|
42
|
+
countryCode?: CountryCode | null;
|
|
43
|
+
name: string;
|
|
44
|
+
code: string;
|
|
45
|
+
description?: string | null;
|
|
46
|
+
/** The team that works this queue. */
|
|
47
|
+
teamId?: string | null;
|
|
48
|
+
assignmentStrategy: SupportQueueAssignmentStrategy;
|
|
49
|
+
/** Overrides the organization's SLA policy for tickets in this queue. */
|
|
50
|
+
slaPolicyId?: string | null;
|
|
51
|
+
/** Order in which queues are offered and reported. */
|
|
52
|
+
displayOrder: number;
|
|
53
|
+
active: boolean;
|
|
54
|
+
/** Live counts, filled on a list read. */
|
|
55
|
+
openTicketCount?: number;
|
|
56
|
+
unassignedTicketCount?: number;
|
|
57
|
+
breachedTicketCount?: number;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
}
|
|
61
|
+
/** A group of support people. */
|
|
62
|
+
export interface SupportTeam {
|
|
63
|
+
id: string;
|
|
64
|
+
organizationId: number;
|
|
65
|
+
name: string;
|
|
66
|
+
code: string;
|
|
67
|
+
description?: string | null;
|
|
68
|
+
/** Escalations for this team's tickets go here first. */
|
|
69
|
+
supervisorUserIds: number[];
|
|
70
|
+
active: boolean;
|
|
71
|
+
memberCount?: number;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
}
|
|
75
|
+
/** One person's membership of a team. */
|
|
76
|
+
export interface SupportTeamMember {
|
|
77
|
+
id: string;
|
|
78
|
+
teamId: string;
|
|
79
|
+
userId: number;
|
|
80
|
+
/** Resolved for display. */
|
|
81
|
+
userName?: string | null;
|
|
82
|
+
role: SupportTeamMemberRole;
|
|
83
|
+
/** An agent who is off rota keeps their membership and stops being assigned work. */
|
|
84
|
+
active: boolean;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
updatedAt: string;
|
|
87
|
+
}
|
|
88
|
+
/** The targets one SLA policy sets for one priority. */
|
|
89
|
+
export interface SupportSlaPolicyTarget {
|
|
90
|
+
priority: SupportTicketPriority;
|
|
91
|
+
firstResponseMinutes: number;
|
|
92
|
+
resolutionMinutes: number;
|
|
93
|
+
clock: SupportSlaClock;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A set of SLA targets, applied at organization or queue level.
|
|
97
|
+
*
|
|
98
|
+
* Resolution order is queue policy, then organization policy, then the platform
|
|
99
|
+
* defaults. A policy that omits a priority falls through for that priority
|
|
100
|
+
* alone rather than for the whole ticket, so an organization can tighten
|
|
101
|
+
* CRITICAL without restating the other four rows.
|
|
102
|
+
*/
|
|
103
|
+
export interface SupportSlaPolicy {
|
|
104
|
+
id: string;
|
|
105
|
+
/** Null for the platform-wide policy a super-admin maintains. */
|
|
106
|
+
organizationId?: number | null;
|
|
107
|
+
name: string;
|
|
108
|
+
description?: string | null;
|
|
109
|
+
targets: SupportSlaPolicyTarget[];
|
|
110
|
+
/** Working calendar used by BUSINESS-clock targets. Null means the platform default. */
|
|
111
|
+
businessCalendar?: SupportBusinessCalendar | null;
|
|
112
|
+
/** Only one policy per organization may be the default. */
|
|
113
|
+
isDefault: boolean;
|
|
114
|
+
active: boolean;
|
|
115
|
+
createdAt: string;
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A working calendar.
|
|
120
|
+
*
|
|
121
|
+
* Deliberately simple - weekdays, a window, a timezone and a holiday list -
|
|
122
|
+
* because the shape has to be editable by an administrator rather than a
|
|
123
|
+
* developer. Anything richer belongs in a calendar service that does not exist
|
|
124
|
+
* yet, and this model can be replaced by one without touching the ticket
|
|
125
|
+
* domain.
|
|
126
|
+
*/
|
|
127
|
+
export interface SupportBusinessCalendar {
|
|
128
|
+
/** ISO weekday numbers, Monday = 1. */
|
|
129
|
+
workingDays: number[];
|
|
130
|
+
/** Minutes past local midnight when the day opens. */
|
|
131
|
+
startMinuteOfDay: number;
|
|
132
|
+
/** Minutes past local midnight when it closes. */
|
|
133
|
+
endMinuteOfDay: number;
|
|
134
|
+
/** IANA zone, e.g. Africa/Nairobi. Resolved from the ticket's country when absent. */
|
|
135
|
+
timezone?: string | null;
|
|
136
|
+
/** Non-working dates as YYYY-MM-DD. */
|
|
137
|
+
holidays: string[];
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* One deterministic routing rule.
|
|
141
|
+
*
|
|
142
|
+
* Rules are evaluated in ascending `priority` and the FIRST match wins. There is
|
|
143
|
+
* no scoring and no machine learning: an operator has to be able to answer "why
|
|
144
|
+
* did this ticket land here?" by reading the table, and a routing decision they
|
|
145
|
+
* cannot explain is one they cannot fix at 2am.
|
|
146
|
+
*/
|
|
147
|
+
export interface SupportRoutingRule {
|
|
148
|
+
id: string;
|
|
149
|
+
organizationId: number;
|
|
150
|
+
name: string;
|
|
151
|
+
matchType: SupportRoutingMatchType;
|
|
152
|
+
/** The value matched, interpreted per `matchType`. Null for ANY. */
|
|
153
|
+
matchValue?: string | null;
|
|
154
|
+
matchCategoryId?: string | null;
|
|
155
|
+
matchPriority?: SupportTicketPriority | null;
|
|
156
|
+
matchChannel?: SupportTicketChannel | null;
|
|
157
|
+
matchCountryCode?: CountryCode | null;
|
|
158
|
+
matchControlCentreId?: number | null;
|
|
159
|
+
matchAppId?: IncidentAppId | null;
|
|
160
|
+
matchRelatedEntityType?: SupportRelatedEntityType | null;
|
|
161
|
+
/** Where a matching ticket goes. */
|
|
162
|
+
targetQueueId: string;
|
|
163
|
+
/** Optionally forces a priority, e.g. anything about an incident is at least HIGH. */
|
|
164
|
+
forcePriority?: SupportTicketPriority | null;
|
|
165
|
+
/** Lower runs first. */
|
|
166
|
+
priority: number;
|
|
167
|
+
active: boolean;
|
|
168
|
+
createdAt: string;
|
|
169
|
+
updatedAt: string;
|
|
170
|
+
}
|