@oneuptime/common 9.3.22 → 9.4.0
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/Models/DatabaseModels/IncomingCallLog.ts +521 -0
- package/Models/DatabaseModels/IncomingCallLogItem.ts +463 -0
- package/Models/DatabaseModels/IncomingCallPolicy.ts +811 -0
- package/Models/DatabaseModels/IncomingCallPolicyEscalationRule.ts +597 -0
- package/Models/DatabaseModels/Index.ts +18 -0
- package/Models/DatabaseModels/ProjectSCIMLog.ts +422 -0
- package/Models/DatabaseModels/StatusPageSCIMLog.ts +455 -0
- package/Models/DatabaseModels/User.ts +0 -15
- package/Models/DatabaseModels/UserIncomingCallNumber.ts +296 -0
- package/Server/API/UserIncomingCallNumberAPI.ts +128 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1768583966447-MigrationName.ts +121 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1768647802022-RemoveAlertPhoneNumberFromUser.ts +22 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1768649699509-MigrationName.ts +787 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1768682071562-MigrationName.ts +29 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Services/IncomingCallLogItemService.ts +10 -0
- package/Server/Services/IncomingCallLogService.ts +10 -0
- package/Server/Services/IncomingCallPolicyEscalationRuleService.ts +267 -0
- package/Server/Services/IncomingCallPolicyService.ts +10 -0
- package/Server/Services/Index.ts +7 -0
- package/Server/Services/ProjectSCIMLogService.ts +11 -0
- package/Server/Services/StatusPageSCIMLogService.ts +11 -0
- package/Server/Services/UserCallService.ts +31 -0
- package/Server/Services/UserIncomingCallNumberService.ts +258 -0
- package/Server/Services/UserSmsService.ts +31 -0
- package/Server/Utils/StartServer.ts +5 -0
- package/Types/Call/CallProvider.ts +99 -0
- package/Types/Call/CallProviderType.ts +6 -0
- package/Types/Icon/IconProp.ts +1 -0
- package/Types/IncomingCall/IncomingCallStatus.ts +13 -0
- package/Types/Permission.ts +126 -0
- package/Types/Phone.ts +53 -4
- package/Types/SCIM/SCIMLogStatus.ts +7 -0
- package/UI/Components/Diagram/ConceptCards.tsx +74 -0
- package/UI/Components/Diagram/HorizontalStepChain.tsx +92 -0
- package/UI/Components/Diagram/Index.ts +11 -0
- package/UI/Components/Diagram/NumberedSteps.tsx +77 -0
- package/UI/Components/Diagram/VerticalFlowSteps.tsx +59 -0
- package/UI/Components/Icon/Icon.tsx +10 -0
- package/UI/Components/SimpleLogViewer/SimpleLogViewer.tsx +86 -2
- package/build/dist/Models/DatabaseModels/IncomingCallLog.js +565 -0
- package/build/dist/Models/DatabaseModels/IncomingCallLog.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncomingCallLogItem.js +497 -0
- package/build/dist/Models/DatabaseModels/IncomingCallLogItem.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncomingCallPolicy.js +840 -0
- package/build/dist/Models/DatabaseModels/IncomingCallPolicy.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncomingCallPolicyEscalationRule.js +619 -0
- package/build/dist/Models/DatabaseModels/IncomingCallPolicyEscalationRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Index.js +16 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProjectSCIMLog.js +455 -0
- package/build/dist/Models/DatabaseModels/ProjectSCIMLog.js.map +1 -0
- package/build/dist/Models/DatabaseModels/StatusPageSCIMLog.js +486 -0
- package/build/dist/Models/DatabaseModels/StatusPageSCIMLog.js.map +1 -0
- package/build/dist/Models/DatabaseModels/User.js +0 -16
- package/build/dist/Models/DatabaseModels/User.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserIncomingCallNumber.js +315 -0
- package/build/dist/Models/DatabaseModels/UserIncomingCallNumber.js.map +1 -0
- package/build/dist/Server/API/UserIncomingCallNumberAPI.js +72 -0
- package/build/dist/Server/API/UserIncomingCallNumberAPI.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768583966447-MigrationName.js +48 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768583966447-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768647802022-RemoveAlertPhoneNumberFromUser.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768647802022-RemoveAlertPhoneNumberFromUser.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768649699509-MigrationName.js +270 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768649699509-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768682071562-MigrationName.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1768682071562-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/IncomingCallLogItemService.js +9 -0
- package/build/dist/Server/Services/IncomingCallLogItemService.js.map +1 -0
- package/build/dist/Server/Services/IncomingCallLogService.js +9 -0
- package/build/dist/Server/Services/IncomingCallLogService.js.map +1 -0
- package/build/dist/Server/Services/IncomingCallPolicyEscalationRuleService.js +197 -0
- package/build/dist/Server/Services/IncomingCallPolicyEscalationRuleService.js.map +1 -0
- package/build/dist/Server/Services/IncomingCallPolicyService.js +9 -0
- package/build/dist/Server/Services/IncomingCallPolicyService.js.map +1 -0
- package/build/dist/Server/Services/Index.js +6 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/ProjectSCIMLogService.js +10 -0
- package/build/dist/Server/Services/ProjectSCIMLogService.js.map +1 -0
- package/build/dist/Server/Services/StatusPageSCIMLogService.js +10 -0
- package/build/dist/Server/Services/StatusPageSCIMLogService.js.map +1 -0
- package/build/dist/Server/Services/UserCallService.js +21 -0
- package/build/dist/Server/Services/UserCallService.js.map +1 -1
- package/build/dist/Server/Services/UserIncomingCallNumberService.js +225 -0
- package/build/dist/Server/Services/UserIncomingCallNumberService.js.map +1 -0
- package/build/dist/Server/Services/UserSmsService.js +21 -0
- package/build/dist/Server/Services/UserSmsService.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +5 -0
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Types/Call/CallProvider.js +2 -0
- package/build/dist/Types/Call/CallProvider.js.map +1 -0
- package/build/dist/Types/Call/CallProviderType.js +7 -0
- package/build/dist/Types/Call/CallProviderType.js.map +1 -0
- package/build/dist/Types/Icon/IconProp.js +1 -0
- package/build/dist/Types/Icon/IconProp.js.map +1 -1
- package/build/dist/Types/IncomingCall/IncomingCallStatus.js +14 -0
- package/build/dist/Types/IncomingCall/IncomingCallStatus.js.map +1 -0
- package/build/dist/Types/Permission.js +104 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Phone.js +47 -3
- package/build/dist/Types/Phone.js.map +1 -1
- package/build/dist/Types/SCIM/SCIMLogStatus.js +8 -0
- package/build/dist/Types/SCIM/SCIMLogStatus.js.map +1 -0
- package/build/dist/UI/Components/Diagram/ConceptCards.js +30 -0
- package/build/dist/UI/Components/Diagram/ConceptCards.js.map +1 -0
- package/build/dist/UI/Components/Diagram/HorizontalStepChain.js +30 -0
- package/build/dist/UI/Components/Diagram/HorizontalStepChain.js.map +1 -0
- package/build/dist/UI/Components/Diagram/Index.js +5 -0
- package/build/dist/UI/Components/Diagram/Index.js.map +1 -0
- package/build/dist/UI/Components/Diagram/NumberedSteps.js +18 -0
- package/build/dist/UI/Components/Diagram/NumberedSteps.js.map +1 -0
- package/build/dist/UI/Components/Diagram/VerticalFlowSteps.js +16 -0
- package/build/dist/UI/Components/Diagram/VerticalFlowSteps.js.map +1 -0
- package/build/dist/UI/Components/Icon/Icon.js +4 -0
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js +30 -1
- package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
import IncomingCallPolicy from "./IncomingCallPolicy";
|
|
2
|
+
import Project from "./Project";
|
|
3
|
+
import User from "./User";
|
|
4
|
+
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
|
|
5
|
+
import Route from "../../Types/API/Route";
|
|
6
|
+
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
|
|
7
|
+
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
|
|
8
|
+
import ColumnLength from "../../Types/Database/ColumnLength";
|
|
9
|
+
import ColumnType from "../../Types/Database/ColumnType";
|
|
10
|
+
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
|
|
11
|
+
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
|
|
12
|
+
import TableColumn from "../../Types/Database/TableColumn";
|
|
13
|
+
import TableColumnType from "../../Types/Database/TableColumnType";
|
|
14
|
+
import TableMetadata from "../../Types/Database/TableMetadata";
|
|
15
|
+
import TenantColumn from "../../Types/Database/TenantColumn";
|
|
16
|
+
import IconProp from "../../Types/Icon/IconProp";
|
|
17
|
+
import IncomingCallStatus from "../../Types/IncomingCall/IncomingCallStatus";
|
|
18
|
+
import ObjectID from "../../Types/ObjectID";
|
|
19
|
+
import Permission from "../../Types/Permission";
|
|
20
|
+
import Phone from "../../Types/Phone";
|
|
21
|
+
import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
|
|
22
|
+
|
|
23
|
+
@EnableDocumentation()
|
|
24
|
+
@TenantColumn("projectId")
|
|
25
|
+
@TableAccessControl({
|
|
26
|
+
create: [],
|
|
27
|
+
read: [
|
|
28
|
+
Permission.ProjectOwner,
|
|
29
|
+
Permission.ProjectAdmin,
|
|
30
|
+
Permission.ProjectMember,
|
|
31
|
+
Permission.ReadProjectIncomingCallLog,
|
|
32
|
+
],
|
|
33
|
+
delete: [],
|
|
34
|
+
update: [],
|
|
35
|
+
})
|
|
36
|
+
@CrudApiEndpoint(new Route("/incoming-call-log"))
|
|
37
|
+
@Entity({
|
|
38
|
+
name: "IncomingCallLog",
|
|
39
|
+
})
|
|
40
|
+
@TableMetadata({
|
|
41
|
+
tableName: "IncomingCallLog",
|
|
42
|
+
singularName: "Incoming Call Log",
|
|
43
|
+
pluralName: "Incoming Call Logs",
|
|
44
|
+
icon: IconProp.Call,
|
|
45
|
+
tableDescription:
|
|
46
|
+
"Parent log for each incoming call instance. Groups all escalation attempts together.",
|
|
47
|
+
})
|
|
48
|
+
export default class IncomingCallLog extends BaseModel {
|
|
49
|
+
@ColumnAccessControl({
|
|
50
|
+
create: [],
|
|
51
|
+
read: [
|
|
52
|
+
Permission.ProjectOwner,
|
|
53
|
+
Permission.ProjectAdmin,
|
|
54
|
+
Permission.ProjectMember,
|
|
55
|
+
Permission.ReadProjectIncomingCallLog,
|
|
56
|
+
],
|
|
57
|
+
update: [],
|
|
58
|
+
})
|
|
59
|
+
@TableColumn({
|
|
60
|
+
manyToOneRelationColumn: "projectId",
|
|
61
|
+
type: TableColumnType.Entity,
|
|
62
|
+
modelType: Project,
|
|
63
|
+
title: "Project",
|
|
64
|
+
description: "Relation to Project Resource in which this object belongs",
|
|
65
|
+
})
|
|
66
|
+
@ManyToOne(
|
|
67
|
+
() => {
|
|
68
|
+
return Project;
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
eager: false,
|
|
72
|
+
nullable: true,
|
|
73
|
+
onDelete: "CASCADE",
|
|
74
|
+
orphanedRowAction: "nullify",
|
|
75
|
+
},
|
|
76
|
+
)
|
|
77
|
+
@JoinColumn({ name: "projectId" })
|
|
78
|
+
public project?: Project = undefined;
|
|
79
|
+
|
|
80
|
+
@ColumnAccessControl({
|
|
81
|
+
create: [],
|
|
82
|
+
read: [
|
|
83
|
+
Permission.ProjectOwner,
|
|
84
|
+
Permission.ProjectAdmin,
|
|
85
|
+
Permission.ProjectMember,
|
|
86
|
+
Permission.ReadProjectIncomingCallLog,
|
|
87
|
+
],
|
|
88
|
+
update: [],
|
|
89
|
+
})
|
|
90
|
+
@Index()
|
|
91
|
+
@TableColumn({
|
|
92
|
+
type: TableColumnType.ObjectID,
|
|
93
|
+
required: true,
|
|
94
|
+
canReadOnRelationQuery: true,
|
|
95
|
+
title: "Project ID",
|
|
96
|
+
description: "ID of your OneUptime Project in which this object belongs",
|
|
97
|
+
})
|
|
98
|
+
@Column({
|
|
99
|
+
type: ColumnType.ObjectID,
|
|
100
|
+
nullable: false,
|
|
101
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
102
|
+
})
|
|
103
|
+
public projectId?: ObjectID = undefined;
|
|
104
|
+
|
|
105
|
+
@ColumnAccessControl({
|
|
106
|
+
create: [],
|
|
107
|
+
read: [
|
|
108
|
+
Permission.ProjectOwner,
|
|
109
|
+
Permission.ProjectAdmin,
|
|
110
|
+
Permission.ProjectMember,
|
|
111
|
+
Permission.ReadProjectIncomingCallLog,
|
|
112
|
+
],
|
|
113
|
+
update: [],
|
|
114
|
+
})
|
|
115
|
+
@TableColumn({
|
|
116
|
+
manyToOneRelationColumn: "incomingCallPolicyId",
|
|
117
|
+
type: TableColumnType.Entity,
|
|
118
|
+
modelType: IncomingCallPolicy,
|
|
119
|
+
title: "Incoming Call Policy",
|
|
120
|
+
description: "Relation to the Incoming Call Policy",
|
|
121
|
+
})
|
|
122
|
+
@ManyToOne(
|
|
123
|
+
() => {
|
|
124
|
+
return IncomingCallPolicy;
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
eager: false,
|
|
128
|
+
nullable: true,
|
|
129
|
+
onDelete: "CASCADE",
|
|
130
|
+
orphanedRowAction: "nullify",
|
|
131
|
+
},
|
|
132
|
+
)
|
|
133
|
+
@JoinColumn({ name: "incomingCallPolicyId" })
|
|
134
|
+
public incomingCallPolicy?: IncomingCallPolicy = undefined;
|
|
135
|
+
|
|
136
|
+
@ColumnAccessControl({
|
|
137
|
+
create: [],
|
|
138
|
+
read: [
|
|
139
|
+
Permission.ProjectOwner,
|
|
140
|
+
Permission.ProjectAdmin,
|
|
141
|
+
Permission.ProjectMember,
|
|
142
|
+
Permission.ReadProjectIncomingCallLog,
|
|
143
|
+
],
|
|
144
|
+
update: [],
|
|
145
|
+
})
|
|
146
|
+
@Index()
|
|
147
|
+
@TableColumn({
|
|
148
|
+
type: TableColumnType.ObjectID,
|
|
149
|
+
required: true,
|
|
150
|
+
canReadOnRelationQuery: true,
|
|
151
|
+
title: "Incoming Call Policy ID",
|
|
152
|
+
description: "ID of the Incoming Call Policy",
|
|
153
|
+
})
|
|
154
|
+
@Column({
|
|
155
|
+
type: ColumnType.ObjectID,
|
|
156
|
+
nullable: false,
|
|
157
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
158
|
+
})
|
|
159
|
+
public incomingCallPolicyId?: ObjectID = undefined;
|
|
160
|
+
|
|
161
|
+
@ColumnAccessControl({
|
|
162
|
+
create: [],
|
|
163
|
+
read: [
|
|
164
|
+
Permission.ProjectOwner,
|
|
165
|
+
Permission.ProjectAdmin,
|
|
166
|
+
Permission.ProjectMember,
|
|
167
|
+
Permission.ReadProjectIncomingCallLog,
|
|
168
|
+
],
|
|
169
|
+
update: [],
|
|
170
|
+
})
|
|
171
|
+
@TableColumn({
|
|
172
|
+
required: false,
|
|
173
|
+
type: TableColumnType.Phone,
|
|
174
|
+
title: "Caller Phone Number",
|
|
175
|
+
description: "Incoming caller's phone number",
|
|
176
|
+
canReadOnRelationQuery: true,
|
|
177
|
+
})
|
|
178
|
+
@Column({
|
|
179
|
+
nullable: true,
|
|
180
|
+
type: ColumnType.Phone,
|
|
181
|
+
length: ColumnLength.Phone,
|
|
182
|
+
transformer: Phone.getDatabaseTransformer(),
|
|
183
|
+
})
|
|
184
|
+
public callerPhoneNumber?: Phone = undefined;
|
|
185
|
+
|
|
186
|
+
@ColumnAccessControl({
|
|
187
|
+
create: [],
|
|
188
|
+
read: [
|
|
189
|
+
Permission.ProjectOwner,
|
|
190
|
+
Permission.ProjectAdmin,
|
|
191
|
+
Permission.ProjectMember,
|
|
192
|
+
Permission.ReadProjectIncomingCallLog,
|
|
193
|
+
],
|
|
194
|
+
update: [],
|
|
195
|
+
})
|
|
196
|
+
@TableColumn({
|
|
197
|
+
required: false,
|
|
198
|
+
type: TableColumnType.Phone,
|
|
199
|
+
title: "Routing Phone Number",
|
|
200
|
+
description: "The routing number that was called",
|
|
201
|
+
canReadOnRelationQuery: true,
|
|
202
|
+
})
|
|
203
|
+
@Column({
|
|
204
|
+
nullable: true,
|
|
205
|
+
type: ColumnType.Phone,
|
|
206
|
+
length: ColumnLength.Phone,
|
|
207
|
+
transformer: Phone.getDatabaseTransformer(),
|
|
208
|
+
})
|
|
209
|
+
public routingPhoneNumber?: Phone = undefined;
|
|
210
|
+
|
|
211
|
+
@ColumnAccessControl({
|
|
212
|
+
create: [],
|
|
213
|
+
read: [
|
|
214
|
+
Permission.ProjectOwner,
|
|
215
|
+
Permission.ProjectAdmin,
|
|
216
|
+
Permission.ProjectMember,
|
|
217
|
+
Permission.ReadProjectIncomingCallLog,
|
|
218
|
+
],
|
|
219
|
+
update: [],
|
|
220
|
+
})
|
|
221
|
+
@Index()
|
|
222
|
+
@TableColumn({
|
|
223
|
+
required: false,
|
|
224
|
+
type: TableColumnType.ShortText,
|
|
225
|
+
title: "Call Provider Call ID",
|
|
226
|
+
description: "Call provider's call identifier",
|
|
227
|
+
})
|
|
228
|
+
@Column({
|
|
229
|
+
nullable: true,
|
|
230
|
+
type: ColumnType.ShortText,
|
|
231
|
+
length: ColumnLength.ShortText,
|
|
232
|
+
})
|
|
233
|
+
public callProviderCallId?: string = undefined;
|
|
234
|
+
|
|
235
|
+
@ColumnAccessControl({
|
|
236
|
+
create: [],
|
|
237
|
+
read: [
|
|
238
|
+
Permission.ProjectOwner,
|
|
239
|
+
Permission.ProjectAdmin,
|
|
240
|
+
Permission.ProjectMember,
|
|
241
|
+
Permission.ReadProjectIncomingCallLog,
|
|
242
|
+
],
|
|
243
|
+
update: [],
|
|
244
|
+
})
|
|
245
|
+
@Index()
|
|
246
|
+
@TableColumn({
|
|
247
|
+
required: true,
|
|
248
|
+
type: TableColumnType.ShortText,
|
|
249
|
+
title: "Status",
|
|
250
|
+
description: "Current status of the incoming call",
|
|
251
|
+
canReadOnRelationQuery: true,
|
|
252
|
+
})
|
|
253
|
+
@Column({
|
|
254
|
+
nullable: false,
|
|
255
|
+
type: ColumnType.ShortText,
|
|
256
|
+
length: ColumnLength.ShortText,
|
|
257
|
+
default: IncomingCallStatus.Initiated,
|
|
258
|
+
})
|
|
259
|
+
public status?: IncomingCallStatus = undefined;
|
|
260
|
+
|
|
261
|
+
@ColumnAccessControl({
|
|
262
|
+
create: [],
|
|
263
|
+
read: [
|
|
264
|
+
Permission.ProjectOwner,
|
|
265
|
+
Permission.ProjectAdmin,
|
|
266
|
+
Permission.ProjectMember,
|
|
267
|
+
Permission.ReadProjectIncomingCallLog,
|
|
268
|
+
],
|
|
269
|
+
update: [],
|
|
270
|
+
})
|
|
271
|
+
@TableColumn({
|
|
272
|
+
required: false,
|
|
273
|
+
type: TableColumnType.LongText,
|
|
274
|
+
title: "Status Message",
|
|
275
|
+
description: "Additional status information",
|
|
276
|
+
})
|
|
277
|
+
@Column({
|
|
278
|
+
nullable: true,
|
|
279
|
+
type: ColumnType.LongText,
|
|
280
|
+
length: ColumnLength.LongText,
|
|
281
|
+
})
|
|
282
|
+
public statusMessage?: string = undefined;
|
|
283
|
+
|
|
284
|
+
@ColumnAccessControl({
|
|
285
|
+
create: [],
|
|
286
|
+
read: [
|
|
287
|
+
Permission.ProjectOwner,
|
|
288
|
+
Permission.ProjectAdmin,
|
|
289
|
+
Permission.ProjectMember,
|
|
290
|
+
Permission.ReadProjectIncomingCallLog,
|
|
291
|
+
],
|
|
292
|
+
update: [],
|
|
293
|
+
})
|
|
294
|
+
@TableColumn({
|
|
295
|
+
required: false,
|
|
296
|
+
type: TableColumnType.Number,
|
|
297
|
+
title: "Call Duration (Seconds)",
|
|
298
|
+
description: "Total call duration in seconds",
|
|
299
|
+
canReadOnRelationQuery: true,
|
|
300
|
+
})
|
|
301
|
+
@Column({
|
|
302
|
+
nullable: true,
|
|
303
|
+
type: ColumnType.Number,
|
|
304
|
+
default: 0,
|
|
305
|
+
})
|
|
306
|
+
public callDurationInSeconds?: number = undefined;
|
|
307
|
+
|
|
308
|
+
@ColumnAccessControl({
|
|
309
|
+
create: [],
|
|
310
|
+
read: [
|
|
311
|
+
Permission.ProjectOwner,
|
|
312
|
+
Permission.ProjectAdmin,
|
|
313
|
+
Permission.ProjectMember,
|
|
314
|
+
Permission.ReadProjectIncomingCallLog,
|
|
315
|
+
],
|
|
316
|
+
update: [],
|
|
317
|
+
})
|
|
318
|
+
@TableColumn({
|
|
319
|
+
required: false,
|
|
320
|
+
type: TableColumnType.Number,
|
|
321
|
+
title: "Call Cost (USD Cents)",
|
|
322
|
+
description: "Total cost for this call in USD cents",
|
|
323
|
+
})
|
|
324
|
+
@Column({
|
|
325
|
+
nullable: true,
|
|
326
|
+
type: ColumnType.Number,
|
|
327
|
+
default: 0,
|
|
328
|
+
})
|
|
329
|
+
public callCostInUSDCents?: number = undefined;
|
|
330
|
+
|
|
331
|
+
@ColumnAccessControl({
|
|
332
|
+
create: [],
|
|
333
|
+
read: [
|
|
334
|
+
Permission.ProjectOwner,
|
|
335
|
+
Permission.ProjectAdmin,
|
|
336
|
+
Permission.ProjectMember,
|
|
337
|
+
Permission.ReadProjectIncomingCallLog,
|
|
338
|
+
],
|
|
339
|
+
update: [],
|
|
340
|
+
})
|
|
341
|
+
@TableColumn({
|
|
342
|
+
required: false,
|
|
343
|
+
type: TableColumnType.Number,
|
|
344
|
+
title: "Incoming Call Cost (USD Cents)",
|
|
345
|
+
description: "Cost for incoming leg in USD cents",
|
|
346
|
+
})
|
|
347
|
+
@Column({
|
|
348
|
+
nullable: true,
|
|
349
|
+
type: ColumnType.Number,
|
|
350
|
+
default: 0,
|
|
351
|
+
})
|
|
352
|
+
public incomingCallCostInUSDCents?: number = undefined;
|
|
353
|
+
|
|
354
|
+
@ColumnAccessControl({
|
|
355
|
+
create: [],
|
|
356
|
+
read: [
|
|
357
|
+
Permission.ProjectOwner,
|
|
358
|
+
Permission.ProjectAdmin,
|
|
359
|
+
Permission.ProjectMember,
|
|
360
|
+
Permission.ReadProjectIncomingCallLog,
|
|
361
|
+
],
|
|
362
|
+
update: [],
|
|
363
|
+
})
|
|
364
|
+
@TableColumn({
|
|
365
|
+
required: false,
|
|
366
|
+
type: TableColumnType.Number,
|
|
367
|
+
title: "Outgoing Call Cost (USD Cents)",
|
|
368
|
+
description: "Cost for all forwarding attempts in USD cents",
|
|
369
|
+
})
|
|
370
|
+
@Column({
|
|
371
|
+
nullable: true,
|
|
372
|
+
type: ColumnType.Number,
|
|
373
|
+
default: 0,
|
|
374
|
+
})
|
|
375
|
+
public outgoingCallCostInUSDCents?: number = undefined;
|
|
376
|
+
|
|
377
|
+
@ColumnAccessControl({
|
|
378
|
+
create: [],
|
|
379
|
+
read: [
|
|
380
|
+
Permission.ProjectOwner,
|
|
381
|
+
Permission.ProjectAdmin,
|
|
382
|
+
Permission.ProjectMember,
|
|
383
|
+
Permission.ReadProjectIncomingCallLog,
|
|
384
|
+
],
|
|
385
|
+
update: [],
|
|
386
|
+
})
|
|
387
|
+
@Index()
|
|
388
|
+
@TableColumn({
|
|
389
|
+
required: false,
|
|
390
|
+
type: TableColumnType.Date,
|
|
391
|
+
title: "Started At",
|
|
392
|
+
description: "When the call started",
|
|
393
|
+
canReadOnRelationQuery: true,
|
|
394
|
+
})
|
|
395
|
+
@Column({
|
|
396
|
+
nullable: true,
|
|
397
|
+
type: ColumnType.Date,
|
|
398
|
+
})
|
|
399
|
+
public startedAt?: Date = undefined;
|
|
400
|
+
|
|
401
|
+
@ColumnAccessControl({
|
|
402
|
+
create: [],
|
|
403
|
+
read: [
|
|
404
|
+
Permission.ProjectOwner,
|
|
405
|
+
Permission.ProjectAdmin,
|
|
406
|
+
Permission.ProjectMember,
|
|
407
|
+
Permission.ReadProjectIncomingCallLog,
|
|
408
|
+
],
|
|
409
|
+
update: [],
|
|
410
|
+
})
|
|
411
|
+
@TableColumn({
|
|
412
|
+
required: false,
|
|
413
|
+
type: TableColumnType.Date,
|
|
414
|
+
title: "Ended At",
|
|
415
|
+
description: "When the call ended",
|
|
416
|
+
})
|
|
417
|
+
@Column({
|
|
418
|
+
nullable: true,
|
|
419
|
+
type: ColumnType.Date,
|
|
420
|
+
})
|
|
421
|
+
public endedAt?: Date = undefined;
|
|
422
|
+
|
|
423
|
+
@ColumnAccessControl({
|
|
424
|
+
create: [],
|
|
425
|
+
read: [
|
|
426
|
+
Permission.ProjectOwner,
|
|
427
|
+
Permission.ProjectAdmin,
|
|
428
|
+
Permission.ProjectMember,
|
|
429
|
+
Permission.ReadProjectIncomingCallLog,
|
|
430
|
+
],
|
|
431
|
+
update: [],
|
|
432
|
+
})
|
|
433
|
+
@TableColumn({
|
|
434
|
+
manyToOneRelationColumn: "answeredByUserId",
|
|
435
|
+
type: TableColumnType.Entity,
|
|
436
|
+
modelType: User,
|
|
437
|
+
title: "Answered By User",
|
|
438
|
+
description: "User who answered the call",
|
|
439
|
+
})
|
|
440
|
+
@ManyToOne(
|
|
441
|
+
() => {
|
|
442
|
+
return User;
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
eager: false,
|
|
446
|
+
nullable: true,
|
|
447
|
+
onDelete: "SET NULL",
|
|
448
|
+
orphanedRowAction: "nullify",
|
|
449
|
+
},
|
|
450
|
+
)
|
|
451
|
+
@JoinColumn({ name: "answeredByUserId" })
|
|
452
|
+
public answeredByUser?: User = undefined;
|
|
453
|
+
|
|
454
|
+
@ColumnAccessControl({
|
|
455
|
+
create: [],
|
|
456
|
+
read: [
|
|
457
|
+
Permission.ProjectOwner,
|
|
458
|
+
Permission.ProjectAdmin,
|
|
459
|
+
Permission.ProjectMember,
|
|
460
|
+
Permission.ReadProjectIncomingCallLog,
|
|
461
|
+
],
|
|
462
|
+
update: [],
|
|
463
|
+
})
|
|
464
|
+
@TableColumn({
|
|
465
|
+
type: TableColumnType.ObjectID,
|
|
466
|
+
title: "Answered By User ID",
|
|
467
|
+
description: "User ID who answered the call",
|
|
468
|
+
})
|
|
469
|
+
@Column({
|
|
470
|
+
type: ColumnType.ObjectID,
|
|
471
|
+
nullable: true,
|
|
472
|
+
transformer: ObjectID.getDatabaseTransformer(),
|
|
473
|
+
})
|
|
474
|
+
public answeredByUserId?: ObjectID = undefined;
|
|
475
|
+
|
|
476
|
+
@ColumnAccessControl({
|
|
477
|
+
create: [],
|
|
478
|
+
read: [
|
|
479
|
+
Permission.ProjectOwner,
|
|
480
|
+
Permission.ProjectAdmin,
|
|
481
|
+
Permission.ProjectMember,
|
|
482
|
+
Permission.ReadProjectIncomingCallLog,
|
|
483
|
+
],
|
|
484
|
+
update: [],
|
|
485
|
+
})
|
|
486
|
+
@TableColumn({
|
|
487
|
+
required: false,
|
|
488
|
+
type: TableColumnType.Number,
|
|
489
|
+
title: "Current Escalation Rule Order",
|
|
490
|
+
description: "The current escalation rule order being processed",
|
|
491
|
+
})
|
|
492
|
+
@Column({
|
|
493
|
+
nullable: true,
|
|
494
|
+
type: ColumnType.Number,
|
|
495
|
+
default: 1,
|
|
496
|
+
})
|
|
497
|
+
public currentEscalationRuleOrder?: number = undefined;
|
|
498
|
+
|
|
499
|
+
@ColumnAccessControl({
|
|
500
|
+
create: [],
|
|
501
|
+
read: [
|
|
502
|
+
Permission.ProjectOwner,
|
|
503
|
+
Permission.ProjectAdmin,
|
|
504
|
+
Permission.ProjectMember,
|
|
505
|
+
Permission.ReadProjectIncomingCallLog,
|
|
506
|
+
],
|
|
507
|
+
update: [],
|
|
508
|
+
})
|
|
509
|
+
@TableColumn({
|
|
510
|
+
required: false,
|
|
511
|
+
type: TableColumnType.Number,
|
|
512
|
+
title: "Repeat Count",
|
|
513
|
+
description: "Number of times the policy has been repeated",
|
|
514
|
+
})
|
|
515
|
+
@Column({
|
|
516
|
+
nullable: true,
|
|
517
|
+
type: ColumnType.Number,
|
|
518
|
+
default: 0,
|
|
519
|
+
})
|
|
520
|
+
public repeatCount?: number = undefined;
|
|
521
|
+
}
|