hgs-twilio-class-lib 1.1.65 → 1.1.67
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/lib/config/AWSConfig.js +4 -4
- package/lib/config/DatabaseConfig.d.ts +0 -1
- package/lib/config/DatabaseConfig.js +0 -1
- package/lib/config/TwilioConfig.js +2 -2
- package/lib/controller/MainController.js +4 -4
- package/lib/controller/twilio/RTRWGQueueStatisticsCESController.d.ts +58 -0
- package/lib/controller/twilio/RTRWGQueueStatisticsCESController.js +205 -0
- package/lib/controller/twilio/RealTimeReportsWGDetailsController.js +3 -3
- package/lib/controller/twilio/filterImpl/WorkGroupDetailsFilter.d.ts +14 -0
- package/lib/controller/twilio/filterImpl/WorkGroupDetailsFilter.js +53 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -3
- package/lib/models/impl/QueuePeriodStatisticsModelCES.d.ts +34 -0
- package/lib/models/impl/QueuePeriodStatisticsModelCES.js +93 -0
- package/lib/models/impl/WorkGroupDetailsModel.d.ts +47 -53
- package/lib/models/impl/WorkGroupDetailsModel.js +156 -204
- package/lib/models/impl/WorkGroupQueueStatisticsModelCES.d.ts +16 -0
- package/lib/models/impl/WorkGroupQueueStatisticsModelCES.js +32 -0
- package/lib/models/types/WorkGroupDetails.type.d.ts +6 -0
- package/lib/models/types/WorkGroupDetails.type.js +7 -0
- package/package.json +2 -1
package/lib/config/AWSConfig.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AWSConfig = void 0;
|
|
4
4
|
exports.AWSConfig = {
|
|
5
|
-
region: "",
|
|
6
|
-
service: "",
|
|
7
|
-
accessKeyId: "",
|
|
8
|
-
secretAccessKey: ""
|
|
5
|
+
region: "23ed2",
|
|
6
|
+
service: "1312",
|
|
7
|
+
accessKeyId: "1313",
|
|
8
|
+
secretAccessKey: "13132"
|
|
9
9
|
};
|
|
@@ -24,7 +24,6 @@ export declare const databaseConfig: {
|
|
|
24
24
|
navigationTable: string;
|
|
25
25
|
realTimeReportWGDetailsTable: string;
|
|
26
26
|
realTimeReportQueueDetailsTable: string;
|
|
27
|
-
realTimeReportWGDetailsCESTable: string;
|
|
28
27
|
playbackscreenrecordingsTable: string;
|
|
29
28
|
taskInfoPanelTable: string;
|
|
30
29
|
channelSettingsTable: string;
|
|
@@ -27,7 +27,6 @@ exports.databaseConfig = {
|
|
|
27
27
|
navigationTable: "navigation",
|
|
28
28
|
realTimeReportWGDetailsTable: "realTimeReportWGDetails",
|
|
29
29
|
realTimeReportQueueDetailsTable: "realTimeReportQueueDetails",
|
|
30
|
-
realTimeReportWGDetailsCESTable: "realTimeReportWGDetailsCES",
|
|
31
30
|
playbackscreenrecordingsTable: "Recordings-QA",
|
|
32
31
|
taskInfoPanelTable: "taskInfoPanel",
|
|
33
32
|
channelSettingsTable: "channelSettings",
|
|
@@ -26,8 +26,9 @@ const QuickLinkController_1 = require("./twilio/QuickLinkController");
|
|
|
26
26
|
const NavigationController_1 = require("./twilio/NavigationController");
|
|
27
27
|
const CallbackAndVoicemailController_1 = require("./twilio/CallbackAndVoicemailController");
|
|
28
28
|
const QualityFormsController_1 = require("./twilio/QualityFormsController");
|
|
29
|
-
const RealTimeReportsWGDetailsController_1 = require("./twilio/RealTimeReportsWGDetailsController");
|
|
30
29
|
const RealTimeReportQueueDetailsController_1 = require("./twilio/RealTimeReportQueueDetailsController");
|
|
30
|
+
const RealTimeReportsWGDetailsController_1 = require("./twilio/RealTimeReportsWGDetailsController");
|
|
31
|
+
const RTRWGQueueStatisticsCESController_1 = require("./twilio/RTRWGQueueStatisticsCESController");
|
|
31
32
|
const PlaybackScreenrecordings_1 = require("./aws/PlaybackScreenrecordings");
|
|
32
33
|
const AWSConnectAPIConfig_1 = require("../aws/impl/AWSConnectAPIConfig");
|
|
33
34
|
const AWSClient_1 = require("../aws/impl/AWSClient");
|
|
@@ -57,7 +58,6 @@ const ChannelSettingTaskInfoController_1 = require("./twilio/ChannelSettingTaskI
|
|
|
57
58
|
const TaskInfoPanelController_1 = require("./twilio/TaskInfoPanelController");
|
|
58
59
|
const AgentScorecardController_1 = require("./twilio/AgentScorecardController");
|
|
59
60
|
const AgentActionsController_1 = require("./twilio/AgentActionsController");
|
|
60
|
-
const RealTimeReportsWGDetailsControllerCES_1 = require("./twilio/RealTimeReportsWGDetailsControllerCES");
|
|
61
61
|
let twilConfig = new TwilioAuthTokenConfig_1.TwilioAuthTokenConfig(TwilioConfig_1.TwilioConfig.accountSid, TwilioConfig_1.TwilioConfig.authToken);
|
|
62
62
|
let twilioClient = new TwilioClient_1.TwilioClient(twilConfig);
|
|
63
63
|
let AwsConfig = new AWSConnectAPIConfig_1.AWSConnectAPIConfig(AWSConfig_1.AWSConfig.region, AWSConfig_1.AWSConfig.service, AWSConfig_1.AWSConfig.accessKeyId, AWSConfig_1.AWSConfig.secretAccessKey);
|
|
@@ -152,8 +152,9 @@ MainController.controllers = {
|
|
|
152
152
|
callbackAndVoiceMail: CallbackAndVoicemailController_1.CallbackAndVoicemailController,
|
|
153
153
|
navaigation: NavigationController_1.NavigationController,
|
|
154
154
|
qualityForms: QualityFormsController_1.QualityFormsController,
|
|
155
|
-
realtimeReportsWGDetails: RealTimeReportsWGDetailsController_1.RealTimeReportsWGDetailsController,
|
|
156
155
|
realtimeQueueDetails: RealTimeReportQueueDetailsController_1.RealTimeReportsQueueDetailsController,
|
|
156
|
+
realtimeReportsWGDetails: RealTimeReportsWGDetailsController_1.RealTimeReportsWGDetailsController,
|
|
157
|
+
realtimeQueueDetailsCES: RTRWGQueueStatisticsCESController_1.RTReportsQueueDetailsCESController,
|
|
157
158
|
hoopProfilesList: HoopProfilesListController_1.HoopProfilesListController,
|
|
158
159
|
hoopOverrideBranches: HoopOverrideBranchesController_1.HoopOverrideBranchesController,
|
|
159
160
|
hoopOperations: HoopOperationsController_1.HoopOperationsController,
|
|
@@ -171,6 +172,5 @@ MainController.controllers = {
|
|
|
171
172
|
channelSettings: ChannelSettingsController_1.ChannelSettingsController,
|
|
172
173
|
channelSettingsTaskInfo: ChannelSettingTaskInfoController_1.ChannelSettingTaskInfoController,
|
|
173
174
|
agentActions: AgentActionsController_1.AgentActionsController,
|
|
174
|
-
realtimeReportsMain: RealTimeReportsWGDetailsControllerCES_1.RealTimeReportsWGDetailsCESController
|
|
175
175
|
// Add more controllers here as needed
|
|
176
176
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { SyncServiceFactory } from "../../twilio/impl/sync/SyncServiceFactory";
|
|
2
|
+
import { QueuePeriodStatisticsModel } from "../../models/impl/QueuePeriodStatisticsModelCES";
|
|
3
|
+
import { SearchParameterType } from "../../common/type/SearchParameterType";
|
|
4
|
+
export declare class RTReportsQueueDetailsCESController {
|
|
5
|
+
private _dbFactory;
|
|
6
|
+
private _twilioClient;
|
|
7
|
+
private _syncServiceSid;
|
|
8
|
+
constructor(dbFactory: SyncServiceFactory, twilioClient: any, syncServiceSid: string);
|
|
9
|
+
/**
|
|
10
|
+
* Adds a new workgroup details record to the database.
|
|
11
|
+
*
|
|
12
|
+
* This method validates the provided workgroup details data, opens a connection
|
|
13
|
+
* to the database, starts a transaction, and adds the data to the specified
|
|
14
|
+
* object store. If validation fails or any error occurs during the database
|
|
15
|
+
* operation, it throws an error.
|
|
16
|
+
*
|
|
17
|
+
* @param {WorkGroupDetailsModel} data - The workgroup details data to be added.
|
|
18
|
+
* @returns {Promise<any>} - Returns a promise with the result of the database operation.
|
|
19
|
+
*/
|
|
20
|
+
add(data: QueuePeriodStatisticsModel): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* Edits an existing workgroup details record in the database.
|
|
23
|
+
*
|
|
24
|
+
* This method validates the provided workgroup details data, opens a connection
|
|
25
|
+
* to the database, starts a transaction, and updates the data in the specified
|
|
26
|
+
* object store. If validation fails or any error occurs during the database
|
|
27
|
+
* operation, it throws an error.
|
|
28
|
+
*
|
|
29
|
+
* @param {WorkGroupDetailsModel} data - The workgroup details data to be edited.
|
|
30
|
+
* @returns {Promise<any>} - Returns a promise with the result of the database operation.
|
|
31
|
+
*/
|
|
32
|
+
edit(data: QueuePeriodStatisticsModel): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves all workgroup details records from the database.
|
|
35
|
+
*
|
|
36
|
+
* This method opens a connection to the database, starts a transaction,
|
|
37
|
+
* retrieves all records from the specified object store, and returns them.
|
|
38
|
+
* If any error occurs during the database operation, it throws an error.
|
|
39
|
+
*
|
|
40
|
+
* @param {SearchParameterType} query - The search parameters for retrieving data.
|
|
41
|
+
* @returns {Promise<any>} - Returns a promise with the result of the database operation.
|
|
42
|
+
*/
|
|
43
|
+
getAll(query: SearchParameterType): Promise<any>;
|
|
44
|
+
/**
|
|
45
|
+
* Deletes a workgroup details record from the database.
|
|
46
|
+
*
|
|
47
|
+
* This method opens a connection to the database, starts a transaction,
|
|
48
|
+
* and deletes the record with the specified ID from the object store.
|
|
49
|
+
* If any error occurs during the database operation, it throws an error.
|
|
50
|
+
*
|
|
51
|
+
* @param {Pick<WorkGroupDetailsModel, "id">} query - The ID of the record to be deleted.
|
|
52
|
+
* @returns {Promise<any>} - Returns a promise with the result of the database operation.
|
|
53
|
+
*/
|
|
54
|
+
delete(query: {
|
|
55
|
+
period: string;
|
|
56
|
+
tableName: string;
|
|
57
|
+
}): Promise<any>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RTReportsQueueDetailsCESController = void 0;
|
|
13
|
+
// Helper to resolve Sync Service SID from friendly name
|
|
14
|
+
function getSyncServiceSidByFriendlyName(twilioClient, friendlyName) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const services = yield twilioClient.sync.v1.services.list();
|
|
17
|
+
const found = services.find((svc) => svc.friendlyName === friendlyName);
|
|
18
|
+
if (!found)
|
|
19
|
+
throw new Error(`Sync Service with friendly name '${friendlyName}' not found.`);
|
|
20
|
+
return found.sid;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const QueuePeriodStatisticsModelCES_1 = require("../../models/impl/QueuePeriodStatisticsModelCES");
|
|
24
|
+
const WorkGroupQueueStatisticsModelCES_1 = require("../../models/impl/WorkGroupQueueStatisticsModelCES");
|
|
25
|
+
const Common_1 = require("../Common");
|
|
26
|
+
// Importing necessary configurations and types
|
|
27
|
+
const DatabaseConfig_1 = require("../../config/DatabaseConfig");
|
|
28
|
+
class RTReportsQueueDetailsCESController {
|
|
29
|
+
constructor(dbFactory, twilioClient, syncServiceSid) {
|
|
30
|
+
this._dbFactory = dbFactory;
|
|
31
|
+
this._twilioClient = twilioClient;
|
|
32
|
+
this._syncServiceSid = syncServiceSid;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Adds a new workgroup details record to the database.
|
|
36
|
+
*
|
|
37
|
+
* This method validates the provided workgroup details data, opens a connection
|
|
38
|
+
* to the database, starts a transaction, and adds the data to the specified
|
|
39
|
+
* object store. If validation fails or any error occurs during the database
|
|
40
|
+
* operation, it throws an error.
|
|
41
|
+
*
|
|
42
|
+
* @param {WorkGroupDetailsModel} data - The workgroup details data to be added.
|
|
43
|
+
* @returns {Promise<any>} - Returns a promise with the result of the database operation.
|
|
44
|
+
*/
|
|
45
|
+
add(data) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
try {
|
|
48
|
+
console.log("Received_data:............", data);
|
|
49
|
+
const tableName = data.tableName;
|
|
50
|
+
console.log("received_Table_Name:", tableName);
|
|
51
|
+
console.log(" this._dbFactory_2", this._dbFactory);
|
|
52
|
+
const tableNameValidation = WorkGroupQueueStatisticsModelCES_1.WorkGroupQueueStatisticsModel.validateTableName(tableName);
|
|
53
|
+
if (tableNameValidation.length > 0) {
|
|
54
|
+
throw tableNameValidation;
|
|
55
|
+
}
|
|
56
|
+
const periodStats = new QueuePeriodStatisticsModelCES_1.QueuePeriodStatisticsModel(data.aban, data.answer, data.offer, data.sla_target, data.sum_wait_time, data.total_service_level, data.transfer_count);
|
|
57
|
+
if (periodStats.validationMessages.length > 0) {
|
|
58
|
+
throw periodStats.validationMessages; // Throw error if data validation fails
|
|
59
|
+
}
|
|
60
|
+
let syncServiceSid = data.TWILIO_FLEX_SYNC_SID;
|
|
61
|
+
if (!syncServiceSid || typeof syncServiceSid !== "string") {
|
|
62
|
+
// Try to get by friendly name
|
|
63
|
+
const friendlyName = data.TWILIO_FLEX_SYNC_FRIENDLY_NAME;
|
|
64
|
+
if (!friendlyName || typeof friendlyName !== "string") {
|
|
65
|
+
throw new Error("Sync Service SID or friendly name missing/invalid in data.");
|
|
66
|
+
}
|
|
67
|
+
syncServiceSid = yield getSyncServiceSidByFriendlyName(this._twilioClient, friendlyName);
|
|
68
|
+
}
|
|
69
|
+
console.log("Twilio Client and Sync Service SID are configured.", this._twilioClient, syncServiceSid);
|
|
70
|
+
// Ensure Sync Map exists (or create if not)
|
|
71
|
+
yield (0, Common_1.createOrUpdateSyncMap)(this._twilioClient, syncServiceSid, tableName);
|
|
72
|
+
// Set TTL for 3 days (in seconds)
|
|
73
|
+
const ttlSeconds = 3 * 24 * 60 * 60;
|
|
74
|
+
const now = Math.floor(Date.now() / 1000);
|
|
75
|
+
const expiresAt = now + ttlSeconds;
|
|
76
|
+
// Attach TTL to the record
|
|
77
|
+
const recordWithTTL = Object.assign(Object.assign({}, periodStats), { ttl: expiresAt });
|
|
78
|
+
const periodKey = data.period;
|
|
79
|
+
if (!periodKey || typeof periodKey !== "string" || !/^P_\d+$/.test(periodKey)) {
|
|
80
|
+
throw new Error("Required parameter 'period' missing or invalid in data.");
|
|
81
|
+
}
|
|
82
|
+
// Add item to Sync Map using Twilio SDK
|
|
83
|
+
const result = yield this._twilioClient.sync.v1
|
|
84
|
+
.services(syncServiceSid)
|
|
85
|
+
.syncMaps(tableName)
|
|
86
|
+
.syncMapItems.create({ key: periodKey, data: recordWithTTL });
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.log("Error occurred:", error);
|
|
91
|
+
return error;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Edits an existing workgroup details record in the database.
|
|
97
|
+
*
|
|
98
|
+
* This method validates the provided workgroup details data, opens a connection
|
|
99
|
+
* to the database, starts a transaction, and updates the data in the specified
|
|
100
|
+
* object store. If validation fails or any error occurs during the database
|
|
101
|
+
* operation, it throws an error.
|
|
102
|
+
*
|
|
103
|
+
* @param {WorkGroupDetailsModel} data - The workgroup details data to be edited.
|
|
104
|
+
* @returns {Promise<any>} - Returns a promise with the result of the database operation.
|
|
105
|
+
*/
|
|
106
|
+
edit(data) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
try {
|
|
109
|
+
const tableName = data.tableName;
|
|
110
|
+
const tableNameValidation = WorkGroupQueueStatisticsModelCES_1.WorkGroupQueueStatisticsModel.validateTableName(tableName);
|
|
111
|
+
if (tableNameValidation.length > 0) {
|
|
112
|
+
throw tableNameValidation;
|
|
113
|
+
}
|
|
114
|
+
const periodStats = new QueuePeriodStatisticsModelCES_1.QueuePeriodStatisticsModel(data.aban, data.answer, data.offer, data.sla_target, data.sum_wait_time, data.total_service_level, data.transfer_count);
|
|
115
|
+
if (periodStats.validationMessages.length > 0) {
|
|
116
|
+
throw periodStats.validationMessages; // Throw error if data validation fails
|
|
117
|
+
}
|
|
118
|
+
// Open database connection
|
|
119
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
120
|
+
const database = databaseConnection.result;
|
|
121
|
+
// Start database transaction
|
|
122
|
+
const dbTransaction = database.transaction(data.tableName, "readwrite");
|
|
123
|
+
// Access object store
|
|
124
|
+
let table = dbTransaction.objectStore(data.tableName);
|
|
125
|
+
// Update existing data in the object store
|
|
126
|
+
let result = table.put(periodStats, data.period);
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
console.log("Error occurred:", error);
|
|
131
|
+
return error;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Retrieves all workgroup details records from the database.
|
|
137
|
+
*
|
|
138
|
+
* This method opens a connection to the database, starts a transaction,
|
|
139
|
+
* retrieves all records from the specified object store, and returns them.
|
|
140
|
+
* If any error occurs during the database operation, it throws an error.
|
|
141
|
+
*
|
|
142
|
+
* @param {SearchParameterType} query - The search parameters for retrieving data.
|
|
143
|
+
* @returns {Promise<any>} - Returns a promise with the result of the database operation.
|
|
144
|
+
*/
|
|
145
|
+
getAll(query) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
try {
|
|
148
|
+
const tableName = query.tableName;
|
|
149
|
+
const tableNameValidation = WorkGroupQueueStatisticsModelCES_1.WorkGroupQueueStatisticsModel.validateTableName(tableName);
|
|
150
|
+
if (tableNameValidation.length > 0) {
|
|
151
|
+
throw tableNameValidation;
|
|
152
|
+
}
|
|
153
|
+
// Open database connection
|
|
154
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
155
|
+
const database = databaseConnection.result;
|
|
156
|
+
// Start database transaction
|
|
157
|
+
const dbTransaction = database.transaction(tableName, "readwrite");
|
|
158
|
+
// Access object store
|
|
159
|
+
let table = dbTransaction.objectStore(tableName);
|
|
160
|
+
// Retrieve all data from the object store
|
|
161
|
+
let result = yield table.getAll(query);
|
|
162
|
+
return { result, meta: query }; // Return result with meta data
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
return error;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Deletes a workgroup details record from the database.
|
|
171
|
+
*
|
|
172
|
+
* This method opens a connection to the database, starts a transaction,
|
|
173
|
+
* and deletes the record with the specified ID from the object store.
|
|
174
|
+
* If any error occurs during the database operation, it throws an error.
|
|
175
|
+
*
|
|
176
|
+
* @param {Pick<WorkGroupDetailsModel, "id">} query - The ID of the record to be deleted.
|
|
177
|
+
* @returns {Promise<any>} - Returns a promise with the result of the database operation.
|
|
178
|
+
*/
|
|
179
|
+
delete(query) {
|
|
180
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
try {
|
|
182
|
+
const tableName = query.tableName;
|
|
183
|
+
const tableNameValidation = WorkGroupQueueStatisticsModelCES_1.WorkGroupQueueStatisticsModel.validateTableName(tableName);
|
|
184
|
+
if (tableNameValidation.length > 0) {
|
|
185
|
+
throw tableNameValidation;
|
|
186
|
+
}
|
|
187
|
+
// Open database connection
|
|
188
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.databaseName, DatabaseConfig_1.databaseConfig.version);
|
|
189
|
+
const database = databaseConnection.result;
|
|
190
|
+
// Start database transaction
|
|
191
|
+
const dbTransaction = database.transaction(tableName, "readwrite");
|
|
192
|
+
// Access object store
|
|
193
|
+
let table = dbTransaction.objectStore(tableName);
|
|
194
|
+
// Delete data from the object store
|
|
195
|
+
let result = table.delete(query.period);
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
console.log("Error occurred:", error);
|
|
200
|
+
return error;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.RTReportsQueueDetailsCESController = RTReportsQueueDetailsCESController;
|
|
@@ -40,7 +40,7 @@ class RealTimeReportsWGDetailsController {
|
|
|
40
40
|
add(data) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
try {
|
|
43
|
-
const workgroupDetails = new WorkGroupDetailsModel_1.WorkGroupDetailsModel(data.id, data.
|
|
43
|
+
const workgroupDetails = new WorkGroupDetailsModel_1.WorkGroupDetailsModel(data.id, data.uniqueName, data.periodNumber, data.sumWaitTime, data.intOffr, data.intAns, data.intAbn, data.slaTarget, data.totalServiceLevel, data.transferCount, data.interactionsWaiting, data.longestInteractionWaiting, data.totalAbanLevel, data.averageSpeedAnswer, data.createdAt, data.updatedAt, data.eventId);
|
|
44
44
|
if (workgroupDetails.validationMessages.length > 0) {
|
|
45
45
|
throw workgroupDetails.validationMessages; // Throw error if data validation fails
|
|
46
46
|
}
|
|
@@ -52,7 +52,7 @@ class RealTimeReportsWGDetailsController {
|
|
|
52
52
|
// Access object store
|
|
53
53
|
let table = dbTransaction.objectStore(DatabaseConfig_1.databaseConfig.tables.realTimeReportWGDetailsTable);
|
|
54
54
|
// Add new data to the object store
|
|
55
|
-
|
|
55
|
+
const result = yield table.add(workgroupDetails.serialize, workgroupDetails.id, 24 * 2 * 60 * 60);
|
|
56
56
|
return result;
|
|
57
57
|
}
|
|
58
58
|
catch (error) {
|
|
@@ -75,7 +75,7 @@ class RealTimeReportsWGDetailsController {
|
|
|
75
75
|
edit(data) {
|
|
76
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
77
|
try {
|
|
78
|
-
const workgroupDetails = new WorkGroupDetailsModel_1.WorkGroupDetailsModel(data.id, data.
|
|
78
|
+
const workgroupDetails = new WorkGroupDetailsModel_1.WorkGroupDetailsModel(data.id, data.uniqueName, data.periodNumber, data.sumWaitTime, data.intOffr, data.intAns, data.intAbn, data.slaTarget, data.totalServiceLevel, data.transferCount, data.interactionsWaiting, data.longestInteractionWaiting, data.totalAbanLevel, data.averageSpeedAnswer, data.createdAt, data.updatedAt, data.eventId);
|
|
79
79
|
if (workgroupDetails.validationMessages.length > 0) {
|
|
80
80
|
throw workgroupDetails.validationMessages; // Throw error if data validation fails
|
|
81
81
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MultiFieldFilter, FilterDataObject } from "../../../common/interface/IFilter";
|
|
2
|
+
import { Filter } from "../../../common/abstract/Filter";
|
|
3
|
+
export declare class WorkGroupDetailsFilterService extends Filter {
|
|
4
|
+
private data;
|
|
5
|
+
allowedFields: {
|
|
6
|
+
uniqueName: string;
|
|
7
|
+
periodNumber: string;
|
|
8
|
+
};
|
|
9
|
+
constructor(data: any[]);
|
|
10
|
+
applyFilter(data: any[]): any[];
|
|
11
|
+
filterApply(filterParams: MultiFieldFilter): any[];
|
|
12
|
+
private validateFilters;
|
|
13
|
+
static getFilterData(filterOptions: Record<string, any[]> | null): FilterDataObject[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkGroupDetailsFilterService = void 0;
|
|
4
|
+
const MainFilterService_1 = require("./MainFilterService");
|
|
5
|
+
const Filter_1 = require("../../../common/abstract/Filter");
|
|
6
|
+
const FilterTypes_1 = require("../../../common/enum/FilterTypes");
|
|
7
|
+
class WorkGroupDetailsFilterService extends Filter_1.Filter {
|
|
8
|
+
constructor(data) {
|
|
9
|
+
super({ fieldName: "", value: null, filterType: FilterTypes_1.FilterTypes.Equality, caseSensitive: false, ignoreNull: true });
|
|
10
|
+
this.allowedFields = {
|
|
11
|
+
uniqueName: "string",
|
|
12
|
+
periodNumber: "string"
|
|
13
|
+
};
|
|
14
|
+
this.data = data;
|
|
15
|
+
}
|
|
16
|
+
applyFilter(data) {
|
|
17
|
+
// Implementation of applyFilter if needed
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
filterApply(filterParams) {
|
|
21
|
+
const validFilters = this.validateFilters(filterParams);
|
|
22
|
+
const filteredParams = { filters: validFilters };
|
|
23
|
+
return MainFilterService_1.MainFilterService.applyFilter(this.data, filteredParams);
|
|
24
|
+
}
|
|
25
|
+
validateFilters(filterParams) {
|
|
26
|
+
return filterParams.filters.filter(filter => {
|
|
27
|
+
const expectedType = this.allowedFields[filter.fieldName];
|
|
28
|
+
if (!expectedType)
|
|
29
|
+
return false;
|
|
30
|
+
switch (expectedType) {
|
|
31
|
+
case "string":
|
|
32
|
+
return typeof filter.value === "string" || typeof filter.value === "object";
|
|
33
|
+
default:
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
static getFilterData(filterOptions) {
|
|
39
|
+
// Create the filter data mappings with conditional dataList population
|
|
40
|
+
const fieldMappings = {
|
|
41
|
+
uniqueName: {
|
|
42
|
+
type: "dropdown",
|
|
43
|
+
attributeName: "uniqueName",
|
|
44
|
+
label: "Unique Name",
|
|
45
|
+
dataList: filterOptions && filterOptions.uniqueName ? filterOptions.uniqueName : [], // Conditional dataList
|
|
46
|
+
isMultiselect: true
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
// Return as an array
|
|
50
|
+
return Object.values(fieldMappings);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.WorkGroupDetailsFilterService = WorkGroupDetailsFilterService;
|
package/lib/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { QuickLinksController } from "./controller/twilio/QuickLinkController";
|
|
|
16
16
|
import { QualityFormsController } from "./controller/twilio/QualityFormsController";
|
|
17
17
|
import { RealTimeReportsWGDetailsController } from "./controller/twilio/RealTimeReportsWGDetailsController";
|
|
18
18
|
import { RealTimeReportsQueueDetailsController } from "./controller/twilio/RealTimeReportQueueDetailsController";
|
|
19
|
+
import { RTReportsQueueDetailsCESController } from "./controller/twilio/RTRWGQueueStatisticsCESController";
|
|
19
20
|
import { PlaybackScreenrecordingsController } from "./controller/aws/PlaybackScreenrecordings";
|
|
20
21
|
import { HoopProfilesListController } from "./controller/twilio/HoopProfilesListController";
|
|
21
22
|
import { HoopOverrideBranchesController } from "./controller/twilio/HoopOverrideBranchesController";
|
|
@@ -34,7 +35,6 @@ import { ChannelSettingsController } from "./controller/twilio/ChannelSettingsCo
|
|
|
34
35
|
import { TaskInfoPanelController } from "./controller/twilio/TaskInfoPanelController";
|
|
35
36
|
import { AgentScorecardController } from "./controller/twilio/AgentScorecardController";
|
|
36
37
|
import { AgentActionsController } from "./controller/twilio/AgentActionsController";
|
|
37
|
-
import { RealTimeReportsWGDetailsCESController } from "./controller/twilio/RealTimeReportsWGDetailsControllerCES";
|
|
38
38
|
import * as models from "./models";
|
|
39
|
-
export { DatabaseFactory, GPMController, TwilioAuthTokenConfig, SyncServiceFactory, CxConfigAssetController, CxConfigController, CallLogsController, CxConfigOtherController, CxConfigExternalNumbersController, CxConfigQueueMenuController, TwilioClient, AuditLogController, QuickLinksController, NavigationController, QualityFormsController, RealTimeReportsWGDetailsController, RealTimeReportsQueueDetailsController, PlaybackScreenrecordingsController, CxConfigUIConfigController, HoopProfilesListController, HoopOverrideBranchesController, HoopOperationsController, HoopHolidaysController, HoopPartialDaysController, HoopBusinessHoursController, CallbackAndVoicemailController, HoopMainController, HoopNotesController, HoopBusinessHoursControllerAConnect, AWSConnectAPIConfig, AWSClient, HoopServiceFactory, ChannelSettingsController, TaskInfoPanelController, AgentScorecardController, AgentActionsController,
|
|
39
|
+
export { DatabaseFactory, GPMController, TwilioAuthTokenConfig, SyncServiceFactory, CxConfigAssetController, CxConfigController, CallLogsController, CxConfigOtherController, CxConfigExternalNumbersController, CxConfigQueueMenuController, TwilioClient, AuditLogController, QuickLinksController, NavigationController, QualityFormsController, RealTimeReportsWGDetailsController, RealTimeReportsQueueDetailsController, RTReportsQueueDetailsCESController, PlaybackScreenrecordingsController, CxConfigUIConfigController, HoopProfilesListController, HoopOverrideBranchesController, HoopOperationsController, HoopHolidaysController, HoopPartialDaysController, HoopBusinessHoursController, CallbackAndVoicemailController, HoopMainController, HoopNotesController, HoopBusinessHoursControllerAConnect, AWSConnectAPIConfig, AWSClient, HoopServiceFactory, ChannelSettingsController, TaskInfoPanelController, AgentScorecardController, AgentActionsController, };
|
|
40
40
|
export { models };
|
package/lib/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.models = exports.
|
|
26
|
+
exports.models = exports.AgentActionsController = exports.AgentScorecardController = exports.TaskInfoPanelController = exports.ChannelSettingsController = exports.HoopServiceFactory = exports.AWSClient = exports.AWSConnectAPIConfig = exports.HoopBusinessHoursControllerAConnect = exports.HoopNotesController = exports.HoopMainController = exports.CallbackAndVoicemailController = exports.HoopBusinessHoursController = exports.HoopPartialDaysController = exports.HoopHolidaysController = exports.HoopOperationsController = exports.HoopOverrideBranchesController = exports.HoopProfilesListController = exports.CxConfigUIConfigController = exports.PlaybackScreenrecordingsController = exports.RTReportsQueueDetailsCESController = exports.RealTimeReportsQueueDetailsController = exports.RealTimeReportsWGDetailsController = exports.QualityFormsController = exports.NavigationController = exports.QuickLinksController = exports.AuditLogController = exports.TwilioClient = exports.CxConfigQueueMenuController = exports.CxConfigExternalNumbersController = exports.CxConfigOtherController = exports.CallLogsController = exports.CxConfigController = exports.CxConfigAssetController = exports.SyncServiceFactory = exports.TwilioAuthTokenConfig = exports.GPMController = exports.DatabaseFactory = void 0;
|
|
27
27
|
const DatabaseFactory_1 = require("./common/abstract/DatabaseFactory");
|
|
28
28
|
Object.defineProperty(exports, "DatabaseFactory", { enumerable: true, get: function () { return DatabaseFactory_1.DatabaseFactory; } });
|
|
29
29
|
const GPMController_1 = require("./controller/twilio/GPMController");
|
|
@@ -60,6 +60,8 @@ const RealTimeReportsWGDetailsController_1 = require("./controller/twilio/RealTi
|
|
|
60
60
|
Object.defineProperty(exports, "RealTimeReportsWGDetailsController", { enumerable: true, get: function () { return RealTimeReportsWGDetailsController_1.RealTimeReportsWGDetailsController; } });
|
|
61
61
|
const RealTimeReportQueueDetailsController_1 = require("./controller/twilio/RealTimeReportQueueDetailsController");
|
|
62
62
|
Object.defineProperty(exports, "RealTimeReportsQueueDetailsController", { enumerable: true, get: function () { return RealTimeReportQueueDetailsController_1.RealTimeReportsQueueDetailsController; } });
|
|
63
|
+
const RTRWGQueueStatisticsCESController_1 = require("./controller/twilio/RTRWGQueueStatisticsCESController");
|
|
64
|
+
Object.defineProperty(exports, "RTReportsQueueDetailsCESController", { enumerable: true, get: function () { return RTRWGQueueStatisticsCESController_1.RTReportsQueueDetailsCESController; } });
|
|
63
65
|
const PlaybackScreenrecordings_1 = require("./controller/aws/PlaybackScreenrecordings");
|
|
64
66
|
Object.defineProperty(exports, "PlaybackScreenrecordingsController", { enumerable: true, get: function () { return PlaybackScreenrecordings_1.PlaybackScreenrecordingsController; } });
|
|
65
67
|
const HoopProfilesListController_1 = require("./controller/twilio/HoopProfilesListController");
|
|
@@ -96,7 +98,5 @@ const AgentScorecardController_1 = require("./controller/twilio/AgentScorecardCo
|
|
|
96
98
|
Object.defineProperty(exports, "AgentScorecardController", { enumerable: true, get: function () { return AgentScorecardController_1.AgentScorecardController; } });
|
|
97
99
|
const AgentActionsController_1 = require("./controller/twilio/AgentActionsController");
|
|
98
100
|
Object.defineProperty(exports, "AgentActionsController", { enumerable: true, get: function () { return AgentActionsController_1.AgentActionsController; } });
|
|
99
|
-
const RealTimeReportsWGDetailsControllerCES_1 = require("./controller/twilio/RealTimeReportsWGDetailsControllerCES");
|
|
100
|
-
Object.defineProperty(exports, "RealTimeReportsWGDetailsCESController", { enumerable: true, get: function () { return RealTimeReportsWGDetailsControllerCES_1.RealTimeReportsWGDetailsCESController; } });
|
|
101
101
|
const models = __importStar(require("./models"));
|
|
102
102
|
exports.models = models;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseModel } from "../abstract/BaseModel";
|
|
2
|
+
import { validationMessage } from "../interface/IBaseModel";
|
|
3
|
+
/**
|
|
4
|
+
* QueuePeriodStatisticsModel
|
|
5
|
+
* -------------------------
|
|
6
|
+
* Model for storing period statistics for a queue (Sync Map Item).
|
|
7
|
+
* Used for items inside a queue-statistics Sync Map, keyed by period (e.g., p_1).
|
|
8
|
+
* Data format matches: {"_aban":0,"_answer":0,"_offer":0,"_sla_target":30,"_sum_wait_time":0,"_total_service_level":0,"_transfer_count":0}
|
|
9
|
+
*/
|
|
10
|
+
export declare class QueuePeriodStatisticsModel extends BaseModel {
|
|
11
|
+
private _aban;
|
|
12
|
+
private _answer;
|
|
13
|
+
private _offer;
|
|
14
|
+
private _sla_target;
|
|
15
|
+
private _sum_wait_time;
|
|
16
|
+
private _total_service_level;
|
|
17
|
+
private _transfer_count;
|
|
18
|
+
constructor(aban?: number, answer?: number, offer?: number, sla_target?: number, sum_wait_time?: number, total_service_level?: number, transfer_count?: number);
|
|
19
|
+
validateData(): validationMessage[];
|
|
20
|
+
get aban(): number;
|
|
21
|
+
set aban(value: number);
|
|
22
|
+
get answer(): number;
|
|
23
|
+
set answer(value: number);
|
|
24
|
+
get offer(): number;
|
|
25
|
+
set offer(value: number);
|
|
26
|
+
get sla_target(): number;
|
|
27
|
+
set sla_target(value: number);
|
|
28
|
+
get sum_wait_time(): number;
|
|
29
|
+
set sum_wait_time(value: number);
|
|
30
|
+
get total_service_level(): number;
|
|
31
|
+
set total_service_level(value: number);
|
|
32
|
+
get transfer_count(): number;
|
|
33
|
+
set transfer_count(value: number);
|
|
34
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueuePeriodStatisticsModel = void 0;
|
|
4
|
+
const BaseModel_1 = require("../abstract/BaseModel");
|
|
5
|
+
/**
|
|
6
|
+
* QueuePeriodStatisticsModel
|
|
7
|
+
* -------------------------
|
|
8
|
+
* Model for storing period statistics for a queue (Sync Map Item).
|
|
9
|
+
* Used for items inside a queue-statistics Sync Map, keyed by period (e.g., p_1).
|
|
10
|
+
* Data format matches: {"_aban":0,"_answer":0,"_offer":0,"_sla_target":30,"_sum_wait_time":0,"_total_service_level":0,"_transfer_count":0}
|
|
11
|
+
*/
|
|
12
|
+
class QueuePeriodStatisticsModel extends BaseModel_1.BaseModel {
|
|
13
|
+
constructor(aban = 0, answer = 0, offer = 0, sla_target = 30, sum_wait_time = 0, total_service_level = 0, transfer_count = 0) {
|
|
14
|
+
super();
|
|
15
|
+
this._aban = aban;
|
|
16
|
+
this._answer = answer;
|
|
17
|
+
this._offer = offer;
|
|
18
|
+
this._sla_target = sla_target;
|
|
19
|
+
this._sum_wait_time = sum_wait_time;
|
|
20
|
+
this._total_service_level = total_service_level;
|
|
21
|
+
this._transfer_count = transfer_count;
|
|
22
|
+
}
|
|
23
|
+
validateData() {
|
|
24
|
+
this.validationMessages = [];
|
|
25
|
+
// Validate all fields are integers
|
|
26
|
+
if (!Number.isInteger(this._aban)) {
|
|
27
|
+
this.validationMessages.push({
|
|
28
|
+
type: "Error",
|
|
29
|
+
fieldDescription: "aban",
|
|
30
|
+
message: "Aban must be an integer",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (!Number.isInteger(this._answer)) {
|
|
34
|
+
this.validationMessages.push({
|
|
35
|
+
type: "Error",
|
|
36
|
+
fieldDescription: "answer",
|
|
37
|
+
message: "Answer must be an integer",
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (!Number.isInteger(this._offer)) {
|
|
41
|
+
this.validationMessages.push({
|
|
42
|
+
type: "Error",
|
|
43
|
+
fieldDescription: "offer",
|
|
44
|
+
message: "Offer must be an integer",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (!Number.isInteger(this._sla_target)) {
|
|
48
|
+
this.validationMessages.push({
|
|
49
|
+
type: "Error",
|
|
50
|
+
fieldDescription: "sla_target",
|
|
51
|
+
message: "SLA Target must be an integer",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (!Number.isInteger(this._sum_wait_time)) {
|
|
55
|
+
this.validationMessages.push({
|
|
56
|
+
type: "Error",
|
|
57
|
+
fieldDescription: "sum_wait_time",
|
|
58
|
+
message: "Sum Wait Time must be an integer",
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (!Number.isInteger(this._total_service_level)) {
|
|
62
|
+
this.validationMessages.push({
|
|
63
|
+
type: "Error",
|
|
64
|
+
fieldDescription: "total_service_level",
|
|
65
|
+
message: "Total Service Level must be an integer",
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (!Number.isInteger(this._transfer_count)) {
|
|
69
|
+
this.validationMessages.push({
|
|
70
|
+
type: "Error",
|
|
71
|
+
fieldDescription: "transfer_count",
|
|
72
|
+
message: "Transfer Count must be an integer",
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return this.validationMessages;
|
|
76
|
+
}
|
|
77
|
+
// Getters and setters (plain, matching other models)
|
|
78
|
+
get aban() { return this._aban; }
|
|
79
|
+
set aban(value) { this._aban = value; }
|
|
80
|
+
get answer() { return this._answer; }
|
|
81
|
+
set answer(value) { this._answer = value; }
|
|
82
|
+
get offer() { return this._offer; }
|
|
83
|
+
set offer(value) { this._offer = value; }
|
|
84
|
+
get sla_target() { return this._sla_target; }
|
|
85
|
+
set sla_target(value) { this._sla_target = value; }
|
|
86
|
+
get sum_wait_time() { return this._sum_wait_time; }
|
|
87
|
+
set sum_wait_time(value) { this._sum_wait_time = value; }
|
|
88
|
+
get total_service_level() { return this._total_service_level; }
|
|
89
|
+
set total_service_level(value) { this._total_service_level = value; }
|
|
90
|
+
get transfer_count() { return this._transfer_count; }
|
|
91
|
+
set transfer_count(value) { this._transfer_count = value; }
|
|
92
|
+
}
|
|
93
|
+
exports.QueuePeriodStatisticsModel = QueuePeriodStatisticsModel;
|
|
@@ -2,62 +2,56 @@ import { BaseModel } from "../abstract/BaseModel";
|
|
|
2
2
|
import { validationMessage } from "../interface/IBaseModel";
|
|
3
3
|
export declare class WorkGroupDetailsModel extends BaseModel {
|
|
4
4
|
private _id;
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private _inboundAcw;
|
|
16
|
-
private _outboundAcw;
|
|
17
|
-
private _interactionWaiting;
|
|
18
|
-
private _interactionOnhold;
|
|
5
|
+
private _uniqueName;
|
|
6
|
+
private _periodNumber;
|
|
7
|
+
private _sumWaitTime;
|
|
8
|
+
private _intOffr;
|
|
9
|
+
private _intAns;
|
|
10
|
+
private _intAbn;
|
|
11
|
+
private _slaTarget;
|
|
12
|
+
private _totalServiceLevel;
|
|
13
|
+
private _transferCount;
|
|
14
|
+
private _interactionsWaiting;
|
|
19
15
|
private _longestInteractionWaiting;
|
|
20
|
-
private
|
|
16
|
+
private _totalAbanLevel;
|
|
17
|
+
private _averageSpeedAnswer;
|
|
21
18
|
private _createdAt;
|
|
22
19
|
private _updatedAt;
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
private _eventId;
|
|
21
|
+
constructor(id: string, uniqueName: string, periodNumber: string, sumWaitTime: number, intOffr: number, intAns: number, intAbn: number, slaTarget: number, totalServiceLevel: number, transferCount: number, interactionsWaiting: number, longestInteractionWaiting: number, totalAbanLevel: number, averageSpeedAnswer: number, createdAt: Date | undefined | string, updatedAt: Date | undefined | string, eventId: string);
|
|
25
22
|
get id(): string;
|
|
26
23
|
set id(value: string);
|
|
27
|
-
get
|
|
28
|
-
set
|
|
29
|
-
get
|
|
30
|
-
set
|
|
31
|
-
get
|
|
32
|
-
set
|
|
33
|
-
get
|
|
34
|
-
set
|
|
35
|
-
get
|
|
36
|
-
set
|
|
37
|
-
get
|
|
38
|
-
set
|
|
39
|
-
get
|
|
40
|
-
set
|
|
41
|
-
get
|
|
42
|
-
set
|
|
43
|
-
get
|
|
44
|
-
set
|
|
45
|
-
get
|
|
46
|
-
set
|
|
47
|
-
get
|
|
48
|
-
set
|
|
49
|
-
get
|
|
50
|
-
set
|
|
51
|
-
get
|
|
52
|
-
set
|
|
53
|
-
get
|
|
54
|
-
set
|
|
55
|
-
get
|
|
56
|
-
set
|
|
57
|
-
get
|
|
58
|
-
set
|
|
59
|
-
|
|
60
|
-
set createdAt(value: Date | undefined);
|
|
61
|
-
get updatedAt(): Date | undefined;
|
|
62
|
-
set updatedAt(value: Date | undefined);
|
|
24
|
+
get uniqueName(): string;
|
|
25
|
+
set uniqueName(value: string);
|
|
26
|
+
get periodNumber(): string;
|
|
27
|
+
set periodNumber(value: string);
|
|
28
|
+
get sumWaitTime(): number;
|
|
29
|
+
set sumWaitTime(value: number);
|
|
30
|
+
get intOffr(): number;
|
|
31
|
+
set intOffr(value: number);
|
|
32
|
+
get intAns(): number;
|
|
33
|
+
set intAns(value: number);
|
|
34
|
+
get intAbn(): number;
|
|
35
|
+
set intAbn(value: number);
|
|
36
|
+
get slaTarget(): number;
|
|
37
|
+
set slaTarget(value: number);
|
|
38
|
+
get totalServiceLevel(): number;
|
|
39
|
+
set totalServiceLevel(value: number);
|
|
40
|
+
get transferCount(): number;
|
|
41
|
+
set transferCount(value: number);
|
|
42
|
+
get interactionsWaiting(): number;
|
|
43
|
+
set interactionsWaiting(value: number);
|
|
44
|
+
get longestInteractionWaiting(): number;
|
|
45
|
+
set longestInteractionWaiting(value: number);
|
|
46
|
+
get totalAbanLevel(): number;
|
|
47
|
+
set totalAbanLevel(value: number);
|
|
48
|
+
get averageSpeedAnswer(): number;
|
|
49
|
+
set averageSpeedAnswer(value: number);
|
|
50
|
+
get createdAt(): Date | undefined | string;
|
|
51
|
+
set createdAt(value: Date | undefined | string);
|
|
52
|
+
get updatedAt(): Date | undefined | string;
|
|
53
|
+
set updatedAt(value: Date | undefined | string);
|
|
54
|
+
get eventId(): string;
|
|
55
|
+
set eventId(value: string);
|
|
56
|
+
validateData(): validationMessage[];
|
|
63
57
|
}
|
|
@@ -3,28 +3,130 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WorkGroupDetailsModel = void 0;
|
|
4
4
|
const BaseModel_1 = require("../abstract/BaseModel");
|
|
5
5
|
class WorkGroupDetailsModel extends BaseModel_1.BaseModel {
|
|
6
|
-
constructor(id,
|
|
6
|
+
constructor(id, uniqueName, periodNumber, sumWaitTime, intOffr, intAns, intAbn, slaTarget, totalServiceLevel, transferCount, interactionsWaiting, longestInteractionWaiting, totalAbanLevel, averageSpeedAnswer, createdAt, updatedAt, eventId) {
|
|
7
7
|
super();
|
|
8
8
|
this._id = id;
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this._inboundAcw = inboundAcw;
|
|
20
|
-
this._outboundAcw = outboundAcw;
|
|
21
|
-
this._interactionWaiting = interactionWaiting;
|
|
22
|
-
this._interactionOnhold = interactionOnhold;
|
|
9
|
+
this._uniqueName = uniqueName;
|
|
10
|
+
this._periodNumber = periodNumber;
|
|
11
|
+
this._sumWaitTime = sumWaitTime;
|
|
12
|
+
this._intOffr = intOffr;
|
|
13
|
+
this._intAns = intAns;
|
|
14
|
+
this._intAbn = intAbn;
|
|
15
|
+
this._slaTarget = slaTarget;
|
|
16
|
+
this._totalServiceLevel = totalServiceLevel;
|
|
17
|
+
this._transferCount = transferCount;
|
|
18
|
+
this._interactionsWaiting = interactionsWaiting;
|
|
23
19
|
this._longestInteractionWaiting = longestInteractionWaiting;
|
|
24
|
-
this.
|
|
20
|
+
this._totalAbanLevel = totalAbanLevel;
|
|
21
|
+
this._averageSpeedAnswer = averageSpeedAnswer;
|
|
25
22
|
this._createdAt = createdAt;
|
|
26
23
|
this._updatedAt = updatedAt;
|
|
24
|
+
this._eventId = eventId;
|
|
27
25
|
}
|
|
26
|
+
// Getters and Setters
|
|
27
|
+
get id() {
|
|
28
|
+
return this._id;
|
|
29
|
+
}
|
|
30
|
+
set id(value) {
|
|
31
|
+
this._id = value;
|
|
32
|
+
}
|
|
33
|
+
get uniqueName() {
|
|
34
|
+
return this._uniqueName;
|
|
35
|
+
}
|
|
36
|
+
set uniqueName(value) {
|
|
37
|
+
this._uniqueName = value;
|
|
38
|
+
}
|
|
39
|
+
get periodNumber() {
|
|
40
|
+
return this._periodNumber;
|
|
41
|
+
}
|
|
42
|
+
set periodNumber(value) {
|
|
43
|
+
this._periodNumber = value;
|
|
44
|
+
}
|
|
45
|
+
get sumWaitTime() {
|
|
46
|
+
return this._sumWaitTime;
|
|
47
|
+
}
|
|
48
|
+
set sumWaitTime(value) {
|
|
49
|
+
this._sumWaitTime = value;
|
|
50
|
+
}
|
|
51
|
+
get intOffr() {
|
|
52
|
+
return this.intOffr;
|
|
53
|
+
}
|
|
54
|
+
set intOffr(value) {
|
|
55
|
+
this.intOffr = value;
|
|
56
|
+
}
|
|
57
|
+
get intAns() {
|
|
58
|
+
return this._intAns;
|
|
59
|
+
}
|
|
60
|
+
set intAns(value) {
|
|
61
|
+
this._intAns = value;
|
|
62
|
+
}
|
|
63
|
+
get intAbn() {
|
|
64
|
+
return this._intAbn;
|
|
65
|
+
}
|
|
66
|
+
set intAbn(value) {
|
|
67
|
+
this._intAbn = value;
|
|
68
|
+
}
|
|
69
|
+
get slaTarget() {
|
|
70
|
+
return this._slaTarget;
|
|
71
|
+
}
|
|
72
|
+
set slaTarget(value) {
|
|
73
|
+
this._slaTarget = value;
|
|
74
|
+
}
|
|
75
|
+
get totalServiceLevel() {
|
|
76
|
+
return this._totalServiceLevel;
|
|
77
|
+
}
|
|
78
|
+
set totalServiceLevel(value) {
|
|
79
|
+
this._totalServiceLevel = value;
|
|
80
|
+
}
|
|
81
|
+
get transferCount() {
|
|
82
|
+
return this._transferCount;
|
|
83
|
+
}
|
|
84
|
+
set transferCount(value) {
|
|
85
|
+
this._transferCount = value;
|
|
86
|
+
}
|
|
87
|
+
get interactionsWaiting() {
|
|
88
|
+
return this._interactionsWaiting;
|
|
89
|
+
}
|
|
90
|
+
set interactionsWaiting(value) {
|
|
91
|
+
this._interactionsWaiting = value;
|
|
92
|
+
}
|
|
93
|
+
get longestInteractionWaiting() {
|
|
94
|
+
return this.longestInteractionWaiting;
|
|
95
|
+
}
|
|
96
|
+
set longestInteractionWaiting(value) {
|
|
97
|
+
this._longestInteractionWaiting = value;
|
|
98
|
+
}
|
|
99
|
+
get totalAbanLevel() {
|
|
100
|
+
return this.totalAbanLevel;
|
|
101
|
+
}
|
|
102
|
+
set totalAbanLevel(value) {
|
|
103
|
+
this._totalAbanLevel = value;
|
|
104
|
+
}
|
|
105
|
+
get averageSpeedAnswer() {
|
|
106
|
+
return this.averageSpeedAnswer;
|
|
107
|
+
}
|
|
108
|
+
set averageSpeedAnswer(value) {
|
|
109
|
+
this._averageSpeedAnswer = value;
|
|
110
|
+
}
|
|
111
|
+
get createdAt() {
|
|
112
|
+
return this._createdAt;
|
|
113
|
+
}
|
|
114
|
+
set createdAt(value) {
|
|
115
|
+
this._createdAt = value;
|
|
116
|
+
}
|
|
117
|
+
get updatedAt() {
|
|
118
|
+
return this._updatedAt;
|
|
119
|
+
}
|
|
120
|
+
set updatedAt(value) {
|
|
121
|
+
this._updatedAt = value;
|
|
122
|
+
}
|
|
123
|
+
get eventId() {
|
|
124
|
+
return this._eventId;
|
|
125
|
+
}
|
|
126
|
+
set eventId(value) {
|
|
127
|
+
this._eventId = value;
|
|
128
|
+
}
|
|
129
|
+
// Validation Method
|
|
28
130
|
validateData() {
|
|
29
131
|
this.validationMessages = [];
|
|
30
132
|
if (typeof this._id !== "string" || !this._id.trim()) {
|
|
@@ -34,248 +136,98 @@ class WorkGroupDetailsModel extends BaseModel_1.BaseModel {
|
|
|
34
136
|
message: "ID must be a non-empty string",
|
|
35
137
|
});
|
|
36
138
|
}
|
|
37
|
-
if (this.
|
|
38
|
-
this.validationMessages.push({
|
|
39
|
-
type: "Error",
|
|
40
|
-
fieldDescription: "totalAgents",
|
|
41
|
-
message: "Total agents must be a non-negative number",
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
if (this._loggedOn < 0) {
|
|
45
|
-
this.validationMessages.push({
|
|
46
|
-
type: "Error",
|
|
47
|
-
fieldDescription: "loggedOn",
|
|
48
|
-
message: "Logged on agents must be a non-negative number",
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
if (this._agentsAvailable < 0) {
|
|
52
|
-
this.validationMessages.push({
|
|
53
|
-
type: "Error",
|
|
54
|
-
fieldDescription: "agentsAvailable",
|
|
55
|
-
message: "Agents available must be a non-negative number",
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
if (this._percentAvailable < 0 || this._percentAvailable > 100) {
|
|
139
|
+
if (typeof this._uniqueName !== "string" || !this._uniqueName.trim()) {
|
|
59
140
|
this.validationMessages.push({
|
|
60
141
|
type: "Error",
|
|
61
|
-
fieldDescription: "
|
|
62
|
-
message: "
|
|
142
|
+
fieldDescription: "uniqueName",
|
|
143
|
+
message: "Unique name must be a non-empty string",
|
|
63
144
|
});
|
|
64
145
|
}
|
|
65
|
-
if (this.
|
|
146
|
+
if (typeof this._periodNumber !== "string" || !this._periodNumber.trim()) {
|
|
66
147
|
this.validationMessages.push({
|
|
67
148
|
type: "Error",
|
|
68
|
-
fieldDescription: "
|
|
69
|
-
message: "
|
|
149
|
+
fieldDescription: "periodNumber",
|
|
150
|
+
message: "Period number must be a non-empty string",
|
|
70
151
|
});
|
|
71
152
|
}
|
|
72
|
-
if (this.
|
|
153
|
+
if (typeof this._sumWaitTime !== "number" || this._sumWaitTime < 0) {
|
|
73
154
|
this.validationMessages.push({
|
|
74
155
|
type: "Error",
|
|
75
|
-
fieldDescription: "
|
|
76
|
-
message: "
|
|
156
|
+
fieldDescription: "sumWaitTime",
|
|
157
|
+
message: "sumWaitTime must be a non-negative number",
|
|
77
158
|
});
|
|
78
159
|
}
|
|
79
|
-
if (this.
|
|
160
|
+
if (typeof this._intOffr !== "number" || this.intOffr < 0) {
|
|
80
161
|
this.validationMessages.push({
|
|
81
162
|
type: "Error",
|
|
82
|
-
fieldDescription: "
|
|
83
|
-
message: "
|
|
163
|
+
fieldDescription: "intOffr",
|
|
164
|
+
message: "intOffr must be a non-negative number",
|
|
84
165
|
});
|
|
85
166
|
}
|
|
86
|
-
if (this.
|
|
167
|
+
if (typeof this._intAns !== "number" || this._intAns < 0) {
|
|
87
168
|
this.validationMessages.push({
|
|
88
169
|
type: "Error",
|
|
89
|
-
fieldDescription: "
|
|
90
|
-
message: "
|
|
170
|
+
fieldDescription: "intAns",
|
|
171
|
+
message: "intAns must be a non-negative number",
|
|
91
172
|
});
|
|
92
173
|
}
|
|
93
|
-
if (this.
|
|
174
|
+
if (typeof this._intAbn !== "number" || this._intAbn < 0) {
|
|
94
175
|
this.validationMessages.push({
|
|
95
176
|
type: "Error",
|
|
96
|
-
fieldDescription: "
|
|
97
|
-
message: "
|
|
177
|
+
fieldDescription: "intAbn",
|
|
178
|
+
message: "intAbn must be a non-negative number",
|
|
98
179
|
});
|
|
99
180
|
}
|
|
100
|
-
if (this.
|
|
181
|
+
if (typeof this._slaTarget !== "number" || this._slaTarget < 0) {
|
|
101
182
|
this.validationMessages.push({
|
|
102
183
|
type: "Error",
|
|
103
|
-
fieldDescription: "
|
|
104
|
-
message: "
|
|
184
|
+
fieldDescription: "slaTarget",
|
|
185
|
+
message: "slaTarget must be a non-negative number",
|
|
105
186
|
});
|
|
106
187
|
}
|
|
107
|
-
if (this.
|
|
188
|
+
if (typeof this._totalServiceLevel !== "number" || this._totalServiceLevel < 0) {
|
|
108
189
|
this.validationMessages.push({
|
|
109
190
|
type: "Error",
|
|
110
|
-
fieldDescription: "
|
|
111
|
-
message: "
|
|
191
|
+
fieldDescription: "totalServiceLevel",
|
|
192
|
+
message: "totalServiceLevel must be a non-negative number",
|
|
112
193
|
});
|
|
113
194
|
}
|
|
114
|
-
if (this.
|
|
195
|
+
if (typeof this._transferCount !== "number" || this._transferCount < 0) {
|
|
115
196
|
this.validationMessages.push({
|
|
116
197
|
type: "Error",
|
|
117
|
-
fieldDescription: "
|
|
118
|
-
message: "
|
|
198
|
+
fieldDescription: "transferCount",
|
|
199
|
+
message: "transferCount must be a non-negative number",
|
|
119
200
|
});
|
|
120
201
|
}
|
|
121
|
-
if (this.
|
|
202
|
+
if (typeof this._interactionsWaiting !== "number" || this._interactionsWaiting < 0) {
|
|
122
203
|
this.validationMessages.push({
|
|
123
204
|
type: "Error",
|
|
124
|
-
fieldDescription: "
|
|
125
|
-
message: "
|
|
205
|
+
fieldDescription: "interactionsWaiting",
|
|
206
|
+
message: "interactionsWaiting must be a non-negative number",
|
|
126
207
|
});
|
|
127
208
|
}
|
|
128
|
-
if (this.
|
|
129
|
-
this.validationMessages.push({
|
|
130
|
-
type: "Error",
|
|
131
|
-
fieldDescription: "interactionOnhold",
|
|
132
|
-
message: "Interaction on-hold count must be a non-negative number",
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
if (typeof this._longestInteractionWaiting !== "string" || !this._longestInteractionWaiting.trim()) {
|
|
209
|
+
if (typeof this._longestInteractionWaiting !== "number" || this._longestInteractionWaiting < 0) {
|
|
136
210
|
this.validationMessages.push({
|
|
137
211
|
type: "Error",
|
|
138
212
|
fieldDescription: "longestInteractionWaiting",
|
|
139
|
-
message: "
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
if (this._longestAvailable < 0) {
|
|
143
|
-
this.validationMessages.push({
|
|
144
|
-
type: "Error",
|
|
145
|
-
fieldDescription: "longestAvailable",
|
|
146
|
-
message: "Longest available time must be a non-negative number",
|
|
213
|
+
message: "longestInteractionWaiting must be a non-negative number",
|
|
147
214
|
});
|
|
148
215
|
}
|
|
149
|
-
if (this.
|
|
216
|
+
if (typeof this._totalAbanLevel !== "number" || this._totalAbanLevel < 0) {
|
|
150
217
|
this.validationMessages.push({
|
|
151
218
|
type: "Error",
|
|
152
|
-
fieldDescription: "
|
|
153
|
-
message: "
|
|
219
|
+
fieldDescription: "totalAbanLevel",
|
|
220
|
+
message: "totalAbanLevel must be a non-negative number",
|
|
154
221
|
});
|
|
155
222
|
}
|
|
156
|
-
if (this.
|
|
223
|
+
if (typeof this._averageSpeedAnswer !== "number" || this._averageSpeedAnswer < 0) {
|
|
157
224
|
this.validationMessages.push({
|
|
158
225
|
type: "Error",
|
|
159
|
-
fieldDescription: "
|
|
160
|
-
message: "
|
|
226
|
+
fieldDescription: "averageSpeedAnswer",
|
|
227
|
+
message: "averageSpeedAnswer must be a non-negative number",
|
|
161
228
|
});
|
|
162
229
|
}
|
|
163
230
|
return this.validationMessages;
|
|
164
231
|
}
|
|
165
|
-
// Getters and setters for all fields
|
|
166
|
-
get id() {
|
|
167
|
-
return this._id;
|
|
168
|
-
}
|
|
169
|
-
set id(value) {
|
|
170
|
-
this._id = value;
|
|
171
|
-
}
|
|
172
|
-
get totalAgents() {
|
|
173
|
-
return this._totalAgents;
|
|
174
|
-
}
|
|
175
|
-
set totalAgents(value) {
|
|
176
|
-
this._totalAgents = value;
|
|
177
|
-
}
|
|
178
|
-
get loggedOn() {
|
|
179
|
-
return this._loggedOn;
|
|
180
|
-
}
|
|
181
|
-
set loggedOn(value) {
|
|
182
|
-
this._loggedOn = value;
|
|
183
|
-
}
|
|
184
|
-
get agentsAvailable() {
|
|
185
|
-
return this._agentsAvailable;
|
|
186
|
-
}
|
|
187
|
-
set agentsAvailable(value) {
|
|
188
|
-
this._agentsAvailable = value;
|
|
189
|
-
}
|
|
190
|
-
get percentAvailable() {
|
|
191
|
-
return this._percentAvailable;
|
|
192
|
-
}
|
|
193
|
-
set percentAvailable(value) {
|
|
194
|
-
this._percentAvailable = value;
|
|
195
|
-
}
|
|
196
|
-
get agentsAvailableToTakeCalls() {
|
|
197
|
-
return this._agentsAvailableToTakeCalls;
|
|
198
|
-
}
|
|
199
|
-
set agentsAvailableToTakeCalls(value) {
|
|
200
|
-
this._agentsAvailableToTakeCalls = value;
|
|
201
|
-
}
|
|
202
|
-
get nonAcdInteractions() {
|
|
203
|
-
return this._nonAcdInteractions;
|
|
204
|
-
}
|
|
205
|
-
set nonAcdInteractions(value) {
|
|
206
|
-
this._nonAcdInteractions = value;
|
|
207
|
-
}
|
|
208
|
-
get availableForAcdInteractions() {
|
|
209
|
-
return this._availableForAcdInteractions;
|
|
210
|
-
}
|
|
211
|
-
set availableForAcdInteractions(value) {
|
|
212
|
-
this._availableForAcdInteractions = value;
|
|
213
|
-
}
|
|
214
|
-
get notAvailableForAcdInteractions() {
|
|
215
|
-
return this._notAvailableForAcdInteractions;
|
|
216
|
-
}
|
|
217
|
-
set notAvailableForAcdInteractions(value) {
|
|
218
|
-
this._notAvailableForAcdInteractions = value;
|
|
219
|
-
}
|
|
220
|
-
get inboundAcdInteractions() {
|
|
221
|
-
return this._inboundAcdInteractions;
|
|
222
|
-
}
|
|
223
|
-
set inboundAcdInteractions(value) {
|
|
224
|
-
this._inboundAcdInteractions = value;
|
|
225
|
-
}
|
|
226
|
-
get outboundAcdInteractions() {
|
|
227
|
-
return this._outboundAcdInteractions;
|
|
228
|
-
}
|
|
229
|
-
set outboundAcdInteractions(value) {
|
|
230
|
-
this._outboundAcdInteractions = value;
|
|
231
|
-
}
|
|
232
|
-
get inboundAcw() {
|
|
233
|
-
return this._inboundAcw;
|
|
234
|
-
}
|
|
235
|
-
set inboundAcw(value) {
|
|
236
|
-
this._inboundAcw = value;
|
|
237
|
-
}
|
|
238
|
-
get outboundAcw() {
|
|
239
|
-
return this._outboundAcw;
|
|
240
|
-
}
|
|
241
|
-
set outboundAcw(value) {
|
|
242
|
-
this._outboundAcw = value;
|
|
243
|
-
}
|
|
244
|
-
get interactionWaiting() {
|
|
245
|
-
return this._interactionWaiting;
|
|
246
|
-
}
|
|
247
|
-
set interactionWaiting(value) {
|
|
248
|
-
this._interactionWaiting = value;
|
|
249
|
-
}
|
|
250
|
-
get interactionOnhold() {
|
|
251
|
-
return this._interactionOnhold;
|
|
252
|
-
}
|
|
253
|
-
set interactionOnhold(value) {
|
|
254
|
-
this._interactionOnhold = value;
|
|
255
|
-
}
|
|
256
|
-
get longestInteractionWaiting() {
|
|
257
|
-
return this._longestInteractionWaiting;
|
|
258
|
-
}
|
|
259
|
-
set longestInteractionWaiting(value) {
|
|
260
|
-
this._longestInteractionWaiting = value;
|
|
261
|
-
}
|
|
262
|
-
get longestAvailable() {
|
|
263
|
-
return this._longestAvailable;
|
|
264
|
-
}
|
|
265
|
-
set longestAvailable(value) {
|
|
266
|
-
this._longestAvailable = value;
|
|
267
|
-
}
|
|
268
|
-
get createdAt() {
|
|
269
|
-
return this._createdAt;
|
|
270
|
-
}
|
|
271
|
-
set createdAt(value) {
|
|
272
|
-
this._createdAt = value;
|
|
273
|
-
}
|
|
274
|
-
get updatedAt() {
|
|
275
|
-
return this._updatedAt;
|
|
276
|
-
}
|
|
277
|
-
set updatedAt(value) {
|
|
278
|
-
this._updatedAt = value;
|
|
279
|
-
}
|
|
280
232
|
}
|
|
281
233
|
exports.WorkGroupDetailsModel = WorkGroupDetailsModel;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseModel } from "../abstract/BaseModel";
|
|
2
|
+
import { validationMessage } from "../interface/IBaseModel";
|
|
3
|
+
/**
|
|
4
|
+
* WorkGroupQueueStatisticsModel
|
|
5
|
+
* ----------------------------
|
|
6
|
+
* Model for validating Sync Map names for queue statistics.
|
|
7
|
+
* Ensures the name matches the format: <QUEUE>_queue-statistics_<DATE>
|
|
8
|
+
*/
|
|
9
|
+
export declare class WorkGroupQueueStatisticsModel extends BaseModel {
|
|
10
|
+
validateData(): validationMessage[];
|
|
11
|
+
/**
|
|
12
|
+
* Validates a table name against the required sync map pattern.
|
|
13
|
+
* Pattern: <QUEUE>_queue-statistics_<DATE> (e.g., RONA_queue-statistics_19072025)
|
|
14
|
+
*/
|
|
15
|
+
static validateTableName(tableName: string): validationMessage[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkGroupQueueStatisticsModel = void 0;
|
|
4
|
+
const BaseModel_1 = require("../abstract/BaseModel");
|
|
5
|
+
/**
|
|
6
|
+
* WorkGroupQueueStatisticsModel
|
|
7
|
+
* ----------------------------
|
|
8
|
+
* Model for validating Sync Map names for queue statistics.
|
|
9
|
+
* Ensures the name matches the format: <QUEUE>_queue-statistics_<DATE>
|
|
10
|
+
*/
|
|
11
|
+
class WorkGroupQueueStatisticsModel extends BaseModel_1.BaseModel {
|
|
12
|
+
validateData() {
|
|
13
|
+
throw new Error("Method not implemented.");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Validates a table name against the required sync map pattern.
|
|
17
|
+
* Pattern: <QUEUE>_queue-statistics_<DATE> (e.g., RONA_queue-statistics_19072025)
|
|
18
|
+
*/
|
|
19
|
+
static validateTableName(tableName) {
|
|
20
|
+
const regex = /^[A-Z0-9_]+_queue-statistics_\d{8}$/i;
|
|
21
|
+
const messages = [];
|
|
22
|
+
if (!regex.test(tableName)) {
|
|
23
|
+
messages.push({
|
|
24
|
+
type: "Error",
|
|
25
|
+
fieldDescription: "tableName",
|
|
26
|
+
message: "Table name must match the format <QUEUE>_queue-statistics_<DATE> (e.g., TEST_queue-statistics_19072025)",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return messages;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.WorkGroupQueueStatisticsModel = WorkGroupQueueStatisticsModel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkGroupDetailsAllowedFields = void 0;
|
|
4
|
+
var WorkGroupDetailsAllowedFields;
|
|
5
|
+
(function (WorkGroupDetailsAllowedFields) {
|
|
6
|
+
WorkGroupDetailsAllowedFields[WorkGroupDetailsAllowedFields["uniqueName"] = 0] = "uniqueName";
|
|
7
|
+
})(WorkGroupDetailsAllowedFields || (exports.WorkGroupDetailsAllowedFields = WorkGroupDetailsAllowedFields = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hgs-twilio-class-lib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.67",
|
|
4
4
|
"description": "Flex 2.0 backend to connect with any database ",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@types/express": "4.17.21",
|
|
31
31
|
"@types/node": "20.11.17",
|
|
32
32
|
"@types/uuid": "9.0.8",
|
|
33
|
+
"concurrently": "^9.2.0",
|
|
33
34
|
"esbuild": "^0.25.4",
|
|
34
35
|
"express": "^4.18.2",
|
|
35
36
|
"fast-glob": "^3.3.3",
|